changeset 4121:88506c6dc280 jdk6-b39

8154210: Zero: Better byte behaviour Summary: Complete support for 8132051 on Zero and fix failure on 64-bit big-endian systems Reviewed-by: andrew, chrisphi
author aph
date Tue, 03 May 2016 19:34:56 +0100
parents aca1d7804588
children 7561dfbeeee5
files src/cpu/zero/vm/cppInterpreter_zero.cpp src/share/vm/interpreter/bytecodeInterpreter.cpp
diffstat 2 files changed, 17 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/zero/vm/cppInterpreter_zero.cpp	Sun Feb 21 08:33:59 2016 -0500
+++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp	Tue May 03 19:34:56 2016 +0100
@@ -91,6 +91,7 @@
     case T_SHORT:
       return (intptr_t)(jshort)result;
     case T_OBJECT:  // nothing to do fall through
+    case T_ARRAY:
     case T_LONG:
     case T_INT:
     case T_FLOAT:
@@ -236,9 +237,16 @@
   // Push our result
   for (int i = 0; i < result_slots; i++) {
     // Adjust result to smaller
-    intptr_t res = result[-i];
+    union {
+      intptr_t res;
+      jint res_jint;
+    };
+    res = result[-i];
     if (result_slots == 1) {
-      res = narrow(result_type_of(method), res);
+      BasicType t = result_type_of(method);
+      if (is_subword_type(t)) {
+        res_jint = (jint)narrow(t, res_jint);
+      }
     }
     stack->push(res);
   }
@@ -1318,22 +1326,10 @@
 }
 
 BasicType CppInterpreter::result_type_of(methodOop method) {
-  BasicType t;
-  switch (method->result_index()) {
-    case 0 : t = T_BOOLEAN; break;
-    case 1 : t = T_CHAR;    break;
-    case 2 : t = T_BYTE;    break;
-    case 3 : t = T_SHORT;   break;
-    case 4 : t = T_INT;     break;
-    case 5 : t = T_LONG;    break;
-    case 6 : t = T_VOID;    break;
-    case 7 : t = T_FLOAT;   break;
-    case 8 : t = T_DOUBLE;  break;
-    case 9 : t = T_OBJECT;  break;
-    default: ShouldNotReachHere();
-  }
-  assert(AbstractInterpreter::BasicType_as_index(t) == method->result_index(),
-         "out of step with AbstractInterpreter::BasicType_as_index");
+  // Get method->_constMethod->_result_type
+  u1 *p = ((unsigned char *)method->constMethod()
+           + in_bytes(constMethodOopDesc::result_type_offset()));
+  BasicType t = (BasicType)*p;
   return t;
 }
 
--- a/src/share/vm/interpreter/bytecodeInterpreter.cpp	Sun Feb 21 08:33:59 2016 -0500
+++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp	Tue May 03 19:34:56 2016 +0100
@@ -574,8 +574,9 @@
 /* 0xDC */ &&opc_default,     &&opc_default,        &&opc_default,      &&opc_default,
 
 /* 0xE0 */ &&opc_default,     &&opc_default,        &&opc_default,      &&opc_default,
-/* 0xE4 */ &&opc_default,     &&opc_fast_aldc,      &&opc_fast_aldc_w,  &&opc_return_register_finalizer,
-/* 0xE8 */ &&opc_default,     &&opc_default,        &&opc_default,      &&opc_default,
+/* 0xE4 */ &&opc_default,     &&opc_default,        &&opc_fast_aldc,    &&opc_fast_aldc_w,
+/* 0xE8 */ &&opc_return_register_finalizer,
+                              &&opc_default,        &&opc_default,      &&opc_default,
 /* 0xEC */ &&opc_default,     &&opc_default,        &&opc_default,      &&opc_default,
 
 /* 0xF0 */ &&opc_default,     &&opc_default,        &&opc_default,      &&opc_default,