hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp
changeset 37480 291ee208fb72
parent 37439 e8970711113b
child 40010 e32d5e545789
--- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp	Mon Apr 18 15:39:46 2016 -0700
+++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp	Tue Oct 13 18:13:34 2015 -0400
@@ -74,6 +74,7 @@
         Interpreter::_trace_code =
           EntryPoint(
                      generate_trace_code(btos),
+                     generate_trace_code(ztos),
                      generate_trace_code(ctos),
                      generate_trace_code(stos),
                      generate_trace_code(atos),
@@ -94,6 +95,7 @@
                        generate_return_entry_for(itos, i, index_size),
                        generate_return_entry_for(itos, i, index_size),
                        generate_return_entry_for(itos, i, index_size),
+                       generate_return_entry_for(itos, i, index_size),
                        generate_return_entry_for(atos, i, index_size),
                        generate_return_entry_for(itos, i, index_size),
                        generate_return_entry_for(ltos, i, index_size),
@@ -105,13 +107,16 @@
       }
 
       { CodeletMark cm(_masm, "invoke return entry points");
-        const TosState states[] = {itos, itos, itos, itos, ltos, ftos, dtos, atos, vtos};
+        // These states are in order specified in TosState, except btos/ztos/ctos/stos are
+        // really the same as itos since there is no top of stack optimization for these types
+        const TosState states[] = {itos, itos, itos, itos, itos, ltos, ftos, dtos, atos, vtos, ilgl};
         const int invoke_length = Bytecodes::length_for(Bytecodes::_invokestatic);
         const int invokeinterface_length = Bytecodes::length_for(Bytecodes::_invokeinterface);
         const int invokedynamic_length = Bytecodes::length_for(Bytecodes::_invokedynamic);
 
         for (int i = 0; i < Interpreter::number_of_return_addrs; i++) {
           TosState state = states[i];
+          assert(state != ilgl, "states array is wrong above");
           Interpreter::_invoke_return_entry[i] = generate_return_entry_for(state, invoke_length, sizeof(u2));
           Interpreter::_invokeinterface_return_entry[i] = generate_return_entry_for(state, invokeinterface_length, sizeof(u2));
           Interpreter::_invokedynamic_return_entry[i] = generate_return_entry_for(state, invokedynamic_length, sizeof(u4));
@@ -122,6 +127,7 @@
         Interpreter::_earlyret_entry =
           EntryPoint(
                      generate_earlyret_entry_for(btos),
+                     generate_earlyret_entry_for(ztos),
                      generate_earlyret_entry_for(ctos),
                      generate_earlyret_entry_for(stos),
                      generate_earlyret_entry_for(atos),
@@ -140,6 +146,7 @@
                        generate_deopt_entry_for(itos, i),
                        generate_deopt_entry_for(itos, i),
                        generate_deopt_entry_for(itos, i),
+                       generate_deopt_entry_for(itos, i),
                        generate_deopt_entry_for(atos, i),
                        generate_deopt_entry_for(itos, i),
                        generate_deopt_entry_for(ltos, i),
@@ -167,6 +174,7 @@
         Interpreter::_continuation_entry =
           EntryPoint(
                      generate_continuation_for(btos),
+                     generate_continuation_for(ztos),
                      generate_continuation_for(ctos),
                      generate_continuation_for(stos),
                      generate_continuation_for(atos),
@@ -182,6 +190,7 @@
         Interpreter::_safept_entry =
           EntryPoint(
                      generate_safept_entry_for(btos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
+                     generate_safept_entry_for(ztos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
                      generate_safept_entry_for(ctos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
                      generate_safept_entry_for(stos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
                      generate_safept_entry_for(atos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)),
@@ -301,7 +310,7 @@
 
 void TemplateInterpreterGenerator::set_unimplemented(int i) {
   address e = _unimplemented_bytecode;
-  EntryPoint entry(e, e, e, e, e, e, e, e, e);
+  EntryPoint entry(e, e, e, e, e, e, e, e, e, e);
   Interpreter::_normal_table.set_entry(i, entry);
   Interpreter::_wentry_point[i] = _unimplemented_bytecode;
 }
@@ -316,6 +325,7 @@
   assert(_unimplemented_bytecode    != NULL, "should have been generated before");
   assert(_illegal_bytecode_sequence != NULL, "should have been generated before");
   address bep = _illegal_bytecode_sequence;
+  address zep = _illegal_bytecode_sequence;
   address cep = _illegal_bytecode_sequence;
   address sep = _illegal_bytecode_sequence;
   address aep = _illegal_bytecode_sequence;
@@ -337,7 +347,7 @@
     set_wide_entry_point(t, wep);
   }
   // set entry points
-  EntryPoint entry(bep, cep, sep, aep, iep, lep, fep, dep, vep);
+  EntryPoint entry(bep, zep, cep, sep, aep, iep, lep, fep, dep, vep);
   Interpreter::_normal_table.set_entry(code, entry);
   Interpreter::_wentry_point[code] = wep;
   CodeCacheExtensions::completed_template_interpreter_entries(_masm, code);
@@ -355,6 +365,7 @@
   assert(t->is_valid(), "template must exist");
   switch (t->tos_in()) {
     case btos:
+    case ztos:
     case ctos:
     case stos:
       ShouldNotReachHere();  // btos/ctos/stos should use itos.