From 117c5b4f26b94c0a72564a4fb595476fef3c46fc Mon Sep 17 00:00:00 2001 From: aph Date: Tue, 26 Apr 2016 02:49:59 +0100 Subject: [PATCH] 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, coleenp --- src/cpu/zero/vm/cppInterpreter_zero.cpp | 11 +++++++++-- src/share/vm/interpreter/bytecodeInterpreter.cpp | 5 +++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/cpu/zero/vm/cppInterpreter_zero.cpp b/src/cpu/zero/vm/cppInterpreter_zero.cpp index 15cfc86aa..242ce1cfd 100644 --- a/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -220,9 +220,16 @@ void CppInterpreter::main_loop(int recurse, TRAPS) { // 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(method->result_type(), res); + BasicType t = method->result_type(); + if (is_subword_type(t)) { + res_jint = (jint)narrow(t, res_jint); + } } stack->push(res); } diff --git a/src/share/vm/interpreter/bytecodeInterpreter.cpp b/src/share/vm/interpreter/bytecodeInterpreter.cpp index eed4a35f0..59e1fb95b 100644 --- a/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -593,8 +593,9 @@ BytecodeInterpreter::run(interpreterState istate) { /* 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, -- GitLab