1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# HG changeset patch
# User aph
# Date 1461121375 -3600
# Wed Apr 20 04:02:55 2016 +0100
# Node ID 6811f311f905409fe71d2b1c2fb34c3268758724
# Parent c66e4cc0fce57664ab44c55c47fa1a2f1bf02638
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
Upstream-Status: Backport [Fixed in u112]
diff --git hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
--- hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
+++ hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
@@ -220,9 +220,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(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 hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp
--- hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp
+++ hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp
@@ -593,8 +593,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,
|