hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
changeset 13728 882756847a04
parent 13391 30245956af37
child 14626 0cf4eccf130f
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp	Fri Aug 31 16:39:35 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp	Sat Sep 01 13:25:18 2012 -0400
@@ -30,8 +30,8 @@
 #include "interpreter/interpreterRuntime.hpp"
 #include "interpreter/templateTable.hpp"
 #include "oops/arrayOop.hpp"
-#include "oops/methodDataOop.hpp"
-#include "oops/methodOop.hpp"
+#include "oops/methodData.hpp"
+#include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "prims/jvmtiThreadState.hpp"
@@ -201,7 +201,7 @@
   __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u2));
   __ bind(L_got_cache);
   __ movl(rbx, Address(rbx, rcx,
-                    Address::times_ptr, constantPoolCacheOopDesc::base_offset() +
+                    Address::times_ptr, ConstantPoolCache::base_offset() +
                     ConstantPoolCacheEntry::flags_offset()));
   __ andptr(rbx, 0xFF);
   __ lea(rsp, Address(rsp, rbx, Interpreter::stackElementScale()));
@@ -343,34 +343,34 @@
 // rcx: invocation counter
 //
 void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue) {
-  const Address invocation_counter(rbx, in_bytes(methodOopDesc::invocation_counter_offset()) +
+  const Address invocation_counter(rbx, in_bytes(Method::invocation_counter_offset()) +
                                         in_bytes(InvocationCounter::counter_offset()));
-  // Note: In tiered we increment either counters in methodOop or in MDO depending if we're profiling or not.
+  // Note: In tiered we increment either counters in Method* or in MDO depending if we're profiling or not.
   if (TieredCompilation) {
     int increment = InvocationCounter::count_increment;
     int mask = ((1 << Tier0InvokeNotifyFreqLog)  - 1) << InvocationCounter::count_shift;
     Label no_mdo, done;
     if (ProfileInterpreter) {
       // Are we profiling?
-      __ movptr(rax, Address(rbx, methodOopDesc::method_data_offset()));
+      __ movptr(rax, Address(rbx, Method::method_data_offset()));
       __ testptr(rax, rax);
       __ jccb(Assembler::zero, no_mdo);
       // Increment counter in the MDO
-      const Address mdo_invocation_counter(rax, in_bytes(methodDataOopDesc::invocation_counter_offset()) +
+      const Address mdo_invocation_counter(rax, in_bytes(MethodData::invocation_counter_offset()) +
                                                 in_bytes(InvocationCounter::counter_offset()));
       __ increment_mask_and_jump(mdo_invocation_counter, increment, mask, rcx, false, Assembler::zero, overflow);
       __ jmpb(done);
     }
     __ bind(no_mdo);
-    // Increment counter in methodOop (we don't need to load it, it's in rcx).
+    // Increment counter in Method* (we don't need to load it, it's in rcx).
     __ increment_mask_and_jump(invocation_counter, increment, mask, rcx, true, Assembler::zero, overflow);
     __ bind(done);
   } else {
-    const Address backedge_counter  (rbx, methodOopDesc::backedge_counter_offset() +
+    const Address backedge_counter  (rbx, Method::backedge_counter_offset() +
                                           InvocationCounter::counter_offset());
 
-    if (ProfileInterpreter) { // %%% Merge this into methodDataOop
-      __ incrementl(Address(rbx,methodOopDesc::interpreter_invocation_counter_offset()));
+    if (ProfileInterpreter) { // %%% Merge this into MethodData*
+      __ incrementl(Address(rbx,Method::interpreter_invocation_counter_offset()));
     }
     // Update standard invocation counters
     __ movl(rax, backedge_counter);               // load backedge counter
@@ -424,7 +424,7 @@
   // C++ interpreter only
   // rsi - previous interpreter state pointer
 
-  const Address size_of_parameters(rbx, methodOopDesc::size_of_parameters_offset());
+  const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
 
   // InterpreterRuntime::frequency_counter_overflow takes one argument
   // indicating if the counter overflow occurs at a backwards branch (non-NULL bcp).
@@ -433,7 +433,7 @@
   __ movptr(rax, (intptr_t)false);
   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), rax);
 
-  __ movptr(rbx, Address(rbp, method_offset));   // restore methodOop
+  __ movptr(rbx, Address(rbp, method_offset));   // restore Method*
 
   // Preserve invariant that rsi/rdi contain bcp/locals of sender frame
   // and jump to the interpreted entry.
@@ -450,7 +450,7 @@
   //
   // Asm interpreter
   // rdx: number of additional locals this frame needs (what we must check)
-  // rbx,: methodOop
+  // rbx,: Method*
 
   // destroyed on exit
   // rax,
@@ -542,11 +542,11 @@
 }
 
 // Allocate monitor and lock method (asm interpreter)
-// rbx, - methodOop
+// rbx, - Method*
 //
 void InterpreterGenerator::lock_method(void) {
   // synchronize method
-  const Address access_flags      (rbx, methodOopDesc::access_flags_offset());
+  const Address access_flags      (rbx, Method::access_flags_offset());
   const Address monitor_block_top (rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
   const int entry_size            = frame::interpreter_frame_monitor_size() * wordSize;
 
@@ -566,9 +566,9 @@
     __ testl(rax, JVM_ACC_STATIC);
     __ movptr(rax, Address(rdi, Interpreter::local_offset_in_bytes(0)));  // get receiver (assume this is frequent case)
     __ jcc(Assembler::zero, done);
-    __ movptr(rax, Address(rbx, methodOopDesc::const_offset()));
-    __ movptr(rax, Address(rax, constMethodOopDesc::constants_offset()));
-    __ movptr(rax, Address(rax, constantPoolOopDesc::pool_holder_offset_in_bytes()));
+    __ movptr(rax, Address(rbx, Method::const_offset()));
+    __ movptr(rax, Address(rax, ConstMethod::constants_offset()));
+    __ movptr(rax, Address(rax, ConstantPool::pool_holder_offset_in_bytes()));
     __ movptr(rax, Address(rax, mirror_offset));
     __ bind(done);
   }
@@ -592,24 +592,24 @@
 
   __ push(rsi);                                       // set sender sp
   __ push((int32_t)NULL_WORD);                        // leave last_sp as null
-  __ movptr(rsi, Address(rbx,methodOopDesc::const_offset())); // get constMethodOop
-  __ lea(rsi, Address(rsi,constMethodOopDesc::codes_offset())); // get codebase
-  __ push(rbx);                                      // save methodOop
+  __ movptr(rsi, Address(rbx,Method::const_offset())); // get ConstMethod*
+  __ lea(rsi, Address(rsi,ConstMethod::codes_offset())); // get codebase
+  __ push(rbx);                                      // save Method*
   if (ProfileInterpreter) {
     Label method_data_continue;
-    __ movptr(rdx, Address(rbx, in_bytes(methodOopDesc::method_data_offset())));
+    __ movptr(rdx, Address(rbx, in_bytes(Method::method_data_offset())));
     __ testptr(rdx, rdx);
     __ jcc(Assembler::zero, method_data_continue);
-    __ addptr(rdx, in_bytes(methodDataOopDesc::data_offset()));
+    __ addptr(rdx, in_bytes(MethodData::data_offset()));
     __ bind(method_data_continue);
     __ push(rdx);                                       // set the mdp (method data pointer)
   } else {
     __ push(0);
   }
 
-  __ movptr(rdx, Address(rbx, methodOopDesc::const_offset()));
-  __ movptr(rdx, Address(rdx, constMethodOopDesc::constants_offset()));
-  __ movptr(rdx, Address(rdx, constantPoolOopDesc::cache_offset_in_bytes()));
+  __ movptr(rdx, Address(rbx, Method::const_offset()));
+  __ movptr(rdx, Address(rdx, ConstMethod::constants_offset()));
+  __ movptr(rdx, Address(rdx, ConstantPool::cache_offset_in_bytes()));
   __ push(rdx);                                       // set constant pool cache
   __ push(rdi);                                       // set locals pointer
   if (native_call) {
@@ -633,7 +633,7 @@
 
 address InterpreterGenerator::generate_accessor_entry(void) {
 
-  // rbx,: methodOop
+  // rbx,: Method*
   // rcx: receiver (preserve for slow entry into asm interpreter)
 
   // rsi: senderSP must preserved for slow path, set SP to it on fast path
@@ -664,14 +664,14 @@
     __ jcc(Assembler::zero, slow_path);
 
     // read first instruction word and extract bytecode @ 1 and index @ 2
-    __ movptr(rdx, Address(rbx, methodOopDesc::const_offset()));
-    __ movptr(rdi, Address(rdx, constMethodOopDesc::constants_offset()));
-    __ movl(rdx, Address(rdx, constMethodOopDesc::codes_offset()));
+    __ movptr(rdx, Address(rbx, Method::const_offset()));
+    __ movptr(rdi, Address(rdx, ConstMethod::constants_offset()));
+    __ movl(rdx, Address(rdx, ConstMethod::codes_offset()));
     // Shift codes right to get the index on the right.
     // The bytecode fetched looks like <index><0xb4><0x2a>
     __ shrl(rdx, 2*BitsPerByte);
     __ shll(rdx, exact_log2(in_words(ConstantPoolCacheEntry::size())));
-    __ movptr(rdi, Address(rdi, constantPoolOopDesc::cache_offset_in_bytes()));
+    __ movptr(rdi, Address(rdi, ConstantPool::cache_offset_in_bytes()));
 
     // rax,: local 0
     // rbx,: method
@@ -688,7 +688,7 @@
     __ movl(rcx,
             Address(rdi,
                     rdx,
-                    Address::times_ptr, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::indices_offset()));
+                    Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::indices_offset()));
     __ shrl(rcx, 2*BitsPerByte);
     __ andl(rcx, 0xFF);
     __ cmpl(rcx, Bytecodes::_getfield);
@@ -698,11 +698,11 @@
     __ movptr(rcx,
               Address(rdi,
                       rdx,
-                      Address::times_ptr, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::f2_offset()));
+                      Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::f2_offset()));
     __ movl(rdx,
             Address(rdi,
                     rdx,
-                    Address::times_ptr, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::flags_offset()));
+                    Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset()));
 
     Label notByte, notShort, notChar;
     const Address field_address (rax, rcx, Address::times_1);
