Mercurial > hg > openjdk > bsd-port > hotspot
changeset 5922:986d0464b2a9
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 | Thu, 14 Apr 2016 02:44:12 +0100 |
parents | 1e698c95d399 |
children | 6e42747134be |
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 Thu Apr 14 02:44:12 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: @@ -217,9 +218,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); } @@ -788,22 +796,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 Thu Apr 14 02:44:12 2016 +0100 @@ -570,8 +570,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_invokehandle,&&opc_default, &&opc_default, &&opc_default, +/* 0xE4 */ &&opc_default, &&opc_default, &&opc_fast_aldc, &&opc_fast_aldc_w, +/* 0xE8 */ &&opc_return_register_finalizer, + &&opc_invokehandle, &&opc_default, &&opc_default, /* 0xEC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, /* 0xF0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default,