< prev index next >

src/hotspot/cpu/sparc/frame_sparc.cpp

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "code/codeCache.hpp"
  27 #include "interpreter/interpreter.hpp"
  28 #include "memory/resourceArea.hpp"
  29 #include "memory/universe.hpp"
  30 #include "oops/markOop.hpp"
  31 #include "oops/method.hpp"
  32 #include "oops/oop.inline.hpp"
  33 #include "prims/methodHandles.hpp"
  34 #include "runtime/frame.inline.hpp"
  35 #include "runtime/handles.inline.hpp"
  36 #include "runtime/javaCalls.hpp"
  37 #include "runtime/monitorChunk.hpp"
  38 #include "runtime/signature.hpp"
  39 #include "runtime/stubCodeGenerator.hpp"
  40 #include "runtime/stubRoutines.hpp"
  41 #include "vmreg_sparc.inline.hpp"
  42 #ifdef COMPILER1
  43 #include "c1/c1_Runtime1.hpp"
  44 #include "runtime/vframeArray.hpp"
  45 #endif
  46 
  47 void RegisterMap::pd_clear() {
  48   if (_thread->has_last_Java_frame()) {
  49     frame fr = _thread->last_frame();


 649   Method* m = *interpreter_frame_method_addr();
 650 
 651   // validate the method we'd find in this potential sender
 652   if (!Method::is_valid_method(m)) return false;
 653 
 654   // stack frames shouldn't be much larger than max_stack elements
 655 
 656   if (fp() - unextended_sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
 657     return false;
 658   }
 659 
 660   // validate bci/bcp
 661 
 662   address bcp = interpreter_frame_bcp();
 663   if (m->validate_bci_from_bcp(bcp) < 0) {
 664     return false;
 665   }
 666 
 667   // validate ConstantPoolCache*
 668   ConstantPoolCache* cp = *interpreter_frame_cache_addr();
 669   if (MetaspaceObj::is_valid(cp) == false) return false;
 670 
 671   // validate locals
 672 
 673   address locals =  (address) *interpreter_frame_locals_addr();
 674 
 675   if (locals > thread->stack_base() || locals < (address) fp()) return false;
 676 
 677   // We'd have to be pretty unlucky to be mislead at this point
 678   return true;
 679 }
 680 
 681 
 682 // Windows have been flushed on entry (but not marked). Capture the pc that
 683 // is the return address to the frame that contains "sp" as its stack pointer.
 684 // This pc resides in the called of the frame corresponding to "sp".
 685 // As a side effect we mark this JavaFrameAnchor as having flushed the windows.
 686 // This side effect lets us mark stacked JavaFrameAnchors (stacked in the
 687 // call_helper) as flushed when we have flushed the windows for the most
 688 // recent (i.e. current) JavaFrameAnchor. This saves useless flushing calls
 689 // and lets us find the pc just once rather than multiple times as it did




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "code/codeCache.hpp"
  27 #include "interpreter/interpreter.hpp"
  28 #include "memory/resourceArea.hpp"

  29 #include "oops/markOop.hpp"
  30 #include "oops/method.hpp"
  31 #include "oops/oop.inline.hpp"
  32 #include "prims/methodHandles.hpp"
  33 #include "runtime/frame.inline.hpp"
  34 #include "runtime/handles.inline.hpp"
  35 #include "runtime/javaCalls.hpp"
  36 #include "runtime/monitorChunk.hpp"
  37 #include "runtime/signature.hpp"
  38 #include "runtime/stubCodeGenerator.hpp"
  39 #include "runtime/stubRoutines.hpp"
  40 #include "vmreg_sparc.inline.hpp"
  41 #ifdef COMPILER1
  42 #include "c1/c1_Runtime1.hpp"
  43 #include "runtime/vframeArray.hpp"
  44 #endif
  45 
  46 void RegisterMap::pd_clear() {
  47   if (_thread->has_last_Java_frame()) {
  48     frame fr = _thread->last_frame();


 648   Method* m = *interpreter_frame_method_addr();
 649 
 650   // validate the method we'd find in this potential sender
 651   if (!Method::is_valid_method(m)) return false;
 652 
 653   // stack frames shouldn't be much larger than max_stack elements
 654 
 655   if (fp() - unextended_sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
 656     return false;
 657   }
 658 
 659   // validate bci/bcp
 660 
 661   address bcp = interpreter_frame_bcp();
 662   if (m->validate_bci_from_bcp(bcp) < 0) {
 663     return false;
 664   }
 665 
 666   // validate ConstantPoolCache*
 667   ConstantPoolCache* cp = *interpreter_frame_cache_addr();
 668   if (cp == NULL || !cp->is_metaspace_object()) return false;
 669 
 670   // validate locals
 671 
 672   address locals =  (address) *interpreter_frame_locals_addr();
 673 
 674   if (locals > thread->stack_base() || locals < (address) fp()) return false;
 675 
 676   // We'd have to be pretty unlucky to be mislead at this point
 677   return true;
 678 }
 679 
 680 
 681 // Windows have been flushed on entry (but not marked). Capture the pc that
 682 // is the return address to the frame that contains "sp" as its stack pointer.
 683 // This pc resides in the called of the frame corresponding to "sp".
 684 // As a side effect we mark this JavaFrameAnchor as having flushed the windows.
 685 // This side effect lets us mark stacked JavaFrameAnchors (stacked in the
 686 // call_helper) as flushed when we have flushed the windows for the most
 687 // recent (i.e. current) JavaFrameAnchor. This saves useless flushing calls
 688 // and lets us find the pc just once rather than multiple times as it did


< prev index next >