@@ -789,7 +789,7 @@
   //
   // This code is based on generate_accessor_enty.
 
-  // rbx,: methodOop
+  // rbx,: Method*
   // rcx: receiver (preserve for slow entry into asm interpreter)
 
   // rsi: senderSP must preserved for slow path, set SP to it on fast path
@@ -863,15 +863,15 @@
   // determine code generation flags
   bool inc_counter  = UseCompiler || CountCompiledCalls;
 
-  // rbx,: methodOop
+  // rbx,: Method*
   // rsi: sender sp
   // rsi: previous interpreter state (C++ interpreter) must preserve
   address entry_point = __ pc();
 
 
-  const Address size_of_parameters(rbx, methodOopDesc::size_of_parameters_offset());
-  const Address invocation_counter(rbx, methodOopDesc::invocation_counter_offset() + InvocationCounter::counter_offset());
-  const Address access_flags      (rbx, methodOopDesc::access_flags_offset());
+  const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
+  const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset());
+  const Address access_flags      (rbx, Method::access_flags_offset());
 
   // get parameter size (always needed)
   __ load_unsigned_short(rcx, size_of_parameters);
@@ -880,7 +880,7 @@
   // and the arguments are already on the stack and we only add a handful of words
   // to the stack
 
-  // rbx,: methodOop
+  // rbx,: Method*
   // rcx: size of parameters
   // rsi: sender sp
 
