src/cpu/x86/vm/sharedRuntime_x86_64.cpp

Print this page




  22  *
  23  */
  24 
  25 #include "incls/_precompiled.incl"
  26 #include "incls/_sharedRuntime_x86_64.cpp.incl"
  27 
  28 DeoptimizationBlob *SharedRuntime::_deopt_blob;
  29 #ifdef COMPILER2
  30 UncommonTrapBlob   *SharedRuntime::_uncommon_trap_blob;
  31 ExceptionBlob      *OptoRuntime::_exception_blob;
  32 #endif // COMPILER2
  33 
  34 SafepointBlob      *SharedRuntime::_polling_page_safepoint_handler_blob;
  35 SafepointBlob      *SharedRuntime::_polling_page_return_handler_blob;
  36 RuntimeStub*       SharedRuntime::_wrong_method_blob;
  37 RuntimeStub*       SharedRuntime::_ic_miss_blob;
  38 RuntimeStub*       SharedRuntime::_resolve_opt_virtual_call_blob;
  39 RuntimeStub*       SharedRuntime::_resolve_virtual_call_blob;
  40 RuntimeStub*       SharedRuntime::_resolve_static_call_blob;
  41 


  42 #define __ masm->
  43 
  44 class SimpleRuntimeFrame {
  45 
  46   public:
  47 
  48   // Most of the runtime stubs have this simple frame layout.
  49   // This class exists to make the layout shared in one place.
  50   // Offsets are for compiler stack slots, which are jints.
  51   enum layout {
  52     // The frame sender code expects that rbp will be in the "natural" place and
  53     // will override any oopMap setting for it. We must therefore force the layout
  54     // so that it agrees with the frame sender code.
  55     rbp_off = frame::arg_reg_save_area_bytes/BytesPerInt,
  56     rbp_off2,
  57     return_off, return_off2,
  58     framesize
  59   };
  60 };
  61 


1269   //      | 2 slots for moves   |
1270   //      |---------------------|
1271   //      | lock box (if sync)  |
1272   //      |---------------------| <- lock_slot_offset
1273   //      | klass (if static)   |
1274   //      |---------------------| <- klass_slot_offset
1275   //      | oopHandle area      |
1276   //      |---------------------| <- oop_handle_offset (6 java arg registers)
1277   //      | outbound memory     |
1278   //      | based arguments     |
1279   //      |                     |
1280   //      |---------------------|
1281   //      |                     |
1282   // SP-> | out_preserved_slots |
1283   //
1284   //
1285 
1286 
1287   // Now compute actual number of stack words we need rounding to make
1288   // stack properly aligned.
1289   stack_slots = round_to(stack_slots, 4 * VMRegImpl::slots_per_word);
1290 
1291   int stack_size = stack_slots * VMRegImpl::stack_slot_size;
1292 
1293 
1294   // First thing make an ic check to see if we should even be here
1295 
1296   // We are free to use all registers as temps without saving them and
1297   // restoring them except rbp. rbp is the only callee save register
1298   // as far as the interpreter and the compiler(s) are concerned.
1299 
1300 
1301   const Register ic_reg = rax;
1302   const Register receiver = j_rarg0;
1303   const Register tmp = rdx;
1304 
1305   Label ok;
1306   Label exception_pending;
1307 
1308   __ verify_oop(receiver);
1309   __ push(tmp); // spill (any other registers free here???)




  22  *
  23  */
  24 
  25 #include "incls/_precompiled.incl"
  26 #include "incls/_sharedRuntime_x86_64.cpp.incl"
  27 
  28 DeoptimizationBlob *SharedRuntime::_deopt_blob;
  29 #ifdef COMPILER2
  30 UncommonTrapBlob   *SharedRuntime::_uncommon_trap_blob;
  31 ExceptionBlob      *OptoRuntime::_exception_blob;
  32 #endif // COMPILER2
  33 
  34 SafepointBlob      *SharedRuntime::_polling_page_safepoint_handler_blob;
  35 SafepointBlob      *SharedRuntime::_polling_page_return_handler_blob;
  36 RuntimeStub*       SharedRuntime::_wrong_method_blob;
  37 RuntimeStub*       SharedRuntime::_ic_miss_blob;
  38 RuntimeStub*       SharedRuntime::_resolve_opt_virtual_call_blob;
  39 RuntimeStub*       SharedRuntime::_resolve_virtual_call_blob;
  40 RuntimeStub*       SharedRuntime::_resolve_static_call_blob;
  41 
  42 const int StackAlignmentInSlots = StackAlignmentInBytes / VMRegImpl::stack_slot_size;
  43 
  44 #define __ masm->
  45 
  46 class SimpleRuntimeFrame {
  47 
  48   public:
  49 
  50   // Most of the runtime stubs have this simple frame layout.
  51   // This class exists to make the layout shared in one place.
  52   // Offsets are for compiler stack slots, which are jints.
  53   enum layout {
  54     // The frame sender code expects that rbp will be in the "natural" place and
  55     // will override any oopMap setting for it. We must therefore force the layout
  56     // so that it agrees with the frame sender code.
  57     rbp_off = frame::arg_reg_save_area_bytes/BytesPerInt,
  58     rbp_off2,
  59     return_off, return_off2,
  60     framesize
  61   };
  62 };
  63 


1271   //      | 2 slots for moves   |
1272   //      |---------------------|
1273   //      | lock box (if sync)  |
1274   //      |---------------------| <- lock_slot_offset
1275   //      | klass (if static)   |
1276   //      |---------------------| <- klass_slot_offset
1277   //      | oopHandle area      |
1278   //      |---------------------| <- oop_handle_offset (6 java arg registers)
1279   //      | outbound memory     |
1280   //      | based arguments     |
1281   //      |                     |
1282   //      |---------------------|
1283   //      |                     |
1284   // SP-> | out_preserved_slots |
1285   //
1286   //
1287 
1288 
1289   // Now compute actual number of stack words we need rounding to make
1290   // stack properly aligned.
1291   stack_slots = round_to(stack_slots, StackAlignmentInSlots);
1292 
1293   int stack_size = stack_slots * VMRegImpl::stack_slot_size;
1294 
1295 
1296   // First thing make an ic check to see if we should even be here
1297 
1298   // We are free to use all registers as temps without saving them and
1299   // restoring them except rbp. rbp is the only callee save register
1300   // as far as the interpreter and the compiler(s) are concerned.
1301 
1302 
1303   const Register ic_reg = rax;
1304   const Register receiver = j_rarg0;
1305   const Register tmp = rdx;
1306 
1307   Label ok;
1308   Label exception_pending;
1309 
1310   __ verify_oop(receiver);
1311   __ push(tmp); // spill (any other registers free here???)