< prev index next >

src/hotspot/cpu/x86/frame_x86.cpp

Print this page




   8  *
   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 "interpreter/interpreter.hpp"
  27 #include "memory/resourceArea.hpp"
  28 #include "memory/universe.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/os.inline.hpp"
  38 #include "runtime/signature.hpp"
  39 #include "runtime/stubCodeGenerator.hpp"
  40 #include "runtime/stubRoutines.hpp"
  41 #include "vmreg_x86.inline.hpp"
  42 #ifdef COMPILER1
  43 #include "c1/c1_Runtime1.hpp"
  44 #include "runtime/vframeArray.hpp"
  45 #endif
  46 
  47 #ifdef ASSERT
  48 void RegisterMap::check_location_valid() {


 530   if (!Method::is_valid_method(m)) return false;
 531 
 532   // stack frames shouldn't be much larger than max_stack elements
 533   // this test requires the use the unextended_sp which is the sp as seen by
 534   // the current frame, and not sp which is the "raw" pc which could point
 535   // further because of local variables of the callee method inserted after
 536   // method arguments
 537   if (fp() - unextended_sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
 538     return false;
 539   }
 540 
 541   // validate bci/bcp
 542 
 543   address bcp = interpreter_frame_bcp();
 544   if (m->validate_bci_from_bcp(bcp) < 0) {
 545     return false;
 546   }
 547 
 548   // validate ConstantPoolCache*
 549   ConstantPoolCache* cp = *interpreter_frame_cache_addr();
 550   if (MetaspaceObj::is_valid(cp) == false) return false;
 551 
 552   // validate locals
 553 
 554   address locals =  (address) *interpreter_frame_locals_addr();
 555 
 556   if (locals > thread->stack_base() || locals < (address) fp()) return false;
 557 
 558   // We'd have to be pretty unlucky to be mislead at this point
 559   return true;
 560 }
 561 
 562 BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) {
 563   assert(is_interpreted_frame(), "interpreted frame expected");
 564   Method* method = interpreter_frame_method();
 565   BasicType type = method->result_type();
 566 
 567   intptr_t* tos_addr;
 568   if (method->is_native()) {
 569     // Prior to calling into the runtime to report the method_exit the possible
 570     // return value is pushed to the native stack. If the result is a jfloat/jdouble




   8  *
   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 "interpreter/interpreter.hpp"
  27 #include "memory/resourceArea.hpp"

  28 #include "oops/markOop.hpp"
  29 #include "oops/method.hpp"
  30 #include "oops/oop.inline.hpp"
  31 #include "prims/methodHandles.hpp"
  32 #include "runtime/frame.inline.hpp"
  33 #include "runtime/handles.inline.hpp"
  34 #include "runtime/javaCalls.hpp"
  35 #include "runtime/monitorChunk.hpp"
  36 #include "runtime/os.inline.hpp"
  37 #include "runtime/signature.hpp"
  38 #include "runtime/stubCodeGenerator.hpp"
  39 #include "runtime/stubRoutines.hpp"
  40 #include "vmreg_x86.inline.hpp"
  41 #ifdef COMPILER1
  42 #include "c1/c1_Runtime1.hpp"
  43 #include "runtime/vframeArray.hpp"
  44 #endif
  45 
  46 #ifdef ASSERT
  47 void RegisterMap::check_location_valid() {


 529   if (!Method::is_valid_method(m)) return false;
 530 
 531   // stack frames shouldn't be much larger than max_stack elements
 532   // this test requires the use the unextended_sp which is the sp as seen by
 533   // the current frame, and not sp which is the "raw" pc which could point
 534   // further because of local variables of the callee method inserted after
 535   // method arguments
 536   if (fp() - unextended_sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
 537     return false;
 538   }
 539 
 540   // validate bci/bcp
 541 
 542   address bcp = interpreter_frame_bcp();
 543   if (m->validate_bci_from_bcp(bcp) < 0) {
 544     return false;
 545   }
 546 
 547   // validate ConstantPoolCache*
 548   ConstantPoolCache* cp = *interpreter_frame_cache_addr();
 549   if (cp == NULL || !cp->is_metaspace_object()) return false;
 550 
 551   // validate locals
 552 
 553   address locals =  (address) *interpreter_frame_locals_addr();
 554 
 555   if (locals > thread->stack_base() || locals < (address) fp()) return false;
 556 
 557   // We'd have to be pretty unlucky to be mislead at this point
 558   return true;
 559 }
 560 
 561 BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) {
 562   assert(is_interpreted_frame(), "interpreted frame expected");
 563   Method* method = interpreter_frame_method();
 564   BasicType type = method->result_type();
 565 
 566   intptr_t* tos_addr;
 567   if (method->is_native()) {
 568     // Prior to calling into the runtime to report the method_exit the possible
 569     // return value is pushed to the native stack. If the result is a jfloat/jdouble


< prev index next >