@@ -988,8 +988,7 @@
 
   // allocate space for parameters
   __ get_method(method);
-  __ verify_oop(method);
-  __ load_unsigned_short(t, Address(method, methodOopDesc::size_of_parameters_offset()));
+  __ load_unsigned_short(t, Address(method, Method::size_of_parameters_offset()));
   __ shlptr(t, Interpreter::logStackElementSize);
   __ addptr(t, 2*wordSize);     // allocate two more slots for JNIEnv and possible mirror
   __ subptr(rsp, t);
@@ -997,12 +996,12 @@
 
   // get signature handler
   { Label L;
-    __ movptr(t, Address(method, methodOopDesc::signature_handler_offset()));
+    __ movptr(t, Address(method, Method::signature_handler_offset()));
     __ testptr(t, t);
     __ jcc(Assembler::notZero, L);
     __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::prepare_native_call), method);
     __ get_method(method);
-    __ movptr(t, Address(method, methodOopDesc::signature_handler_offset()));
+    __ movptr(t, Address(method, Method::signature_handler_offset()));
     __ bind(L);
   }
 
@@ -1024,13 +1023,13 @@
   // pass mirror handle if static call
   { Label L;
     const int mirror_offset = in_bytes(Klass::java_mirror_offset());
-    __ movl(t, Address(method, methodOopDesc::access_flags_offset()));
+    __ movl(t, Address(method, Method::access_flags_offset()));
     __ testl(t, JVM_ACC_STATIC);
     __ jcc(Assembler::zero, L);
     // get mirror
-    __ movptr(t, Address(method, methodOopDesc:: const_offset()));
-    __ movptr(t, Address(t, constMethodOopDesc::constants_offset()));
-    __ movptr(t, Address(t, constantPoolOopDesc::pool_holder_offset_in_bytes()));
+    __ movptr(t, Address(method, Method:: const_offset()));
+    __ movptr(t, Address(t, ConstMethod::constants_offset()));
+    __ movptr(t, Address(t, ConstantPool::pool_holder_offset_in_bytes()));
     __ movptr(t, Address(t, mirror_offset));
     // copy mirror into activation frame
     __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset * wordSize), t);
