src/cpu/x86/vm/sharedRuntime_x86_32.cpp

Print this page




  22  *
  23  */
  24 
  25 #include "incls/_precompiled.incl"
  26 #include "incls/_sharedRuntime_x86_32.cpp.incl"
  27 
  28 #define __ masm->
  29 #ifdef COMPILER2
  30 UncommonTrapBlob   *SharedRuntime::_uncommon_trap_blob;
  31 #endif // COMPILER2
  32 
  33 DeoptimizationBlob *SharedRuntime::_deopt_blob;
  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 class RegisterSaver {
  43   enum { FPU_regs_live = 8 /*for the FPU stack*/+8/*eight more for XMM registers*/ };
  44   // Capture info about frame layout
  45   enum layout {
  46                 fpu_state_off = 0,
  47                 fpu_state_end = fpu_state_off+FPUStateSizeInWords-1,
  48                 st0_off, st0H_off,
  49                 st1_off, st1H_off,
  50                 st2_off, st2H_off,
  51                 st3_off, st3H_off,
  52                 st4_off, st4H_off,
  53                 st5_off, st5H_off,
  54                 st6_off, st6H_off,
  55                 st7_off, st7H_off,
  56 
  57                 xmm0_off, xmm0H_off,
  58                 xmm1_off, xmm1H_off,
  59                 xmm2_off, xmm2H_off,
  60                 xmm3_off, xmm3H_off,
  61                 xmm4_off, xmm4H_off,


1282   //      | oopHandle area      |
1283   //      |---------------------| <- oop_handle_offset (a max of 2 registers)
1284   //      | outbound memory     |
1285   //      | based arguments     |
1286   //      |                     |
1287   //      |---------------------|
1288   //      |                     |
1289   // SP-> | out_preserved_slots |
1290   //
1291   //
1292   // ****************************************************************************
1293   // WARNING - on Windows Java Natives use pascal calling convention and pop the
1294   // arguments off of the stack after the jni call. Before the call we can use
1295   // instructions that are SP relative. After the jni call we switch to FP
1296   // relative instructions instead of re-adjusting the stack on windows.
1297   // ****************************************************************************
1298 
1299 
1300   // Now compute actual number of stack words we need rounding to make
1301   // stack properly aligned.
1302   stack_slots = round_to(stack_slots, 2 * VMRegImpl::slots_per_word);
1303 
1304   int stack_size = stack_slots * VMRegImpl::stack_slot_size;
1305 
1306   intptr_t start = (intptr_t)__ pc();
1307 
1308   // First thing make an ic check to see if we should even be here
1309 
1310   // We are free to use all registers as temps without saving them and
1311   // restoring them except rbp,. rbp, is the only callee save register
1312   // as far as the interpreter and the compiler(s) are concerned.
1313 
1314 
1315   const Register ic_reg = rax;
1316   const Register receiver = rcx;
1317   Label hit;
1318   Label exception_pending;
1319 
1320 
1321   __ verify_oop(receiver);
1322   __ cmpptr(ic_reg, Address(receiver, oopDesc::klass_offset_in_bytes()));




  22  *
  23  */
  24 
  25 #include "incls/_precompiled.incl"
  26 #include "incls/_sharedRuntime_x86_32.cpp.incl"
  27 
  28 #define __ masm->
  29 #ifdef COMPILER2
  30 UncommonTrapBlob   *SharedRuntime::_uncommon_trap_blob;
  31 #endif // COMPILER2
  32 
  33 DeoptimizationBlob *SharedRuntime::_deopt_blob;
  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 class RegisterSaver {
  45   enum { FPU_regs_live = 8 /*for the FPU stack*/+8/*eight more for XMM registers*/ };
  46   // Capture info about frame layout
  47   enum layout {
  48                 fpu_state_off = 0,
  49                 fpu_state_end = fpu_state_off+FPUStateSizeInWords-1,
  50                 st0_off, st0H_off,
  51                 st1_off, st1H_off,
  52                 st2_off, st2H_off,
  53                 st3_off, st3H_off,
  54                 st4_off, st4H_off,
  55                 st5_off, st5H_off,
  56                 st6_off, st6H_off,
  57                 st7_off, st7H_off,
  58 
  59                 xmm0_off, xmm0H_off,
  60                 xmm1_off, xmm1H_off,
  61                 xmm2_off, xmm2H_off,
  62                 xmm3_off, xmm3H_off,
  63                 xmm4_off, xmm4H_off,


1284   //      | oopHandle area      |
1285   //      |---------------------| <- oop_handle_offset (a max of 2 registers)
1286   //      | outbound memory     |
1287   //      | based arguments     |
1288   //      |                     |
1289   //      |---------------------|
1290   //      |                     |
1291   // SP-> | out_preserved_slots |
1292   //
1293   //
1294   // ****************************************************************************
1295   // WARNING - on Windows Java Natives use pascal calling convention and pop the
1296   // arguments off of the stack after the jni call. Before the call we can use
1297   // instructions that are SP relative. After the jni call we switch to FP
1298   // relative instructions instead of re-adjusting the stack on windows.
1299   // ****************************************************************************
1300 
1301 
1302   // Now compute actual number of stack words we need rounding to make
1303   // stack properly aligned.
1304   stack_slots = round_to(stack_slots, StackAlignmentInSlots);
1305   
1306   int stack_size = stack_slots * VMRegImpl::stack_slot_size;
1307 
1308   intptr_t start = (intptr_t)__ pc();
1309 
1310   // First thing make an ic check to see if we should even be here
1311 
1312   // We are free to use all registers as temps without saving them and
1313   // restoring them except rbp,. rbp, is the only callee save register
1314   // as far as the interpreter and the compiler(s) are concerned.
1315 
1316 
1317   const Register ic_reg = rax;
1318   const Register receiver = rcx;
1319   Label hit;
1320   Label exception_pending;
1321 
1322 
1323   __ verify_oop(receiver);
1324   __ cmpptr(ic_reg, Address(receiver, oopDesc::klass_offset_in_bytes()));