annotate src/share/vm/graal/graalCodeInstaller.cpp @ 6950:41938af2b3d8

modifications to support non-perm-gen changes in HotSpot fixed issue when intrinsifying Class.getModifiers() for primitive classes
author Doug Simon <doug.simon@oracle.com>
date Wed, 14 Nov 2012 11:28:02 +0100
parents e522a00b91aa
children eec373d34caf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2516
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
1 /*
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
4 *
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
7 * published by the Free Software Foundation.
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
8 *
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
13 * accompanied this code).
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
14 *
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
15 * You should have received a copy of the GNU General Public License version
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
18 *
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
21 * questions.
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
22 */
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
23
2045
9c96c873c42b Fix includes to match new hotspot mechanism.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1942
diff changeset
24 #include "precompiled.hpp"
6559
d5f7e737827f fixed compilation issues on Solaris. When using SunStudio compiler, Solaris build with DONT_USE_PRECOMPILED_HEADER
Laurent Daynes <Laurent.Daynes@oracle.com>
parents: 6539
diff changeset
25 #include "runtime/javaCalls.hpp"
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
26 #include "graal/graalCompiler.hpp"
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
27 #include "graal/graalCodeInstaller.hpp"
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
28 #include "graal/graalJavaAccess.hpp"
4221
bcbb918f5ac6 Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4220
diff changeset
29 #include "graal/graalCompilerToVM.hpp"
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
30 #include "graal/graalVmIds.hpp"
3636
c7d4198a9bce Use GraalEnv for installing code.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3619
diff changeset
31 #include "graal/graalEnv.hpp"
2045
9c96c873c42b Fix includes to match new hotspot mechanism.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1942
diff changeset
32 #include "c1/c1_Runtime1.hpp"
2048
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
33 #include "classfile/vmSymbols.hpp"
2045
9c96c873c42b Fix includes to match new hotspot mechanism.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1942
diff changeset
34 #include "vmreg_x86.inline.hpp"
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
35
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
36
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
37 // TODO this should be handled in a more robust way - not hard coded...
1444
c0e244017dad Corrections of oop map generation.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1441
diff changeset
38 Register CPU_REGS[] = { rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, r15 };
c0e244017dad Corrections of oop map generation.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1441
diff changeset
39 bool OOP_ALLOWED[] = {true, true, true, true, false, false, true, true, true, true, false, true, true, true, true, true};
1438
a7a0ef3c6858 Added timing printout on VM shutdown.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1435
diff changeset
40 const static int NUM_CPU_REGS = sizeof(CPU_REGS) / sizeof(Register);
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
41 XMMRegister XMM_REGS[] = { xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 };
1438
a7a0ef3c6858 Added timing printout on VM shutdown.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1435
diff changeset
42 const static int NUM_XMM_REGS = sizeof(XMM_REGS) / sizeof(XMMRegister);
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
43 const static int NUM_REGS = NUM_CPU_REGS + NUM_XMM_REGS;
1468
e4cd5d2de7e1 Changes to sync with CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 1465
diff changeset
44 const static jlong NO_REF_MAP = 0x8000000000000000L;
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
45
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
46 // convert Graal register indices (as used in oop maps) to HotSpot registers
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
47 VMReg get_hotspot_reg(jint graal_reg) {
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
48
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
49 assert(graal_reg >= 0 && graal_reg < NUM_REGS, "invalid register number");
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
50 if (graal_reg < NUM_CPU_REGS) {
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
51 return CPU_REGS[graal_reg]->as_VMReg();
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
52 } else {
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
53 return XMM_REGS[graal_reg - NUM_CPU_REGS]->as_VMReg();
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
54 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
55 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
56
5542
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
57 const int MapWordBits = 64;
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
58
1469
52bb06250d35 Converted CiDebugInfo.registerRefMap field from type long to CiBitMap.
Doug Simon <doug.simon@oracle.com>
parents: 1468
diff changeset
59 static bool is_bit_set(oop bit_map, int i) {
5542
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
60 jint extra_idx = i / MapWordBits;
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
61 arrayOop extra = (arrayOop) GraalBitMap::words(bit_map);
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
62 assert(extra_idx >= 0 && extra_idx < extra->length(), "unexpected index");
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
63 jlong word = ((jlong*) extra->base(T_LONG))[extra_idx];
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
64 return (word & (1LL << (i % MapWordBits))) != 0;
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
65 }
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
66
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
67 static int bitmap_size(oop bit_map) {
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
68 arrayOop arr = (arrayOop) GraalBitMap::words(bit_map);
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
69 return arr->length() * MapWordBits;
1469
52bb06250d35 Converted CiDebugInfo.registerRefMap field from type long to CiBitMap.
Doug Simon <doug.simon@oracle.com>
parents: 1468
diff changeset
70 }
52bb06250d35 Converted CiDebugInfo.registerRefMap field from type long to CiBitMap.
Doug Simon <doug.simon@oracle.com>
parents: 1468
diff changeset
71
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
72 // creates a HotSpot oop map out of the byte arrays provided by DebugInfo
4174
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
73 static OopMap* create_oop_map(jint total_frame_size, jint parameter_count, oop debug_info) {
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
74 OopMap* map = new OopMap(total_frame_size, parameter_count);
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
75 oop register_map = (oop) DebugInfo::registerRefMap(debug_info);
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
76 oop frame_map = (oop) DebugInfo::frameRefMap(debug_info);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
77
1469
52bb06250d35 Converted CiDebugInfo.registerRefMap field from type long to CiBitMap.
Doug Simon <doug.simon@oracle.com>
parents: 1468
diff changeset
78 if (register_map != NULL) {
1465
2c754f3a2722 Inlining of static final field values. Java mirror instead of VmID. Support for PrintMetrics option.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1462
diff changeset
79 for (jint i = 0; i < NUM_CPU_REGS; i++) {
1469
52bb06250d35 Converted CiDebugInfo.registerRefMap field from type long to CiBitMap.
Doug Simon <doug.simon@oracle.com>
parents: 1468
diff changeset
80 bool is_oop = is_bit_set(register_map, i);
1465
2c754f3a2722 Inlining of static final field values. Java mirror instead of VmID. Support for PrintMetrics option.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1462
diff changeset
81 VMReg reg = get_hotspot_reg(i);
2c754f3a2722 Inlining of static final field values. Java mirror instead of VmID. Support for PrintMetrics option.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1462
diff changeset
82 if (is_oop) {
2c754f3a2722 Inlining of static final field values. Java mirror instead of VmID. Support for PrintMetrics option.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1462
diff changeset
83 assert(OOP_ALLOWED[i], "this register may never be an oop, register map misaligned?");
2c754f3a2722 Inlining of static final field values. Java mirror instead of VmID. Support for PrintMetrics option.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1462
diff changeset
84 map->set_oop(reg);
2c754f3a2722 Inlining of static final field values. Java mirror instead of VmID. Support for PrintMetrics option.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1462
diff changeset
85 } else {
2c754f3a2722 Inlining of static final field values. Java mirror instead of VmID. Support for PrintMetrics option.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1462
diff changeset
86 map->set_value(reg);
2c754f3a2722 Inlining of static final field values. Java mirror instead of VmID. Support for PrintMetrics option.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1462
diff changeset
87 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
88 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
89 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
90
5542
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
91 for (jint i = 0; i < bitmap_size(frame_map); i++) {
4174
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
92 bool is_oop = is_bit_set(frame_map, i);
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
93 // HotSpot stack slots are 4 bytes
4174
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
94 VMReg reg = VMRegImpl::stack2reg(i * 2);
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
95 if (is_oop) {
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
96 map->set_oop(reg);
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
97 } else {
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
98 map->set_value(reg);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
99 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
100 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
101
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
102 return map;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
103 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
104
4174
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
105 static ScopeValue* get_hotspot_value(oop value, int total_frame_size, GrowableArray<ScopeValue*>* objects, ScopeValue* &second) {
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
106 second = NULL;
6539
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 6521
diff changeset
107 if (value == Value::ILLEGAL()) {
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
108 return new LocationValue(Location::new_stk_loc(Location::invalid, 0));
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
109 }
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
110
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
111 BasicType type = GraalCompiler::kindToBasicType(Kind::typeChar(Value::kind(value)));
1449
8cfe3537a0d3 Pointer verification stub. Two loose oop fixes in C1X C++ part. Logging which methods have been compiled.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1444
diff changeset
112 Location::Type locationType = Location::normal;
8cfe3537a0d3 Pointer verification stub. Two loose oop fixes in C1X C++ part. Logging which methods have been compiled.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1444
diff changeset
113 if (type == T_OBJECT || type == T_ARRAY) locationType = Location::oop;
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
114
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
115 if (value->is_a(RegisterValue::klass())) {
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
116 jint number = code_Register::number(RegisterValue::reg(value));
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
117 if (number < 16) {
4232
382523fc390c jsr return addresses are valid in registers
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4229
diff changeset
118 if (type == T_INT || type == T_FLOAT || type == T_SHORT || type == T_CHAR || type == T_BOOLEAN || type == T_BYTE || type == T_ADDRESS) {
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
119 locationType = Location::int_in_long;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
120 } else if (type == T_LONG) {
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
121 locationType = Location::lng;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
122 } else {
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
123 assert(type == T_OBJECT || type == T_ARRAY, "unexpected type in cpu register");
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
124 }
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
125 ScopeValue* value = new LocationValue(Location::new_reg_loc(locationType, as_Register(number)->as_VMReg()));
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
126 if (type == T_LONG) {
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
127 second = value;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
128 }
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
129 return value;
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
130 } else {
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
131 assert(type == T_FLOAT || type == T_DOUBLE, "only float and double expected in xmm register");
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
132 if (type == T_FLOAT) {
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
133 // this seems weird, but the same value is used in c1_LinearScan
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
134 locationType = Location::normal;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
135 } else {
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
136 locationType = Location::dbl;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
137 }
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
138 ScopeValue* value = new LocationValue(Location::new_reg_loc(locationType, as_XMMRegister(number - 16)->as_VMReg()));
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
139 if (type == T_DOUBLE) {
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
140 second = value;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
141 }
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
142 return value;
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
143 }
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
144 } else if (value->is_a(StackSlot::klass())) {
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
145 if (type == T_DOUBLE) {
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
146 locationType = Location::dbl;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
147 } else if (type == T_LONG) {
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
148 locationType = Location::lng;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
149 }
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
150 jint offset = StackSlot::offset(value);
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
151 if (StackSlot::addFrameSize(value)) {
4181
319860ae697a Simplify FrameMap: make offsets of spill slots and outgoing parameters independent so that they can be allocated at the same time, eliminating the separate phases. This makes the separate StackBlock unnecesary. Change CiStackSlot to use byte offsets instead of spill slot index. This makes CiTarget.spillSlotSize unnecessary.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4174
diff changeset
152 offset += total_frame_size;
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
153 }
4181
319860ae697a Simplify FrameMap: make offsets of spill slots and outgoing parameters independent so that they can be allocated at the same time, eliminating the separate phases. This makes the separate StackBlock unnecesary. Change CiStackSlot to use byte offsets instead of spill slot index. This makes CiTarget.spillSlotSize unnecessary.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4174
diff changeset
154 ScopeValue* value = new LocationValue(Location::new_stk_loc(locationType, offset));
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
155 if (type == T_DOUBLE || type == T_LONG) {
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
156 second = value;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
157 }
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
158 return value;
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
159 } else if (value->is_a(Constant::klass())){
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
160 oop obj = Constant::object(value);
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
161 jlong prim = Constant::primitive(value);
1476
1f81c0d18c75 Build also release version of VM. Fix towards making SpecJVM2008 run.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1472
diff changeset
162 if (type == T_INT || type == T_FLOAT || type == T_SHORT || type == T_CHAR || type == T_BOOLEAN || type == T_BYTE) {
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
163 return new ConstantIntValue(*(jint*)&prim);
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
164 } else if (type == T_LONG || type == T_DOUBLE) {
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
165 second = new ConstantIntValue(0);
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
166 return new ConstantLongValue(prim);
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
167 } else if (type == T_OBJECT) {
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
168 oop obj = Constant::object(value);
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
169 if (obj == NULL) {
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
170 return new ConstantOopWriteValue(NULL);
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
171 } else {
3669
53636e2c9d03 No longer use shared ciFactory. Remove make_global usage in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3668
diff changeset
172 return new ConstantOopWriteValue(JNIHandles::make_local(obj));
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
173 }
1476
1f81c0d18c75 Build also release version of VM. Fix towards making SpecJVM2008 run.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1472
diff changeset
174 } else if (type == T_ADDRESS) {
1f81c0d18c75 Build also release version of VM. Fix towards making SpecJVM2008 run.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1472
diff changeset
175 return new ConstantLongValue(prim);
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
176 }
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
177 tty->print("%i", type);
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
178 } else if (value->is_a(VirtualObject::klass())) {
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
179 oop type = VirtualObject::type(value);
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
180 int id = VirtualObject::id(value);
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
181 oop javaMirror = HotSpotResolvedJavaType::javaMirror(type);
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
182 Klass* klass = java_lang_Class::as_Klass(javaMirror);
5104
9ec2917fd0de Allow ints to be put into a virtual long array.
Andreas Woess <andreas.woess@jku.at>
parents: 5000
diff changeset
183 bool isLongArray = klass == Universe::longArrayKlassObj();
3090
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
184
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
185 for (jint i = 0; i < objects->length(); i++) {
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
186 ObjectValue* obj = (ObjectValue*) objects->at(i);
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
187 if (obj->id() == id) {
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
188 return obj;
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
189 }
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
190 }
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
191
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
192 ObjectValue* sv = new ObjectValue(id, new ConstantOopWriteValue(JNIHandles::make_local(Thread::current(), javaMirror)));
6351
c5024000ff0f fix for cyclic references in virtual objects
Lukas Stadler <lukas.stadler@jku.at>
parents: 5839
diff changeset
193 objects->append(sv);
3090
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
194
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
195 arrayOop values = (arrayOop) VirtualObject::values(value);
3090
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
196 for (jint i = 0; i < values->length(); i++) {
3133
5aeb62416609 Fixed an issue in the C++ code of the escape analysis (wrongly commented out code).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3091
diff changeset
197 ScopeValue* cur_second = NULL;
4174
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
198 ScopeValue* value = get_hotspot_value(((oop*) values->base(T_OBJECT))[i], total_frame_size, objects, cur_second);
3133
5aeb62416609 Fixed an issue in the C++ code of the escape analysis (wrongly commented out code).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3091
diff changeset
199
5126
43d5ae1051f7 added better debug output when an optimistic deoptimization is disabled
Christian Haeubl <christian.haeubl@oracle.com>
parents: 5104
diff changeset
200 if (isLongArray && cur_second == NULL) {
43d5ae1051f7 added better debug output when an optimistic deoptimization is disabled
Christian Haeubl <christian.haeubl@oracle.com>
parents: 5104
diff changeset
201 // we're trying to put ints into a long array... this isn't really valid, but it's used for some optimizations.
43d5ae1051f7 added better debug output when an optimistic deoptimization is disabled
Christian Haeubl <christian.haeubl@oracle.com>
parents: 5104
diff changeset
202 // add an int 0 constant
5144
f7b2800b1738 Use VM_LITTLE_ENDIAN to determine endianness.
Andreas Woess <andreas.woess@jku.at>
parents: 5130
diff changeset
203 #ifdef VM_LITTLE_ENDIAN
f7b2800b1738 Use VM_LITTLE_ENDIAN to determine endianness.
Andreas Woess <andreas.woess@jku.at>
parents: 5130
diff changeset
204 cur_second = new ConstantIntValue(0);
f7b2800b1738 Use VM_LITTLE_ENDIAN to determine endianness.
Andreas Woess <andreas.woess@jku.at>
parents: 5130
diff changeset
205 #else
5126
43d5ae1051f7 added better debug output when an optimistic deoptimization is disabled
Christian Haeubl <christian.haeubl@oracle.com>
parents: 5104
diff changeset
206 cur_second = value;
43d5ae1051f7 added better debug output when an optimistic deoptimization is disabled
Christian Haeubl <christian.haeubl@oracle.com>
parents: 5104
diff changeset
207 value = new ConstantIntValue(0);
43d5ae1051f7 added better debug output when an optimistic deoptimization is disabled
Christian Haeubl <christian.haeubl@oracle.com>
parents: 5104
diff changeset
208 #endif
5104
9ec2917fd0de Allow ints to be put into a virtual long array.
Andreas Woess <andreas.woess@jku.at>
parents: 5000
diff changeset
209 }
9ec2917fd0de Allow ints to be put into a virtual long array.
Andreas Woess <andreas.woess@jku.at>
parents: 5000
diff changeset
210
3133
5aeb62416609 Fixed an issue in the C++ code of the escape analysis (wrongly commented out code).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3091
diff changeset
211 if (cur_second != NULL) {
5aeb62416609 Fixed an issue in the C++ code of the escape analysis (wrongly commented out code).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3091
diff changeset
212 sv->field_values()->append(cur_second);
5aeb62416609 Fixed an issue in the C++ code of the escape analysis (wrongly commented out code).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3091
diff changeset
213 }
3090
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
214 sv->field_values()->append(value);
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
215 }
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
216 return sv;
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
217 } else {
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
218 value->klass()->print();
1462
1845386f5403 Full GC after bootstrap. Disable IRChecker by default. Disable compiled method logging by default.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1458
diff changeset
219 value->print();
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
220 }
2215
999f8086cc4f More changes to make it compile and work on win64.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 2182
diff changeset
221 ShouldNotReachHere();
999f8086cc4f More changes to make it compile and work on win64.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 2182
diff changeset
222 return NULL;
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
223 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
224
4174
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
225 static MonitorValue* get_monitor_value(oop value, int total_frame_size, GrowableArray<ScopeValue*>* objects) {
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
226 guarantee(value->is_a(code_MonitorValue::klass()), "Monitors must be of type MonitorValue");
3714
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
227
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
228 ScopeValue* second = NULL;
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
229 ScopeValue* owner_value = get_hotspot_value(code_MonitorValue::owner(value), total_frame_size, objects, second);
3714
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
230 assert(second == NULL, "monitor cannot occupy two stack slots");
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
231
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
232 ScopeValue* lock_data_value = get_hotspot_value(code_MonitorValue::lockData(value), total_frame_size, objects, second);
4174
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
233 assert(second == lock_data_value, "monitor is LONG value that occupies two stack slots");
3714
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
234 assert(lock_data_value->is_location(), "invalid monitor location");
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
235 Location lock_data_loc = ((LocationValue*)lock_data_value)->location();
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
236
3717
4177ddd2d1d1 Fix build error for Windows builds
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3714
diff changeset
237 bool eliminated = false;
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
238 if (code_MonitorValue::eliminated(value)) {
3717
4177ddd2d1d1 Fix build error for Windows builds
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3714
diff changeset
239 eliminated = true;
4177ddd2d1d1 Fix build error for Windows builds
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3714
diff changeset
240 }
3714
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
241
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
242 return new MonitorValue(owner_value, lock_data_loc, eliminated);
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
243 }
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
244
3670
f198b24093f3 put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3669
diff changeset
245 void CodeInstaller::initialize_assumptions(oop target_method) {
3664
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
246 _oop_recorder = new OopRecorder(_env->arena());
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
247 _env->set_oop_recorder(_oop_recorder);
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
248 _env->set_dependencies(_dependencies);
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
249 _dependencies = new Dependencies(_env);
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
250 Handle assumptions_handle = CompilationResult::assumptions(HotSpotCompilationResult::comp(target_method));
3664
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
251 if (!assumptions_handle.is_null()) {
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
252 objArrayHandle assumptions(Thread::current(), (objArrayOop)Assumptions::list(assumptions_handle()));
3670
f198b24093f3 put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3669
diff changeset
253 int length = assumptions->length();
f198b24093f3 put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3669
diff changeset
254 for (int i = 0; i < length; ++i) {
3672
5e331d5f760e removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3670
diff changeset
255 Handle assumption = assumptions->obj_at(i);
5e331d5f760e removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3670
diff changeset
256 if (!assumption.is_null()) {
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
257 if (assumption->klass() == Assumptions_MethodContents::klass()) {
4670
41034914e2ee add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents: 4583
diff changeset
258 assumption_MethodContents(assumption);
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
259 } else if (assumption->klass() == Assumptions_ConcreteSubtype::klass()) {
3672
5e331d5f760e removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3670
diff changeset
260 assumption_ConcreteSubtype(assumption);
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
261 } else if (assumption->klass() == Assumptions_ConcreteMethod::klass()) {
3672
5e331d5f760e removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3670
diff changeset
262 assumption_ConcreteMethod(assumption);
3657
47edfca346ab Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
263 } else {
47edfca346ab Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
264 assumption->print();
47edfca346ab Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
265 fatal("unexpected Assumption subclass");
47edfca346ab Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
266 }
47edfca346ab Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
267 }
47edfca346ab Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
268 }
47edfca346ab Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
269 }
3668
46f211fe010c Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3667
diff changeset
270 }
46f211fe010c Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3667
diff changeset
271
46f211fe010c Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3667
diff changeset
272 // constructor used to create a method
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
273 CodeInstaller::CodeInstaller(Handle& comp_result, methodHandle method, nmethod*& nm, bool bind_to_method) {
3668
46f211fe010c Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3667
diff changeset
274 _env = CURRENT_ENV;
46f211fe010c Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3667
diff changeset
275 GraalCompiler::initialize_buffer_blob();
46f211fe010c Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3667
diff changeset
276 CodeBuffer buffer(JavaThread::current()->get_buffer_blob());
5839
58a607307306 renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
277 jobject comp_result_obj = JNIHandles::make_local(comp_result());
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6948
diff changeset
278 jint entry_bci = HotSpotCompilationResult::entryBCI(comp_result);
5839
58a607307306 renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
279 initialize_assumptions(JNIHandles::resolve(comp_result_obj));
1465
2c754f3a2722 Inlining of static final field values. Java mirror instead of VmID. Support for PrintMetrics option.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1462
diff changeset
280
3664
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
281 {
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
282 No_Safepoint_Verifier no_safepoint;
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
283 initialize_fields(JNIHandles::resolve(comp_result_obj), method);
3664
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
284 initialize_buffer(buffer);
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
285 process_exception_handlers();
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
286 }
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
287
4174
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
288 int stack_slots = _total_frame_size / HeapWordSize; // conversion to words
4319
3c21eee8ab4d Add installMethodCallback() to HotSpotRuntime.
Andreas Woess <andreas.woess@jku.at>
parents: 4232
diff changeset
289
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6948
diff changeset
290 nm = GraalEnv::register_method(method, entry_bci, &_offsets, _custom_stack_area_offset, &buffer, stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table,
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
291 &_implicit_exception_table, GraalCompiler::instance(), _debug_recorder, _dependencies, NULL, -1, true, false, bind_to_method);
4319
3c21eee8ab4d Add installMethodCallback() to HotSpotRuntime.
Andreas Woess <andreas.woess@jku.at>
parents: 4232
diff changeset
292
3650
0e8a2a629afb Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3636
diff changeset
293 method->clear_queued_for_compilation();
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
294 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
295
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
296 // constructor used to create a stub
5275
290b3025b66f added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents: 5259
diff changeset
297 CodeInstaller::CodeInstaller(Handle& target_method, BufferBlob*& blob, jlong& id) {
1465
2c754f3a2722 Inlining of static final field values. Java mirror instead of VmID. Support for PrintMetrics option.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1462
diff changeset
298 No_Safepoint_Verifier no_safepoint;
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
299 _env = CURRENT_ENV;
3664
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
300
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
301 _oop_recorder = new OopRecorder(_env->arena());
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
302 _env->set_oop_recorder(_oop_recorder);
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
303 initialize_fields(target_method(), NULL);
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
304 assert(_name != NULL, "installMethod needs NON-NULL name");
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
305
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
306 // (very) conservative estimate: each site needs a relocation
3555
22d11b3bc561 Various hacks to be able to install machine code from a Java thread.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3554
diff changeset
307 GraalCompiler::initialize_buffer_blob();
22d11b3bc561 Various hacks to be able to install machine code from a Java thread.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3554
diff changeset
308 CodeBuffer buffer(JavaThread::current()->get_buffer_blob());
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
309 initialize_buffer(buffer);
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
310
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
311 const char* cname = java_lang_String::as_utf8_string(_name);
5275
290b3025b66f added support for disassembling code after installation (so that the result of patching and relocation can be seen)
Doug Simon <doug.simon@oracle.com>
parents: 5259
diff changeset
312 blob = BufferBlob::create(strdup(cname), &buffer); // this is leaking strings... but only a limited number of stubs will be created
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
313 IF_TRACE_graal_3 Disassembler::decode((CodeBlob*) blob);
1931
48bbaead8b6c Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1484
diff changeset
314 id = VmIds::addStub(blob->code_begin());
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
315 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
316
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
317 void CodeInstaller::initialize_fields(oop comp_result, methodHandle method) {
5839
58a607307306 renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
318 _comp_result = HotSpotCompilationResult::comp(comp_result);
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
319 if (!method.is_null()) {
5839
58a607307306 renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
320 _parameter_count = method->size_of_parameters();
58a607307306 renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
321 TRACE_graal_1("installing code for %s", method->name_and_sig_as_C_string());
3660
c805dfba251d Fixed regression.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3659
diff changeset
322 }
5839
58a607307306 renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
323 _name = HotSpotCompilationResult::name(comp_result);
58a607307306 renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
324 _sites = (arrayOop) HotSpotCompilationResult::sites(comp_result);
58a607307306 renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
325 _exception_handlers = (arrayOop) HotSpotCompilationResult::exceptionHandlers(comp_result);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
326
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
327 _code = (arrayOop) CompilationResult::targetCode(_comp_result);
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
328 _code_size = CompilationResult::targetCodeSize(_comp_result);
4174
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
329 // The frame size we get from the target method does not include the return address, so add one word for it here.
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
330 _total_frame_size = CompilationResult::frameSize(_comp_result) + HeapWordSize;
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
331 _custom_stack_area_offset = CompilationResult::customStackAreaOffset(_comp_result);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
332
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
333 // (very) conservative estimate: each site needs a constant section entry
2495
c737ee310b39 Small adjustment to assertion and constants size calculation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2494
diff changeset
334 _constants_size = _sites->length() * (BytesPerLong*2);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
335 _total_size = align_size_up(_code_size, HeapWordSize) + _constants_size;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
336
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
337 _next_call_type = MARK_INVOKE_INVALID;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
338 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
339
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
340 // perform data and call relocation on the CodeBuffer
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
341 void CodeInstaller::initialize_buffer(CodeBuffer& buffer) {
1931
48bbaead8b6c Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1484
diff changeset
342 int locs_buffer_size = _sites->length() * (relocInfo::length_limit + sizeof(relocInfo));
48bbaead8b6c Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1484
diff changeset
343 char* locs_buffer = NEW_RESOURCE_ARRAY(char, locs_buffer_size);
48bbaead8b6c Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1484
diff changeset
344 buffer.insts()->initialize_shared_locs((relocInfo*)locs_buffer, locs_buffer_size / sizeof(relocInfo));
48bbaead8b6c Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1484
diff changeset
345 buffer.initialize_stubs_size(256);
48bbaead8b6c Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1484
diff changeset
346 buffer.initialize_consts_size(_constants_size);
48bbaead8b6c Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1484
diff changeset
347
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
348 _debug_recorder = new DebugInformationRecorder(_env->oop_recorder());
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
349 _debug_recorder->set_oopmaps(new OopMapSet());
3664
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
350
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
351 _env->set_debug_info(_debug_recorder);
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
352 buffer.initialize_oop_recorder(_oop_recorder);
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
353
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
354 _instructions = buffer.insts();
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
355 _constants = buffer.consts();
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
356
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
357 // copy the code into the newly created CodeBuffer
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
358 memcpy(_instructions->start(), _code->base(T_BYTE), _code_size);
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
359 _instructions->set_end(_instructions->start() + _code_size);
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
360
1432
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
361 oop* sites = (oop*) _sites->base(T_OBJECT);
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
362 for (int i = 0; i < _sites->length(); i++) {
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
363 oop site = sites[i];
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
364 jint pc_offset = CompilationResult_Site::pcOffset(site);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
365
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
366 if (site->is_a(CompilationResult_Call::klass())) {
3561
bea018622324 Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 3560
diff changeset
367 TRACE_graal_4("call at %i", pc_offset);
bea018622324 Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 3560
diff changeset
368 site_Call(buffer, pc_offset, site);
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
369 } else if (site->is_a(CompilationResult_Safepoint::klass())) {
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
370 TRACE_graal_4("safepoint at %i", pc_offset);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
371 site_Safepoint(buffer, pc_offset, site);
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
372 } else if (site->is_a(CompilationResult_DataPatch::klass())) {
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
373 TRACE_graal_4("datapatch at %i", pc_offset);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
374 site_DataPatch(buffer, pc_offset, site);
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
375 } else if (site->is_a(CompilationResult_Mark::klass())) {
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
376 TRACE_graal_4("mark at %i", pc_offset);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
377 site_Mark(buffer, pc_offset, site);
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
378 } else {
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
379 fatal("unexpected Site subclass");
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
380 }
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
381 }
2048
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
382 }
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
383
4670
41034914e2ee add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents: 4583
diff changeset
384 void CodeInstaller::assumption_MethodContents(Handle assumption) {
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
385 Handle method_handle = Assumptions_MethodContents::method(assumption());
4670
41034914e2ee add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents: 4583
diff changeset
386 methodHandle method = getMethodFromHotSpotMethod(method_handle());
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
387 ciMethod* m = (ciMethod*) CURRENT_ENV->get_method(method());
4670
41034914e2ee add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents: 4583
diff changeset
388
41034914e2ee add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents: 4583
diff changeset
389 _dependencies->assert_evol_method(m);
41034914e2ee add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents: 4583
diff changeset
390 }
41034914e2ee add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents: 4583
diff changeset
391
3672
5e331d5f760e removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3670
diff changeset
392 void CodeInstaller::assumption_ConcreteSubtype(Handle assumption) {
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
393 Handle context_handle = Assumptions_ConcreteSubtype::context(assumption());
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
394 ciKlass* context = (ciKlass*) CURRENT_ENV->get_klass(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(context_handle)));
2048
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
395
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
396 Handle type_handle = Assumptions_ConcreteSubtype::subtype(assumption());
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
397 ciKlass* type = (ciKlass*) CURRENT_ENV->get_klass(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(type_handle)));
2048
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
398
2050
b6d2c238e585 Two fixes for leaf type and leaf method assumptions.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2049
diff changeset
399 _dependencies->assert_leaf_type(type);
3672
5e331d5f760e removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3670
diff changeset
400 if (context != type) {
2048
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
401 assert(context->is_abstract(), "");
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
402 _dependencies->assert_abstract_with_unique_concrete_subtype(context, type);
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
403 }
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
404 }
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
405
3672
5e331d5f760e removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3670
diff changeset
406 void CodeInstaller::assumption_ConcreteMethod(Handle assumption) {
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
407 Handle impl_handle = Assumptions_ConcreteMethod::impl(assumption());
3704
342a54994e05 Made C++ changes to reflect changes to CiAssumptions.ConcreteMethod.
Doug Simon <doug.simon@oracle.com>
parents: 3690
diff changeset
408 methodHandle impl = getMethodFromHotSpotMethod(impl_handle());
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
409 ciMethod* m = (ciMethod*) CURRENT_ENV->get_method(impl());
3670
f198b24093f3 put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3669
diff changeset
410
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
411 Handle context_handle = Assumptions_ConcreteMethod::context(assumption());
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
412 ciKlass* context = (ciKlass*) CURRENT_ENV->get_klass(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(context_handle)));
3704
342a54994e05 Made C++ changes to reflect changes to CiAssumptions.ConcreteMethod.
Doug Simon <doug.simon@oracle.com>
parents: 3690
diff changeset
413 _dependencies->assert_unique_concrete_method(context, m);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
414 }
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
415
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
416 void CodeInstaller::process_exception_handlers() {
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
417 // allocate some arrays for use by the collection code.
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
418 const int num_handlers = 5;
1432
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
419 GrowableArray<intptr_t>* bcis = new GrowableArray<intptr_t> (num_handlers);
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
420 GrowableArray<intptr_t>* scope_depths = new GrowableArray<intptr_t> (num_handlers);
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
421 GrowableArray<intptr_t>* pcos = new GrowableArray<intptr_t> (num_handlers);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
422
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
423 if (_exception_handlers != NULL) {
1432
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
424 oop* exception_handlers = (oop*) _exception_handlers->base(T_OBJECT);
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
425 for (int i = 0; i < _exception_handlers->length(); i++) {
4693
07bcee8b70a4 Simplify exception debug information and exception handler table creation based on Graal's simplified model of exception handler information (i.e. the dispatch is done in compiled code).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4691
diff changeset
426 oop exc = exception_handlers[i];
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
427 jint pc_offset = CompilationResult_Site::pcOffset(exc);
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
428 jint handler_offset = CompilationResult_ExceptionHandler::handlerPos(exc);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
429
4693
07bcee8b70a4 Simplify exception debug information and exception handler table creation based on Graal's simplified model of exception handler information (i.e. the dispatch is done in compiled code).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4691
diff changeset
430 // Subtable header
07bcee8b70a4 Simplify exception debug information and exception handler table creation based on Graal's simplified model of exception handler information (i.e. the dispatch is done in compiled code).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4691
diff changeset
431 _exception_handler_table.add_entry(HandlerTableEntry(1, pc_offset, 0));
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
432
4693
07bcee8b70a4 Simplify exception debug information and exception handler table creation based on Graal's simplified model of exception handler information (i.e. the dispatch is done in compiled code).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4691
diff changeset
433 // Subtable entry
07bcee8b70a4 Simplify exception debug information and exception handler table creation based on Graal's simplified model of exception handler information (i.e. the dispatch is done in compiled code).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4691
diff changeset
434 _exception_handler_table.add_entry(HandlerTableEntry(-1, handler_offset, 0));
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
435 }
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
436 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
437 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
438
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
439 void CodeInstaller::record_scope(jint pc_offset, oop frame, GrowableArray<ScopeValue*>* objects) {
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
440 assert(frame->klass() == BytecodeFrame::klass(), "BytecodeFrame expected");
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
441 oop caller_frame = BytecodePosition::caller(frame);
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
442 if (caller_frame != NULL) {
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
443 record_scope(pc_offset, caller_frame, objects);
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
444 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
445
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
446 oop hotspot_method = BytecodePosition::method(frame);
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
447 Method* method = getMethodFromHotSpotMethod(hotspot_method);
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
448 jint bci = BytecodePosition::bci(frame);
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
449 bool reexecute;
6388
6b74f44c5059 added Log.printObject() and Log.printlnObject() for more detailed logging of objects
Doug Simon <doug.simon@oracle.com>
parents: 6351
diff changeset
450 if (bci == -1 || bci == -2){
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
451 reexecute = false;
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
452 } else {
2182
9569fdf936ff Made merge compile.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2059
diff changeset
453 Bytecodes::Code code = Bytecodes::java_code_at(method, method->bcp_from(bci));
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
454 reexecute = Interpreter::bytecode_should_reexecute(code);
4678
a03f3fd16b22 Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4670
diff changeset
455 if (frame != NULL) {
6515
e722fa145b37 Fixed VS2010 warnings in HotSpot.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 6446
diff changeset
456 reexecute = (BytecodeFrame::duringCall(frame) == JNI_FALSE);
4678
a03f3fd16b22 Fix reexecute boolean in HotSpot debug information. Introduce "duringCall" flag in FrameState that indicates that the bci of the frame state denotes an invoke that should *not* be reexecuted.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4670
diff changeset
457 }
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
458 }
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
459
2901
d577d07cedec Added time measurement for phases.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2891
diff changeset
460 if (TraceGraal >= 2) {
1937
4853c5cad3aa More deoptmization tracing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1936
diff changeset
461 tty->print_cr("Recording scope pc_offset=%d bci=%d frame=%d", pc_offset, bci, frame);
4853c5cad3aa More deoptmization tracing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1936
diff changeset
462 }
4853c5cad3aa More deoptmization tracing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1936
diff changeset
463
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
464 jint local_count = BytecodeFrame::numLocals(frame);
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
465 jint expression_count = BytecodeFrame::numStack(frame);
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
466 jint monitor_count = BytecodeFrame::numLocks(frame);
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
467 arrayOop values = (arrayOop) BytecodeFrame::values(frame);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
468
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
469 assert(local_count + expression_count + monitor_count == values->length(), "unexpected values length");
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
470
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
471 GrowableArray<ScopeValue*>* locals = new GrowableArray<ScopeValue*> ();
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
472 GrowableArray<ScopeValue*>* expressions = new GrowableArray<ScopeValue*> ();
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
473 GrowableArray<MonitorValue*>* monitors = new GrowableArray<MonitorValue*> ();
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
474
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
475 if (TraceGraal >= 2) {
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
476 tty->print_cr("Scope at bci %d with %d values", bci, values->length());
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
477 tty->print_cr("%d locals %d expressions, %d monitors", local_count, expression_count, monitor_count);
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
478 }
1936
8d88c9ac9247 Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1931
diff changeset
479
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
480 for (jint i = 0; i < values->length(); i++) {
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
481 ScopeValue* second = NULL;
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
482 oop value = ((oop*) values->base(T_OBJECT))[i];
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
483
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
484 if (i < local_count) {
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
485 ScopeValue* first = get_hotspot_value(value, _total_frame_size, objects, second);
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
486 if (second != NULL) {
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
487 locals->append(second);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
488 }
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
489 locals->append(first);
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
490 } else if (i < local_count + expression_count) {
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
491 ScopeValue* first = get_hotspot_value(value, _total_frame_size, objects, second);
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
492 if (second != NULL) {
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
493 expressions->append(second);
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
494 }
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
495 expressions->append(first);
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
496 } else {
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
497 monitors->append(get_monitor_value(value, _total_frame_size, objects));
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
498 }
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
499 if (second != NULL) {
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
500 i++;
6539
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 6521
diff changeset
501 assert(i < values->length(), "double-slot value not followed by Value.ILLEGAL");
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 6521
diff changeset
502 assert(((oop*) values->base(T_OBJECT))[i] == Value::ILLEGAL(), "double-slot value not followed by Value.ILLEGAL");
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
503 }
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
504 }
3090
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
505
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
506 _debug_recorder->dump_object_pool(objects);
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
507
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
508 DebugToken* locals_token = _debug_recorder->create_scope_values(locals);
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
509 DebugToken* expressions_token = _debug_recorder->create_scope_values(expressions);
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
510 DebugToken* monitors_token = _debug_recorder->create_monitor_values(monitors);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
511
6515
e722fa145b37 Fixed VS2010 warnings in HotSpot.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 6446
diff changeset
512 bool throw_exception = BytecodeFrame::rethrowException(frame) == JNI_TRUE;
3018
5857923e563c Fixed an issue with frame states in exception dispatch chains (now we are correctly rethrowing the exception immediately at entering the interpreter).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 3011
diff changeset
513
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
514 _debug_recorder->describe_scope(pc_offset, method, NULL, bci, reexecute, throw_exception, false, false, locals_token, expressions_token, monitors_token);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
515 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
516
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
517 void CodeInstaller::site_Safepoint(CodeBuffer& buffer, jint pc_offset, oop site) {
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
518 oop debug_info = CompilationResult_Safepoint::debugInfo(site);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
519 assert(debug_info != NULL, "debug info expected");
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
520
1432
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
521 // address instruction = _instructions->start() + pc_offset;
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
522 // jint next_pc_offset = Assembler::locate_next_instruction(instruction) - _instructions->start();
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
523 _debug_recorder->add_safepoint(pc_offset, -1, create_oop_map(_total_frame_size, _parameter_count, debug_info));
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
524
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
525 oop code_pos = DebugInfo::bytecodePosition(debug_info);
3090
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
526 record_scope(pc_offset, code_pos, new GrowableArray<ScopeValue*>());
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
527
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
528 _debug_recorder->end_safepoint(pc_offset);
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
529 }
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
530
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
531 void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, oop site) {
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
532 oop target = CompilationResult_Call::target(site);
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
533 InstanceKlass* target_klass = InstanceKlass::cast(target->klass());
3561
bea018622324 Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 3560
diff changeset
534
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
535 oop hotspot_method = NULL; // JavaMethod
3561
bea018622324 Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 3560
diff changeset
536 oop global_stub = NULL;
bea018622324 Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 3560
diff changeset
537
bea018622324 Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 3560
diff changeset
538 if (target_klass->is_subclass_of(SystemDictionary::Long_klass())) {
bea018622324 Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 3560
diff changeset
539 global_stub = target;
bea018622324 Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 3560
diff changeset
540 } else {
bea018622324 Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 3560
diff changeset
541 hotspot_method = target;
bea018622324 Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 3560
diff changeset
542 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
543
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
544 oop debug_info = CompilationResult_Call::debugInfo(site);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
545
6521
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6515
diff changeset
546 assert((hotspot_method ? 1 : 0) + (global_stub ? 1 : 0) == 1, "Call site needs exactly one type");
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
547
3563
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3561
diff changeset
548 NativeInstruction* inst = nativeInstruction_at(_instructions->start() + pc_offset);
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3561
diff changeset
549 jint next_pc_offset = 0x0;
5000
b5dc2403c1e7 add option to inline VTable stubs
Lukas Stadler <lukas.stadler@jku.at>
parents: 4695
diff changeset
550 bool is_call_reg = false;
3563
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3561
diff changeset
551 if (inst->is_call() || inst->is_jump()) {
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3561
diff changeset
552 assert(NativeCall::instruction_size == (int)NativeJump::instruction_size, "unexpected size");
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3561
diff changeset
553 next_pc_offset = pc_offset + NativeCall::instruction_size;
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3561
diff changeset
554 } else if (inst->is_mov_literal64()) {
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3561
diff changeset
555 // mov+call instruction pair
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3561
diff changeset
556 next_pc_offset = pc_offset + NativeMovConstReg::instruction_size;
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3561
diff changeset
557 u_char* call = (u_char*) (_instructions->start() + next_pc_offset);
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3561
diff changeset
558 assert((call[0] == 0x40 || call[0] == 0x41) && call[1] == 0xFF, "expected call with rex/rexb prefix byte");
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3561
diff changeset
559 next_pc_offset += 3; /* prefix byte + opcode byte + modrm byte */
5000
b5dc2403c1e7 add option to inline VTable stubs
Lukas Stadler <lukas.stadler@jku.at>
parents: 4695
diff changeset
560 } else if (inst->is_call_reg()) {
5839
58a607307306 renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
561 // the inlined vtable stub contains a "call register" instruction
5000
b5dc2403c1e7 add option to inline VTable stubs
Lukas Stadler <lukas.stadler@jku.at>
parents: 4695
diff changeset
562 assert(hotspot_method != NULL, "only valid for virtual calls");
b5dc2403c1e7 add option to inline VTable stubs
Lukas Stadler <lukas.stadler@jku.at>
parents: 4695
diff changeset
563 is_call_reg = true;
5839
58a607307306 renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
564 next_pc_offset = pc_offset + ((NativeCallReg *) inst)->next_instruction_offset();
3563
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3561
diff changeset
565 } else {
5839
58a607307306 renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
566 tty->print_cr("at pc_offset %d", pc_offset);
3563
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3561
diff changeset
567 fatal("unsupported type of instruction for call site");
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3561
diff changeset
568 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
569
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
570 if (target->is_a(SystemDictionary::HotSpotInstalledCode_klass())) {
3619
5e9645341ec3 support for new RiRuntime features: add code without making it the default for the method, executing Java tasks on the compile thread, communicate nmethod reference to Java code as HotSpotCompiledMethod
Lukas Stadler <lukas.stadler@jku.at>
parents: 3594
diff changeset
571 assert(inst->is_jump(), "jump expected");
5e9645341ec3 support for new RiRuntime features: add code without making it the default for the method, executing Java tasks on the compile thread, communicate nmethod reference to Java code as HotSpotCompiledMethod
Lukas Stadler <lukas.stadler@jku.at>
parents: 3594
diff changeset
572
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
573 nmethod* nm = (nmethod*) HotSpotInstalledCode::nmethod(target);
3619
5e9645341ec3 support for new RiRuntime features: add code without making it the default for the method, executing Java tasks on the compile thread, communicate nmethod reference to Java code as HotSpotCompiledMethod
Lukas Stadler <lukas.stadler@jku.at>
parents: 3594
diff changeset
574 nativeJump_at((address)inst)->set_jump_destination(nm->verified_entry_point());
5e9645341ec3 support for new RiRuntime features: add code without making it the default for the method, executing Java tasks on the compile thread, communicate nmethod reference to Java code as HotSpotCompiledMethod
Lukas Stadler <lukas.stadler@jku.at>
parents: 3594
diff changeset
575 _instructions->relocate((address)inst, runtime_call_Relocation::spec(), Assembler::call32_operand);
5e9645341ec3 support for new RiRuntime features: add code without making it the default for the method, executing Java tasks on the compile thread, communicate nmethod reference to Java code as HotSpotCompiledMethod
Lukas Stadler <lukas.stadler@jku.at>
parents: 3594
diff changeset
576
5e9645341ec3 support for new RiRuntime features: add code without making it the default for the method, executing Java tasks on the compile thread, communicate nmethod reference to Java code as HotSpotCompiledMethod
Lukas Stadler <lukas.stadler@jku.at>
parents: 3594
diff changeset
577 return;
5e9645341ec3 support for new RiRuntime features: add code without making it the default for the method, executing Java tasks on the compile thread, communicate nmethod reference to Java code as HotSpotCompiledMethod
Lukas Stadler <lukas.stadler@jku.at>
parents: 3594
diff changeset
578 }
5e9645341ec3 support for new RiRuntime features: add code without making it the default for the method, executing Java tasks on the compile thread, communicate nmethod reference to Java code as HotSpotCompiledMethod
Lukas Stadler <lukas.stadler@jku.at>
parents: 3594
diff changeset
579
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
580 if (debug_info != NULL) {
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
581 oop frame = DebugInfo::bytecodePosition(debug_info);
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
582 _debug_recorder->add_safepoint(next_pc_offset, BytecodeFrame::leafGraphId(frame), create_oop_map(_total_frame_size, _parameter_count, debug_info));
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5000
diff changeset
583 record_scope(next_pc_offset, frame, new GrowableArray<ScopeValue*>());
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
584 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
585
6521
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6515
diff changeset
586 if (global_stub != NULL) {
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
587 assert(java_lang_boxing_object::is_instance(global_stub, T_LONG), "global_stub needs to be of type Long");
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
588
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
589 if (inst->is_call()) {
6521
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6515
diff changeset
590 // NOTE: for call without a mov, the offset must fit a 32-bit immediate
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6515
diff changeset
591 // see also CompilerToVM.getMaxCallTargetOffset()
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6515
diff changeset
592 NativeCall* call = nativeCall_at((address) (inst));
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6515
diff changeset
593 call->set_destination(VmIds::getStub(global_stub));
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6515
diff changeset
594 _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6515
diff changeset
595 } else if (inst->is_mov_literal64()) {
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6515
diff changeset
596 NativeMovConstReg* mov = nativeMovConstReg_at((address) (inst));
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6515
diff changeset
597 mov->set_data((intptr_t) VmIds::getStub(global_stub));
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6515
diff changeset
598 _instructions->relocate(mov->instruction_address(), runtime_call_Relocation::spec(), Assembler::imm_operand);
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
599 } else {
6521
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6515
diff changeset
600 NativeJump* jump = nativeJump_at((address) (inst));
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6515
diff changeset
601 jump->set_jump_destination(VmIds::getStub(global_stub));
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6515
diff changeset
602 _instructions->relocate((address)inst, runtime_call_Relocation::spec(), Assembler::call32_operand);
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
603 }
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
604 TRACE_graal_3("relocating (stub) at %016x", inst);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
605 } else { // method != NULL
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
606 assert(hotspot_method != NULL, "unexpected JavaMethod");
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
607 assert(debug_info != NULL, "debug info expected");
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
608
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
609 Method* method = NULL;
3011
f00918f35c7f inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents: 2951
diff changeset
610 // we need to check, this might also be an unresolved method
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
611 if (hotspot_method->is_a(HotSpotResolvedJavaMethod::klass())) {
3011
f00918f35c7f inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents: 2951
diff changeset
612 method = getMethodFromHotSpotMethod(hotspot_method);
f00918f35c7f inlining and runtime interface related changes:
Lukas Stadler <lukas.stadler@jku.at>
parents: 2951
diff changeset
613 }
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
614
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
615 assert(debug_info != NULL, "debug info expected");
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
616
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
617 TRACE_graal_3("method call");
1432
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
618 switch (_next_call_type) {
5823
f238fe91dc7f partial (non XIR) support for inlining virtual dispatch at call sites - still needs fixing
Doug Simon <doug.simon@oracle.com>
parents: 5798
diff changeset
619 case MARK_INLINE_INVOKEVIRTUAL: {
f238fe91dc7f partial (non XIR) support for inlining virtual dispatch at call sites - still needs fixing
Doug Simon <doug.simon@oracle.com>
parents: 5798
diff changeset
620 break;
f238fe91dc7f partial (non XIR) support for inlining virtual dispatch at call sites - still needs fixing
Doug Simon <doug.simon@oracle.com>
parents: 5798
diff changeset
621 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
622 case MARK_INVOKEVIRTUAL:
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
623 case MARK_INVOKEINTERFACE: {
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
624 assert(method == NULL || !method->is_static(), "cannot call static method with invokeinterface");
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
625
5000
b5dc2403c1e7 add option to inline VTable stubs
Lukas Stadler <lukas.stadler@jku.at>
parents: 4695
diff changeset
626 NativeCall* call = nativeCall_at(_instructions->start() + pc_offset);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
627 call->set_destination(SharedRuntime::get_resolve_virtual_call_stub());
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
628 _instructions->relocate(call->instruction_address(), virtual_call_Relocation::spec(_invoke_mark_pc), Assembler::call32_operand);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
629 break;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
630 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
631 case MARK_INVOKESTATIC: {
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
632 assert(method == NULL || method->is_static(), "cannot call non-static method with invokestatic");
3538
e4616e3d207b support for new CiRuntimeCalls CreateNullPointerException and CreateOutOfBoundsException
Lukas Stadler <lukas.stadler@jku.at>
parents: 3133
diff changeset
633
5000
b5dc2403c1e7 add option to inline VTable stubs
Lukas Stadler <lukas.stadler@jku.at>
parents: 4695
diff changeset
634 NativeCall* call = nativeCall_at(_instructions->start() + pc_offset);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
635 call->set_destination(SharedRuntime::get_resolve_static_call_stub());
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
636 _instructions->relocate(call->instruction_address(), relocInfo::static_call_type, Assembler::call32_operand);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
637 break;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
638 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
639 case MARK_INVOKESPECIAL: {
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
640 assert(method == NULL || !method->is_static(), "cannot call static method with invokespecial");
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
641
5000
b5dc2403c1e7 add option to inline VTable stubs
Lukas Stadler <lukas.stadler@jku.at>
parents: 4695
diff changeset
642 NativeCall* call = nativeCall_at(_instructions->start() + pc_offset);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
643 call->set_destination(SharedRuntime::get_resolve_opt_virtual_call_stub());
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
644 _instructions->relocate(call->instruction_address(), relocInfo::opt_virtual_call_type, Assembler::call32_operand);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
645 break;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
646 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
647 case MARK_INVOKE_INVALID:
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
648 default:
1931
48bbaead8b6c Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1484
diff changeset
649 fatal("invalid _next_call_type value");
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
650 break;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
651 }
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
652 }
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
653 _next_call_type = MARK_INVOKE_INVALID;
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
654 if (debug_info != NULL) {
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
655 _debug_recorder->end_safepoint(next_pc_offset);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
656 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
657 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
658
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
659 void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site) {
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
660 oop constant = CompilationResult_DataPatch::constant(site);
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
661 int alignment = CompilationResult_DataPatch::alignment(site);
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
662 oop kind = Constant::kind(constant);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
663
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
664 address instruction = _instructions->start() + pc_offset;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
665
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
666 char typeChar = Kind::typeChar(kind);
2494
e88293edf07c Fixed an issue with alignment of double/long values in the code buffer. Can now run Scimark again.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2282
diff changeset
667 switch (typeChar) {
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
668 case 'z':
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
669 case 'b':
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
670 case 's':
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
671 case 'c':
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
672 case 'i':
5326
a53162ca8219 introduced HotSpotKlassOop type to convey a klassOop value from the compiler to the C++ code instead of relying on the C++ code automagically converting a HotSpotTypeResolvedImpl value to a klassOop
Doug Simon <doug.simon@oracle.com>
parents: 5275
diff changeset
673 fatal("int-sized values not expected in DataPatch");
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
674 break;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
675 case 'f':
3594
af1319bc4fd5 Fixed wrong type char check.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3572
diff changeset
676 case 'j':
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
677 case 'd': {
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
678 address operand = Assembler::locate_operand(instruction, Assembler::disp32_operand);
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
679 address next_instruction = Assembler::locate_next_instruction(instruction);
3710
4e037604f6ee use alignment for constants specified in DataPatch.alignment
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3707
diff changeset
680 int size = _constants->size();
4e037604f6ee use alignment for constants specified in DataPatch.alignment
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3707
diff changeset
681 if (alignment > 0) {
4e037604f6ee use alignment for constants specified in DataPatch.alignment
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3707
diff changeset
682 guarantee(alignment <= _constants->alignment(), "Alignment inside constants section is restricted by alignment of section begin");
4e037604f6ee use alignment for constants specified in DataPatch.alignment
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3707
diff changeset
683 size = align_size_up(size, alignment);
4e037604f6ee use alignment for constants specified in DataPatch.alignment
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3707
diff changeset
684 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
685 // we don't care if this is a long/double/etc., the primitive field contains the right bits
2494
e88293edf07c Fixed an issue with alignment of double/long values in the code buffer. Can now run Scimark again.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2282
diff changeset
686 address dest = _constants->start() + size;
e88293edf07c Fixed an issue with alignment of double/long values in the code buffer. Can now run Scimark again.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2282
diff changeset
687 _constants->set_end(dest + BytesPerLong);
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
688 *(jlong*) dest = Constant::primitive(constant);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
689
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
690 long disp = dest - next_instruction;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
691 assert(disp == (jint) disp, "disp doesn't fit in 32 bits");
1432
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
692 *((jint*) operand) = (jint) disp;
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
693
1432
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
694 _instructions->relocate(instruction, section_word_Relocation::spec((address) dest, CodeBuffer::SECT_CONSTS), Assembler::disp32_operand);
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
695 TRACE_graal_3("relocating (%c) at %016x/%016x with destination at %016x (%d)", typeChar, instruction, operand, dest, size);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
696 break;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
697 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
698 case 'a': {
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
699 address operand = Assembler::locate_operand(instruction, Assembler::imm_operand);
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
700 Handle obj = Constant::object(constant);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
701
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
702 jobject value = JNIHandles::make_local(obj());
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
703 *((jobject*) operand) = value;
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
704 _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
705 TRACE_graal_3("relocating (oop constant) at %016x/%016x", instruction, operand);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
706 break;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
707 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
708 default:
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
709 fatal("unexpected Kind in DataPatch");
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
710 break;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
711 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
712 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
713
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
714 void CodeInstaller::site_Mark(CodeBuffer& buffer, jint pc_offset, oop site) {
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
715 oop id_obj = CompilationResult_Mark::id(site);
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
716 arrayOop references = (arrayOop) CompilationResult_Mark::references(site);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
717
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
718 if (id_obj != NULL) {
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
719 assert(java_lang_boxing_object::is_instance(id_obj, T_INT), "Integer id expected");
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
720 jint id = id_obj->int_field(java_lang_boxing_object::value_offset_in_bytes(T_INT));
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
721
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
722 address instruction = _instructions->start() + pc_offset;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
723
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
724 switch (id) {
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
725 case MARK_UNVERIFIED_ENTRY:
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
726 _offsets.set_value(CodeOffsets::Entry, pc_offset);
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
727 break;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
728 case MARK_VERIFIED_ENTRY:
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
729 _offsets.set_value(CodeOffsets::Verified_Entry, pc_offset);
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
730 break;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
731 case MARK_OSR_ENTRY:
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
732 _offsets.set_value(CodeOffsets::OSR_Entry, pc_offset);
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
733 break;
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
734 case MARK_EXCEPTION_HANDLER_ENTRY:
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
735 _offsets.set_value(CodeOffsets::Exceptions, pc_offset);
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
736 break;
1936
8d88c9ac9247 Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1931
diff changeset
737 case MARK_DEOPT_HANDLER_ENTRY:
8d88c9ac9247 Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1931
diff changeset
738 _offsets.set_value(CodeOffsets::Deopt, pc_offset);
8d88c9ac9247 Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1931
diff changeset
739 break;
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
740 case MARK_STATIC_CALL_STUB: {
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
741 assert(references->length() == 1, "static call stub needs one reference");
1432
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
742 oop ref = ((oop*) references->base(T_OBJECT))[0];
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
743 address call_pc = _instructions->start() + CompilationResult_Site::pcOffset(ref);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
744 _instructions->relocate(instruction, static_stub_Relocation::spec(call_pc));
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
745 break;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
746 }
5798
2585af1e26ac implemented non-XIR lowering of invokes (todo: inline virtual dispatch and null checking of receivers)
Doug Simon <doug.simon@oracle.com>
parents: 5776
diff changeset
747 case MARK_INVOKEVIRTUAL:
2585af1e26ac implemented non-XIR lowering of invokes (todo: inline virtual dispatch and null checking of receivers)
Doug Simon <doug.simon@oracle.com>
parents: 5776
diff changeset
748 case MARK_INVOKEINTERFACE: {
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
749 // Convert the initial value of the Klass* slot in an inline cache
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
750 // from 0L to Universe::non_oop_word().
5798
2585af1e26ac implemented non-XIR lowering of invokes (todo: inline virtual dispatch and null checking of receivers)
Doug Simon <doug.simon@oracle.com>
parents: 5776
diff changeset
751 NativeMovConstReg* n_copy = nativeMovConstReg_at(instruction);
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
752 assert(n_copy->data() == 0, "inline cache Klass* initial value should be 0L");
5798
2585af1e26ac implemented non-XIR lowering of invokes (todo: inline virtual dispatch and null checking of receivers)
Doug Simon <doug.simon@oracle.com>
parents: 5776
diff changeset
753 n_copy->set_data((intptr_t)Universe::non_oop_word());
2585af1e26ac implemented non-XIR lowering of invokes (todo: inline virtual dispatch and null checking of receivers)
Doug Simon <doug.simon@oracle.com>
parents: 5776
diff changeset
754 }
5823
f238fe91dc7f partial (non XIR) support for inlining virtual dispatch at call sites - still needs fixing
Doug Simon <doug.simon@oracle.com>
parents: 5798
diff changeset
755 case MARK_INLINE_INVOKEVIRTUAL:
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
756 case MARK_INVOKE_INVALID:
5798
2585af1e26ac implemented non-XIR lowering of invokes (todo: inline virtual dispatch and null checking of receivers)
Doug Simon <doug.simon@oracle.com>
parents: 5776
diff changeset
757 case MARK_INVOKESPECIAL:
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
758 case MARK_INVOKESTATIC:
1432
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
759 _next_call_type = (MarkId) id;
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
760 _invoke_mark_pc = instruction;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
761 break;
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
762 case MARK_IMPLICIT_NULL:
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
763 _implicit_exception_table.append(pc_offset, pc_offset);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
764 break;
3550
aee1479c0a4b Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3549
diff changeset
765 case MARK_POLL_NEAR: {
aee1479c0a4b Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3549
diff changeset
766 NativeInstruction* ni = nativeInstruction_at(instruction);
aee1479c0a4b Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3549
diff changeset
767 int32_t* disp = (int32_t*) Assembler::locate_operand(instruction, Assembler::disp32_operand);
aee1479c0a4b Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3549
diff changeset
768 intptr_t new_disp = (intptr_t) (os::get_polling_page() + (SafepointPollOffset % os::vm_page_size())) - (intptr_t) ni;
aee1479c0a4b Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3549
diff changeset
769 *disp = (int32_t)new_disp;
aee1479c0a4b Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3549
diff changeset
770 }
aee1479c0a4b Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3549
diff changeset
771 case MARK_POLL_FAR:
3549
25765a764212 Add support for polling mark in code installer
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3538
diff changeset
772 _instructions->relocate(instruction, relocInfo::poll_type);
25765a764212 Add support for polling mark in code installer
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3538
diff changeset
773 break;
3550
aee1479c0a4b Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3549
diff changeset
774 case MARK_POLL_RETURN_NEAR: {
aee1479c0a4b Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3549
diff changeset
775 NativeInstruction* ni = nativeInstruction_at(instruction);
aee1479c0a4b Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3549
diff changeset
776 int32_t* disp = (int32_t*) Assembler::locate_operand(instruction, Assembler::disp32_operand);
aee1479c0a4b Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3549
diff changeset
777 intptr_t new_disp = (intptr_t) (os::get_polling_page() + (SafepointPollOffset % os::vm_page_size())) - (intptr_t) ni;
aee1479c0a4b Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3549
diff changeset
778 *disp = (int32_t)new_disp;
aee1479c0a4b Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3549
diff changeset
779 }
aee1479c0a4b Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3549
diff changeset
780 case MARK_POLL_RETURN_FAR:
3549
25765a764212 Add support for polling mark in code installer
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3538
diff changeset
781 _instructions->relocate(instruction, relocInfo::poll_return_type);
25765a764212 Add support for polling mark in code installer
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 3538
diff changeset
782 break;
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
783 case MARK_KLASS_PATCHING:
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
784 case MARK_ACCESS_FIELD_PATCHING: {
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
785 unsigned char* byte_count = (unsigned char*) (instruction - 1);
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
786 unsigned char* byte_skip = (unsigned char*) (instruction - 2);
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
787 unsigned char* being_initialized_entry_offset = (unsigned char*) (instruction - 3);
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
788
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
789 assert(*byte_skip == 5, "unexpected byte_skip");
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
790
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
791 assert(references->length() == 2, "MARK_KLASS_PATCHING/MARK_ACCESS_FIELD_PATCHING needs 2 references");
1432
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
792 oop ref1 = ((oop*) references->base(T_OBJECT))[0];
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
793 oop ref2 = ((oop*) references->base(T_OBJECT))[1];
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
794 int i_byte_count = CompilationResult_Site::pcOffset(ref2) - CompilationResult_Site::pcOffset(ref1);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
795 assert(i_byte_count == (unsigned char)i_byte_count, "invalid offset");
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
796 *byte_count = i_byte_count;
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
797 *being_initialized_entry_offset = *byte_count + *byte_skip;
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
798
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
799 // we need to correct the offset of a field access - it's created with MAX_INT to ensure the correct size, and HotSpot expects 0
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
800 if (id == MARK_ACCESS_FIELD_PATCHING) {
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
801 NativeMovRegMem* inst = nativeMovRegMem_at(_instructions->start() + CompilationResult_Site::pcOffset(ref1));
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
802 assert(inst->offset() == max_jint, "unexpected offset value");
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
803 inst->set_offset(0);
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
804 }
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
805 break;
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
806 }
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
807 case MARK_DUMMY_OOP_RELOCATION: {
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
808 _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
809
1432
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
810 RelocIterator iter(_instructions, (address) instruction, (address) (instruction + 1));
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
811 relocInfo::change_reloc_info_for_address(&iter, (address) instruction, relocInfo::oop_type, relocInfo::none);
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
812 break;
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
813 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
814 default:
1931
48bbaead8b6c Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1484
diff changeset
815 ShouldNotReachHere();
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
816 break;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
817 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
818 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
819 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
820