@@ -1042,14 +1041,13 @@
 
   // get native function entry point
   { Label L;
-    __ movptr(rax, Address(method, methodOopDesc::native_function_offset()));
+    __ movptr(rax, Address(method, Method::native_function_offset()));
     ExternalAddress unsatisfied(SharedRuntime::native_method_throw_unsatisfied_link_error_entry());
     __ cmpptr(rax, unsatisfied.addr());
     __ jcc(Assembler::notEqual, L);
     __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::prepare_native_call), method);
     __ get_method(method);
-    __ verify_oop(method);
-    __ movptr(rax, Address(method, methodOopDesc::native_function_offset()));
+    __ movptr(rax, Address(method, Method::native_function_offset()));
     __ bind(L);
   }
 
@@ -1218,9 +1216,8 @@
   // i.e., bci == 0 <=> rsi == code_base()
   // Can't call_VM until bcp is within reasonable.
   __ get_method(method);      // method is junk from thread_in_native to now.
-  __ verify_oop(method);
-  __ movptr(rsi, Address(method,methodOopDesc::const_offset()));   // get constMethodOop
-  __ lea(rsi, Address(rsi,constMethodOopDesc::codes_offset()));    // get codebase
+  __ movptr(rsi, Address(method,Method::const_offset()));   // get ConstMethod*
+  __ lea(rsi, Address(rsi,ConstMethod::codes_offset()));    // get codebase
 
   // handle exceptions (exception handling will handle unlocking!)
   { Label L;
@@ -1236,7 +1233,7 @@
 
   // do unlocking if necessary
   { Label L;
-    __ movl(t, Address(method, methodOopDesc::access_flags_offset()));
+    __ movl(t, Address(method, Method::access_flags_offset()));
     __ testl(t, JVM_ACC_SYNCHRONIZED);
     __ jcc(Assembler::zero, L);
     // the code below should be shared with interpreter macro assembler implementation
@@ -1296,20 +1293,20 @@
   // determine code generation flags
   bool inc_counter  = UseCompiler || CountCompiledCalls;
 
-  // rbx,: methodOop
+  // rbx,: Method*
   // rsi: sender sp
   address entry_point = __ pc();
 
 
-  const Address size_of_parameters(rbx, methodOopDesc::size_of_parameters_offset());
-  const Address size_of_locals    (rbx, methodOopDesc::size_of_locals_offset());
-  const Address invocation_counter(rbx, methodOopDesc::invocation_counter_offset() + InvocationCounter::counter_offset());
-  const Address access_flags      (rbx, methodOopDesc::access_flags_offset());
+  const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
+  const Address size_of_locals    (rbx, Method::size_of_locals_offset());
+  const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset());
+  const Address access_flags      (rbx, Method::access_flags_offset());
 
   // get parameter size (always needed)
   __ load_unsigned_short(rcx, size_of_parameters);
 
-  // rbx,: methodOop
+  // rbx,: Method*
   // rcx: size of parameters
 
   // rsi: sender_sp (could differ from sp+wordSize if we were called via c2i )
@@ -1464,7 +1461,7 @@
 //
 // Arguments:
 //
-// rbx,: methodOop
+// rbx,: Method*
 // rcx: receiver
 //
 //
@@ -1490,7 +1487,7 @@
 // [ expr. stack bottom ]
 // [ saved rsi          ]
 // [ current rdi        ]
-// [ methodOop          ]
+// [ Method*            ]
 // [ saved rbp,          ] <--- rbp,
 // [ return address     ]
 // [ local variable m   ]
@@ -1556,7 +1553,7 @@
 }
 
 // How much stack a method activation needs in words.
