diff src/cpu/x86/vm/templateInterpreter_x86_64.cpp @ 9046:c6a1ffc707ff

Comments and #ifdef GRAAL for recent changes to C++ code for calling nmethods directly.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 12 Apr 2013 17:22:54 +0200
parents ff5a32117e02
children 836a62f43af9
line wrap: on
line diff
--- a/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Fri Apr 12 06:19:35 2013 +0200
+++ b/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Fri Apr 12 17:22:54 2013 +0200
@@ -873,6 +873,8 @@
   return generate_accessor_entry();
 }
 
+#ifdef GRAAL
+
 // Interpreter stub for calling a compiled method with 3 object arguments
 address InterpreterGenerator::generate_execute_compiled_method_entry() {
   address entry_point = __ pc();
@@ -891,14 +893,27 @@
   // as far as the placement of the call instruction
   __ push(rax);
 
+  // Move first object argument from interpreter calling convention to compiled
+  // code calling convention.
   __ movq(j_rarg0, Address(r11, Interpreter::stackElementSize*5));
+
+  // Move second object argument.
   __ movq(j_rarg1, Address(r11, Interpreter::stackElementSize*4));
+
+  // Move third object argument.
   __ movq(j_rarg2, Address(r11, Interpreter::stackElementSize*3));
+
+  // Load the raw pointer to the nmethod.
   __ movq(j_rarg3, Address(r11, Interpreter::stackElementSize));
+
+  // Perform a tail call to the verified entry point of the nmethod.
   __ jmp(Address(j_rarg3, nmethod::verified_entry_point_offset()));
+
   return entry_point;
 }
 
+#endif
+
 // Interpreter stub for calling a native method. (asm interpreter)
 // This sets up a somewhat different looking stack for calling the
 // native method than the typical interpreter frame setup.
@@ -1586,7 +1601,9 @@
   switch (kind) {
   case Interpreter::zerolocals             :                                                                             break;
   case Interpreter::zerolocals_synchronized: synchronized = true;                                                        break;
+#ifdef GRAAL
   case Interpreter::execute_compiled_method: entry_point = ((InterpreterGenerator*)this)->generate_execute_compiled_method_entry(); break;
+#endif
   case Interpreter::native                 : entry_point = ((InterpreterGenerator*)this)->generate_native_entry(false); break;
   case Interpreter::native_synchronized    : entry_point = ((InterpreterGenerator*)this)->generate_native_entry(true);  break;
   case Interpreter::empty                  : entry_point = ((InterpreterGenerator*)this)->generate_empty_entry();       break;