-int AbstractInterpreter::size_top_interpreter_activation(methodOop method) {
+int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
 
   const int stub_code = 4;  // see generate_call_stub
   // Save space for one monitor to get into the interpreted method in case
@@ -1568,7 +1565,7 @@
   // be sure to change this if you add/subtract anything to/from the overhead area
   const int overhead_size = -frame::interpreter_frame_initial_sp_offset;
 
-  const int extra_stack = methodOopDesc::extra_stack_entries();
+  const int extra_stack = Method::extra_stack_entries();
   const int method_stack = (method->max_locals() + method->max_stack() + extra_stack) *
                            Interpreter::stackElementWords;
   return overhead_size + method_stack + stub_code;
@@ -1576,7 +1573,7 @@
 
 // asm based interpreter deoptimization helpers
 
-int AbstractInterpreter::layout_activation(methodOop method,
+int AbstractInterpreter::layout_activation(Method* method,
                                            int tempcount,
                                            int popframe_extra_args,
                                            int moncount,
@@ -1737,8 +1734,7 @@
 
     // Compute size of arguments for saving when returning to deoptimized caller
     __ get_method(rax);
-    __ verify_oop(rax);
-    __ load_unsigned_short(rax, Address(rax, in_bytes(methodOopDesc::size_of_parameters_offset())));
+    __ load_unsigned_short(rax, Address(rax, in_bytes(Method::size_of_parameters_offset())));
     __ shlptr(rax, Interpreter::logStackElementSize);
     __ restore_locals();
     __ subptr(rdi, rax);
@@ -1815,9 +1811,7 @@
   __ remove_activation(vtos, rdx, false, true, false);
   // restore exception
   __ get_thread(thread);
-  __ movptr(rax, Address(thread, JavaThread::vm_result_offset()));
-  __ movptr(Address(thread, JavaThread::vm_result_offset()), NULL_WORD);
-  __ verify_oop(rax);
+  __ get_vm_result(rax, thread);
 
   // Inbetween activations - previous activation type unknown yet
   // compute continuation point - the continuation point expects