Mercurial > hg > graal-compiler
annotate src/share/vm/graal/graalCodeInstaller.cpp @ 13576:4e679d50ba9a
Move data section building code to Java.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Thu, 09 Jan 2014 13:09:44 +0100 |
parents | 03bb0ee05409 |
children | b1838411e896 |
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" |
7735 | 25 #include "compiler/disassembler.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
|
26 #include "runtime/javaCalls.hpp" |
7089
af30115c9d0e
added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents:
7084
diff
changeset
|
27 #include "graal/graalEnv.hpp" |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
28 #include "graal/graalCompiler.hpp" |
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
29 #include "graal/graalCodeInstaller.hpp" |
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
30 #include "graal/graalJavaAccess.hpp" |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4220
diff
changeset
|
31 #include "graal/graalCompilerToVM.hpp" |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
7101
diff
changeset
|
32 #include "graal/graalRuntime.hpp" |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
33 #include "asm/register.hpp" |
2048
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
34 #include "classfile/vmSymbols.hpp" |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
35 #include "code/vmreg.hpp" |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
36 |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
37 #ifdef TARGET_ARCH_x86 |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
38 # include "vmreg_x86.inline.hpp" |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
39 #endif |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
40 #ifdef TARGET_ARCH_sparc |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
41 # include "vmreg_sparc.inline.hpp" |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
42 #endif |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
43 #ifdef TARGET_ARCH_zero |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
44 # include "vmreg_zero.inline.hpp" |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
45 #endif |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
46 #ifdef TARGET_ARCH_arm |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
47 # include "vmreg_arm.inline.hpp" |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
48 #endif |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
49 #ifdef TARGET_ARCH_ppc |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
50 # include "vmreg_ppc.inline.hpp" |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
51 #endif |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
52 |
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
|
53 // 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
|
54 VMReg get_hotspot_reg(jint graal_reg) { |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
55 if (graal_reg < RegisterImpl::number_of_registers) { |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
56 return as_Register(graal_reg)->as_VMReg(); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
57 } else { |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
58 int remainder = graal_reg - RegisterImpl::number_of_registers; |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
59 #ifdef TARGET_ARCH_x86 |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
60 if (remainder < XMMRegisterImpl::number_of_registers) { |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
61 return as_XMMRegister(remainder)->as_VMReg(); |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
62 } |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
63 #endif |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
64 ShouldNotReachHere(); |
7772
62bcf515831d
Fix warning that breaks windows build.
Roland Schatz <roland.schatz@oracle.com>
parents:
7742
diff
changeset
|
65 return NULL; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
66 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
67 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
68 |
5542
e318468952f5
Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5326
diff
changeset
|
69 const int MapWordBits = 64; |
e318468952f5
Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5326
diff
changeset
|
70 |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
71 static bool is_bit_set(oop bitset, int i) { |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
72 jint words_idx = i / MapWordBits; |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
73 arrayOop words = (arrayOop) BitSet::words(bitset); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
74 assert(words_idx >= 0 && words_idx < words->length(), "unexpected index"); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
75 jlong word = ((jlong*) words->base(T_LONG))[words_idx]; |
5542
e318468952f5
Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5326
diff
changeset
|
76 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
|
77 } |
e318468952f5
Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5326
diff
changeset
|
78 |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
79 static int bitset_size(oop bitset) { |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
80 arrayOop arr = (arrayOop) BitSet::words(bitset); |
5542
e318468952f5
Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5326
diff
changeset
|
81 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
|
82 } |
52bb06250d35
Converted CiDebugInfo.registerRefMap field from type long to CiBitMap.
Doug Simon <doug.simon@oracle.com>
parents:
1468
diff
changeset
|
83 |
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
|
84 // 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
|
85 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
|
86 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
|
87 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
|
88 oop frame_map = (oop) DebugInfo::frameRefMap(debug_info); |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
89 oop callee_save_info = (oop) DebugInfo::calleeSaveInfo(debug_info); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
90 |
1469
52bb06250d35
Converted CiDebugInfo.registerRefMap field from type long to CiBitMap.
Doug Simon <doug.simon@oracle.com>
parents:
1468
diff
changeset
|
91 if (register_map != NULL) { |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
92 for (jint i = 0; i < RegisterImpl::number_of_registers; i++) { |
1469
52bb06250d35
Converted CiDebugInfo.registerRefMap field from type long to CiBitMap.
Doug Simon <doug.simon@oracle.com>
parents:
1468
diff
changeset
|
93 bool is_oop = is_bit_set(register_map, i); |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
94 VMReg hotspot_reg = get_hotspot_reg(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
|
95 if (is_oop) { |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
96 map->set_oop(hotspot_reg); |
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
|
97 } else { |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
98 map->set_value(hotspot_reg); |
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
|
99 } |
1428
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 |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
103 for (jint i = 0; i < bitset_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
|
104 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
|
105 // HotSpot stack slots are 4 bytes |
9359
44e05c9afb54
replaced definition of SLOT_PER_WORD with use of VMRegImpl::slots_per_word
Doug Simon <doug.simon@oracle.com>
parents:
9338
diff
changeset
|
106 VMReg reg = VMRegImpl::stack2reg(i * VMRegImpl::slots_per_word); |
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
|
107 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
|
108 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
|
109 } 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
|
110 map->set_value(reg); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
111 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
112 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
113 |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
114 if (callee_save_info != NULL) { |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
115 objArrayOop registers = (objArrayOop) RegisterSaveLayout::registers(callee_save_info); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
116 arrayOop slots = (arrayOop) RegisterSaveLayout::slots(callee_save_info); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
117 for (jint i = 0; i < slots->length(); i++) { |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
118 oop graal_reg = registers->obj_at(i); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
119 jint graal_reg_number = code_Register::number(graal_reg); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
120 VMReg hotspot_reg = get_hotspot_reg(graal_reg_number); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
121 // HotSpot stack slots are 4 bytes |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
122 jint graal_slot = ((jint*) slots->base(T_INT))[i]; |
9359
44e05c9afb54
replaced definition of SLOT_PER_WORD with use of VMRegImpl::slots_per_word
Doug Simon <doug.simon@oracle.com>
parents:
9338
diff
changeset
|
123 jint hotspot_slot = graal_slot * VMRegImpl::slots_per_word; |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
124 VMReg hotspot_slot_as_reg = VMRegImpl::stack2reg(hotspot_slot); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
125 map->set_callee_saved(hotspot_slot_as_reg, hotspot_reg); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
126 #ifdef _LP64 |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
127 // (copied from generate_oop_map() in c1_Runtime1_x86.cpp) |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
128 VMReg hotspot_slot_hi_as_reg = VMRegImpl::stack2reg(hotspot_slot + 1); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
129 map->set_callee_saved(hotspot_slot_hi_as_reg, hotspot_reg->next()); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
130 #endif |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
131 } |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
132 } |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
133 |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
134 return map; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
135 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
136 |
7084
9ba90252ce08
HotSpotResolvedJavaType is now the HotSpot implementation of ResolvedJavaType,
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7081
diff
changeset
|
137 // Records any Metadata values embedded in a Constant (e.g., the value returned by HotSpotResolvedObjectType.klass()). |
6996
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
138 static void record_metadata_in_constant(oop constant, OopRecorder* oop_recorder) { |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
139 char kind = Kind::typeChar(Constant::kind(constant)); |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
140 char wordKind = 'j'; |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
141 if (kind == wordKind) { |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
142 oop obj = Constant::object(constant); |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
143 jlong prim = Constant::primitive(constant); |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
144 if (obj != NULL) { |
7084
9ba90252ce08
HotSpotResolvedJavaType is now the HotSpot implementation of ResolvedJavaType,
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7081
diff
changeset
|
145 if (obj->is_a(HotSpotResolvedObjectType::klass())) { |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13156
diff
changeset
|
146 Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaClass(obj)); |
6996
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
147 assert((Klass*) prim == klass, err_msg("%s @ %p != %p", klass->name()->as_C_string(), klass, prim)); |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
148 int index = oop_recorder->find_index(klass); |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
149 TRACE_graal_3("metadata[%d of %d] = %s", index, oop_recorder->metadata_count(), klass->name()->as_C_string()); |
7930
fe64b5da8229
Create direct call for Static and Special to avoid out-of-line patching stub.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7816
diff
changeset
|
150 } else if (obj->is_a(HotSpotResolvedJavaMethod::klass())) { |
fe64b5da8229
Create direct call for Static and Special to avoid out-of-line patching stub.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7816
diff
changeset
|
151 Method* method = (Method*) (address) HotSpotResolvedJavaMethod::metaspaceMethod(obj); |
fe64b5da8229
Create direct call for Static and Special to avoid out-of-line patching stub.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7816
diff
changeset
|
152 int index = oop_recorder->find_index(method); |
fe64b5da8229
Create direct call for Static and Special to avoid out-of-line patching stub.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7816
diff
changeset
|
153 TRACE_graal_3("metadata[%d of %d] = %s", index, oop_recorder->metadata_count(), method->name()->as_C_string()); |
6996
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
154 } else { |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
155 assert(java_lang_String::is_instance(obj), |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
156 err_msg("unexpected annotation type (%s) for constant %ld (%p) of kind %c", obj->klass()->name()->as_C_string(), prim, prim, kind)); |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
157 } |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
158 } |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
159 } |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
160 } |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
161 |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
162 ScopeValue* CodeInstaller::get_scope_value(oop value, int total_frame_size, GrowableArray<ScopeValue*>* objects, ScopeValue* &second, OopRecorder* oop_recorder) { |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
163 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
|
164 if (value == Value::ILLEGAL()) { |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
165 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
|
166 } |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
167 |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
168 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
|
169 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
|
170 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
|
171 |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
172 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
|
173 jint number = code_Register::number(RegisterValue::reg(value)); |
10684 | 174 if (number < RegisterImpl::number_of_registers) { |
4232
382523fc390c
jsr return addresses are valid in registers
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4229
diff
changeset
|
175 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
|
176 locationType = Location::int_in_long; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
177 } else if (type == T_LONG) { |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
178 locationType = Location::lng; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
179 } else { |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
180 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
|
181 } |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
182 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
|
183 if (type == T_LONG) { |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
184 second = value; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
185 } |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
186 return value; |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
187 } else { |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
188 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
|
189 if (type == T_FLOAT) { |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
190 // 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
|
191 locationType = Location::normal; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
192 } else { |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
193 locationType = Location::dbl; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
194 } |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
195 #ifdef TARGET_ARCH_x86 |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
196 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
|
197 if (type == T_DOUBLE) { |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
198 second = value; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
199 } |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
200 return value; |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
201 #else |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
202 #ifdef TARGET_ARCH_sparc |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
203 ScopeValue* value = new LocationValue(Location::new_reg_loc(locationType, as_FloatRegister(number)->as_VMReg())); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
204 if (type == T_DOUBLE) { |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
205 second = value; |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
206 } |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
207 return value; |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
208 #else |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
209 ShouldNotReachHere("Platform currently does not support floating point values."); |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
210 #endif |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
211 #endif |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
212 } |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
213 } else if (value->is_a(StackSlot::klass())) { |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
214 if (type == T_DOUBLE) { |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
215 locationType = Location::dbl; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
216 } else if (type == T_LONG) { |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
217 locationType = Location::lng; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
218 } |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
219 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
|
220 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
|
221 offset += total_frame_size; |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
222 } |
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
|
223 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
|
224 if (type == T_DOUBLE || type == T_LONG) { |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
225 second = value; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
226 } |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
227 return value; |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
228 } else if (value->is_a(Constant::klass())){ |
6996
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
229 record_metadata_in_constant(value, oop_recorder); |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
230 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
|
231 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
|
232 return new ConstantIntValue(*(jint*)&prim); |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
233 } 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
|
234 second = new ConstantIntValue(0); |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
235 return new ConstantLongValue(prim); |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
236 } 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
|
237 oop obj = Constant::object(value); |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
238 if (obj == NULL) { |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
239 return new ConstantOopWriteValue(NULL); |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
240 } 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
|
241 return new ConstantOopWriteValue(JNIHandles::make_local(obj)); |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
242 } |
1476
1f81c0d18c75
Build also release version of VM. Fix towards making SpecJVM2008 run.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1472
diff
changeset
|
243 } else if (type == T_ADDRESS) { |
7816
4e1278443941
Remove Kind.Jsr.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7814
diff
changeset
|
244 ShouldNotReachHere(); |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
245 } |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
246 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
|
247 } 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
|
248 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
|
249 int id = VirtualObject::id(value); |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13156
diff
changeset
|
250 oop javaMirror = HotSpotResolvedObjectType::javaClass(type); |
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
|
251 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
|
252 bool isLongArray = klass == Universe::longArrayKlassObj(); |
3090
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
253 |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
254 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
|
255 ObjectValue* obj = (ObjectValue*) objects->at(i); |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
256 if (obj->id() == id) { |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
257 return obj; |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
258 } |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
259 } |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
260 |
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
|
261 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
|
262 objects->append(sv); |
3090
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
263 |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
264 arrayOop values = (arrayOop) VirtualObject::values(value); |
3090
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
265 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
|
266 ScopeValue* cur_second = NULL; |
9972
91c16dff3fc1
Refactor CodeInstaller and CompilerToVM
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9891
diff
changeset
|
267 oop object = ((objArrayOop) (values))->obj_at(i); |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
268 ScopeValue* value = get_scope_value(object, total_frame_size, objects, cur_second, oop_recorder); |
8947
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
269 |
5126
43d5ae1051f7
added better debug output when an optimistic deoptimization is disabled
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5104
diff
changeset
|
270 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
|
271 // 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
|
272 // add an int 0 constant |
5144
f7b2800b1738
Use VM_LITTLE_ENDIAN to determine endianness.
Andreas Woess <andreas.woess@jku.at>
parents:
5130
diff
changeset
|
273 #ifdef VM_LITTLE_ENDIAN |
f7b2800b1738
Use VM_LITTLE_ENDIAN to determine endianness.
Andreas Woess <andreas.woess@jku.at>
parents:
5130
diff
changeset
|
274 cur_second = new ConstantIntValue(0); |
f7b2800b1738
Use VM_LITTLE_ENDIAN to determine endianness.
Andreas Woess <andreas.woess@jku.at>
parents:
5130
diff
changeset
|
275 #else |
5126
43d5ae1051f7
added better debug output when an optimistic deoptimization is disabled
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5104
diff
changeset
|
276 cur_second = value; |
43d5ae1051f7
added better debug output when an optimistic deoptimization is disabled
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5104
diff
changeset
|
277 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
|
278 #endif |
5104
9ec2917fd0de
Allow ints to be put into a virtual long array.
Andreas Woess <andreas.woess@jku.at>
parents:
5000
diff
changeset
|
279 } |
9ec2917fd0de
Allow ints to be put into a virtual long array.
Andreas Woess <andreas.woess@jku.at>
parents:
5000
diff
changeset
|
280 |
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
|
281 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
|
282 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
|
283 } |
3090
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
284 sv->field_values()->append(value); |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
285 } |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
286 return sv; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
287 } else { |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
288 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
|
289 value->print(); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
290 } |
2215
999f8086cc4f
More changes to make it compile and work on win64.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2182
diff
changeset
|
291 ShouldNotReachHere(); |
999f8086cc4f
More changes to make it compile and work on win64.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2182
diff
changeset
|
292 return NULL; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
293 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
294 |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
295 MonitorValue* CodeInstaller::get_monitor_value(oop value, int total_frame_size, GrowableArray<ScopeValue*>* objects, OopRecorder* oop_recorder) { |
8589
ec06c7e67698
renamed MonitorValue to HotSpotMonitorValue and moved it to com.oracle.graal.hotspot project
Doug Simon <doug.simon@oracle.com>
parents:
8527
diff
changeset
|
296 guarantee(value->is_a(HotSpotMonitorValue::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
|
297 |
b648304ba4ff
Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3710
diff
changeset
|
298 ScopeValue* second = NULL; |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
299 ScopeValue* owner_value = get_scope_value(HotSpotMonitorValue::owner(value), total_frame_size, objects, second, oop_recorder); |
3714
b648304ba4ff
Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3710
diff
changeset
|
300 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
|
301 |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
302 ScopeValue* lock_data_value = get_scope_value(HotSpotMonitorValue::slot(value), total_frame_size, objects, second, oop_recorder); |
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
|
303 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
|
304 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
|
305 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
|
306 |
3717
4177ddd2d1d1
Fix build error for Windows builds
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3714
diff
changeset
|
307 bool eliminated = false; |
8589
ec06c7e67698
renamed MonitorValue to HotSpotMonitorValue and moved it to com.oracle.graal.hotspot project
Doug Simon <doug.simon@oracle.com>
parents:
8527
diff
changeset
|
308 if (HotSpotMonitorValue::eliminated(value)) { |
3717
4177ddd2d1d1
Fix build error for Windows builds
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3714
diff
changeset
|
309 eliminated = true; |
4177ddd2d1d1
Fix build error for Windows builds
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3714
diff
changeset
|
310 } |
3714
b648304ba4ff
Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3710
diff
changeset
|
311 |
b648304ba4ff
Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3710
diff
changeset
|
312 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
|
313 } |
b648304ba4ff
Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3710
diff
changeset
|
314 |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
315 void CodeInstaller::initialize_assumptions(oop compiled_code) { |
7094
eec7173947a1
removed remaining use of the C++ "compiler interface" (i.e. ci) by Graal for installing dependencies
Doug Simon <doug.simon@oracle.com>
parents:
7093
diff
changeset
|
316 _oop_recorder = new OopRecorder(&_arena); |
eec7173947a1
removed remaining use of the C++ "compiler interface" (i.e. ci) by Graal for installing dependencies
Doug Simon <doug.simon@oracle.com>
parents:
7093
diff
changeset
|
317 _dependencies = new Dependencies(&_arena, _oop_recorder); |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
318 Handle assumptions_handle = CompilationResult::assumptions(HotSpotCompiledCode::comp(compiled_code)); |
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
|
319 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
|
320 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
|
321 int length = assumptions->length(); |
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3669
diff
changeset
|
322 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
|
323 Handle assumption = assumptions->obj_at(i); |
5e331d5f760e
removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3670
diff
changeset
|
324 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
|
325 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
|
326 assumption_MethodContents(assumption); |
9012
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
327 } else if (assumption->klass() == Assumptions_NoFinalizableSubclass::klass()) { |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
328 assumption_NoFinalizableSubclass(assumption); |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
329 } 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
|
330 assumption_ConcreteSubtype(assumption); |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
331 } 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
|
332 assumption_ConcreteMethod(assumption); |
8947
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
333 } else if (assumption->klass() == Assumptions_CallSiteTargetValue::klass()) { |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
334 assumption_CallSiteTargetValue(assumption); |
3657
47edfca346ab
Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
335 } else { |
47edfca346ab
Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
336 assumption->print(); |
47edfca346ab
Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
337 fatal("unexpected Assumption subclass"); |
47edfca346ab
Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
338 } |
47edfca346ab
Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
339 } |
47edfca346ab
Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
340 } |
47edfca346ab
Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
341 } |
3668
46f211fe010c
Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3667
diff
changeset
|
342 } |
46f211fe010c
Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3667
diff
changeset
|
343 |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
344 GrowableArray<jlong>* get_leaf_graph_ids(Handle& compiled_code) { |
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
345 arrayOop leafGraphArray = (arrayOop) CompilationResult::leafGraphIds(HotSpotCompiledCode::comp(compiled_code)); |
7660
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7154
diff
changeset
|
346 |
7716
fa8a56a351a5
null-check on leafGraphArray
Roland Schatz <roland.schatz@oracle.com>
parents:
7660
diff
changeset
|
347 jint length; |
fa8a56a351a5
null-check on leafGraphArray
Roland Schatz <roland.schatz@oracle.com>
parents:
7660
diff
changeset
|
348 if (leafGraphArray == NULL) { |
fa8a56a351a5
null-check on leafGraphArray
Roland Schatz <roland.schatz@oracle.com>
parents:
7660
diff
changeset
|
349 length = 0; |
fa8a56a351a5
null-check on leafGraphArray
Roland Schatz <roland.schatz@oracle.com>
parents:
7660
diff
changeset
|
350 } else { |
fa8a56a351a5
null-check on leafGraphArray
Roland Schatz <roland.schatz@oracle.com>
parents:
7660
diff
changeset
|
351 length = leafGraphArray->length(); |
fa8a56a351a5
null-check on leafGraphArray
Roland Schatz <roland.schatz@oracle.com>
parents:
7660
diff
changeset
|
352 } |
fa8a56a351a5
null-check on leafGraphArray
Roland Schatz <roland.schatz@oracle.com>
parents:
7660
diff
changeset
|
353 |
fa8a56a351a5
null-check on leafGraphArray
Roland Schatz <roland.schatz@oracle.com>
parents:
7660
diff
changeset
|
354 GrowableArray<jlong>* result = new GrowableArray<jlong>(length); |
fa8a56a351a5
null-check on leafGraphArray
Roland Schatz <roland.schatz@oracle.com>
parents:
7660
diff
changeset
|
355 for (int i = 0; i < length; i++) { |
7660
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7154
diff
changeset
|
356 result->append(((jlong*) leafGraphArray->base(T_LONG))[i]); |
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7154
diff
changeset
|
357 } |
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7154
diff
changeset
|
358 |
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7154
diff
changeset
|
359 return result; |
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7154
diff
changeset
|
360 } |
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7154
diff
changeset
|
361 |
3668
46f211fe010c
Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3667
diff
changeset
|
362 // constructor used to create a method |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
363 GraalEnv::CodeInstallResult CodeInstaller::install(Handle& compiled_code, CodeBlob*& cb, Handle installed_code, Handle triggered_deoptimizations) { |
13156
2e76d94f8383
propagate code-cache-full message up to Java to throw exception instead of crashing VM
twisti
parents:
11827
diff
changeset
|
364 BufferBlob* buffer_blob = GraalCompiler::initialize_buffer_blob(); |
2e76d94f8383
propagate code-cache-full message up to Java to throw exception instead of crashing VM
twisti
parents:
11827
diff
changeset
|
365 if (buffer_blob == NULL) { |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
366 return GraalEnv::cache_full; |
13156
2e76d94f8383
propagate code-cache-full message up to Java to throw exception instead of crashing VM
twisti
parents:
11827
diff
changeset
|
367 } |
2e76d94f8383
propagate code-cache-full message up to Java to throw exception instead of crashing VM
twisti
parents:
11827
diff
changeset
|
368 |
2e76d94f8383
propagate code-cache-full message up to Java to throw exception instead of crashing VM
twisti
parents:
11827
diff
changeset
|
369 CodeBuffer buffer(buffer_blob); |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
370 jobject compiled_code_obj = JNIHandles::make_local(compiled_code()); |
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
371 initialize_assumptions(JNIHandles::resolve(compiled_code_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
|
372 |
10684 | 373 // Get instructions and constants CodeSections early because we need it. |
374 _instructions = buffer.insts(); | |
375 _constants = buffer.consts(); | |
376 | |
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
|
377 { |
6e1abd79e7c8
Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3663
diff
changeset
|
378 No_Safepoint_Verifier no_safepoint; |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
379 initialize_fields(JNIHandles::resolve(compiled_code_obj)); |
10540
0ba44a5a8420
Add sanity check to avoid overwriting the reserved code buffer for very large methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10410
diff
changeset
|
380 if (!initialize_buffer(buffer)) { |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
381 return GraalEnv::code_too_large; |
10540
0ba44a5a8420
Add sanity check to avoid overwriting the reserved code buffer for very large methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10410
diff
changeset
|
382 } |
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
|
383 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
|
384 } |
6e1abd79e7c8
Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3663
diff
changeset
|
385 |
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
|
386 int stack_slots = _total_frame_size / HeapWordSize; // conversion to words |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
387 GrowableArray<jlong>* leaf_graph_ids = get_leaf_graph_ids(compiled_code); |
4319
3c21eee8ab4d
Add installMethodCallback() to HotSpotRuntime.
Andreas Woess <andreas.woess@jku.at>
parents:
4232
diff
changeset
|
388 |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
389 GraalEnv::CodeInstallResult result; |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
390 if (compiled_code->is_a(HotSpotCompiledRuntimeStub::klass())) { |
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
391 oop stubName = HotSpotCompiledRuntimeStub::stubName(compiled_code); |
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
392 char* name = strdup(java_lang_String::as_utf8_string(stubName)); |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
393 cb = RuntimeStub::new_runtime_stub(name, |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
394 &buffer, |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
395 CodeOffsets::frame_never_safe, |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
396 stack_slots, |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
397 _debug_recorder->_oopmaps, |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
398 false); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
399 result = GraalEnv::ok; |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
400 } else { |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
401 nmethod* nm = NULL; |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
402 methodHandle method = getMethodFromHotSpotMethod(HotSpotCompiledNmethod::method(compiled_code)); |
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
403 jint entry_bci = HotSpotCompiledNmethod::entryBCI(compiled_code); |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
404 result = GraalEnv::register_method(method, nm, entry_bci, &_offsets, _custom_stack_area_offset, &buffer, stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table, |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
405 GraalCompiler::instance(), _debug_recorder, _dependencies, NULL, -1, false, leaf_graph_ids, installed_code, triggered_deoptimizations); |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
406 cb = nm; |
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9192
diff
changeset
|
407 } |
10684 | 408 |
409 if (cb != NULL) { | |
410 // Make sure the pre-calculated constants section size was correct. | |
411 guarantee((cb->code_begin() - cb->content_begin()) == _constants_size, err_msg("%d != %d", cb->code_begin() - cb->content_begin(), _constants_size)); | |
412 } | |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
413 return result; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
414 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
415 |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
416 void CodeInstaller::initialize_fields(oop compiled_code) { |
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
417 oop comp_result = HotSpotCompiledCode::comp(compiled_code); |
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
418 if (compiled_code->is_a(HotSpotCompiledNmethod::klass())) { |
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
419 oop hotspotJavaMethod = HotSpotCompiledNmethod::method(compiled_code); |
9654
18632807db02
RuntimeStub installation support is now more distinct from normal nmethod installation
Doug Simon <doug.simon@oracle.com>
parents:
9359
diff
changeset
|
420 methodHandle method = getMethodFromHotSpotMethod(hotspotJavaMethod); |
5839
58a607307306
renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents:
5823
diff
changeset
|
421 _parameter_count = method->size_of_parameters(); |
58a607307306
renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents:
5823
diff
changeset
|
422 TRACE_graal_1("installing code for %s", method->name_and_sig_as_C_string()); |
9654
18632807db02
RuntimeStub installation support is now more distinct from normal nmethod installation
Doug Simon <doug.simon@oracle.com>
parents:
9359
diff
changeset
|
423 } else { |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
424 assert(compiled_code->is_a(HotSpotCompiledRuntimeStub::klass()), "CCE"); |
9654
18632807db02
RuntimeStub installation support is now more distinct from normal nmethod installation
Doug Simon <doug.simon@oracle.com>
parents:
9359
diff
changeset
|
425 // TODO (ds) not sure if this is correct - only used in OopMap constructor for non-product builds |
18632807db02
RuntimeStub installation support is now more distinct from normal nmethod installation
Doug Simon <doug.simon@oracle.com>
parents:
9359
diff
changeset
|
426 _parameter_count = 0; |
3660
c805dfba251d
Fixed regression.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3659
diff
changeset
|
427 } |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
428 _sites = (arrayOop) HotSpotCompiledCode::sites(compiled_code); |
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
429 _exception_handlers = (arrayOop) HotSpotCompiledCode::exceptionHandlers(compiled_code); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
430 |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
431 _code = (arrayOop) CompilationResult::targetCode(comp_result); |
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
432 _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
|
433 // The frame size we get from the target method does not include the return address, so add one word for it here. |
10684 | 434 _total_frame_size = CompilationResult::frameSize(comp_result) + HeapWordSize; // FIXME this is an x86-ism |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
435 _custom_stack_area_offset = CompilationResult::customStackAreaOffset(comp_result); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
436 |
10684 | 437 // Pre-calculate the constants section size. This is required for PC-relative addressing. |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
438 _dataSection = HotSpotCompiledCode::dataSection(compiled_code); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
439 guarantee(HotSpotCompiledCode_DataSection::sectionAlignment(_dataSection) <= _constants->alignment(), "Alignment inside constants section is restricted by alignment of section begin"); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
440 arrayOop data = (arrayOop) HotSpotCompiledCode_DataSection::data(_dataSection); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
441 _constants_size = data->length(); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
442 if (_constants_size > 0) { |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
443 _constants_size = align_size_up(_constants_size, _constants->alignment()); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
444 } |
10684 | 445 |
9807
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9740
diff
changeset
|
446 #ifndef PRODUCT |
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9740
diff
changeset
|
447 _comments = (arrayOop) HotSpotCompiledCode::comments(compiled_code); |
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9740
diff
changeset
|
448 #endif |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
449 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
450 _next_call_type = MARK_INVOKE_INVALID; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
451 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
452 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
453 // perform data and call relocation on the CodeBuffer |
10540
0ba44a5a8420
Add sanity check to avoid overwriting the reserved code buffer for very large methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10410
diff
changeset
|
454 bool CodeInstaller::initialize_buffer(CodeBuffer& buffer) { |
1931
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1484
diff
changeset
|
455 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
|
456 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
|
457 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
|
458 buffer.initialize_stubs_size(256); |
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1484
diff
changeset
|
459 buffer.initialize_consts_size(_constants_size); |
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1484
diff
changeset
|
460 |
7094
eec7173947a1
removed remaining use of the C++ "compiler interface" (i.e. ci) by Graal for installing dependencies
Doug Simon <doug.simon@oracle.com>
parents:
7093
diff
changeset
|
461 _debug_recorder = new DebugInformationRecorder(_oop_recorder); |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
462 _debug_recorder->set_oopmaps(new OopMapSet()); |
8947
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
463 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
464 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
|
465 |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
466 // copy the code into the newly created CodeBuffer |
10540
0ba44a5a8420
Add sanity check to avoid overwriting the reserved code buffer for very large methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10410
diff
changeset
|
467 address end_pc = _instructions->start() + _code_size; |
0ba44a5a8420
Add sanity check to avoid overwriting the reserved code buffer for very large methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10410
diff
changeset
|
468 if (!_instructions->allocates2(end_pc)) { |
0ba44a5a8420
Add sanity check to avoid overwriting the reserved code buffer for very large methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10410
diff
changeset
|
469 return false; |
0ba44a5a8420
Add sanity check to avoid overwriting the reserved code buffer for very large methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10410
diff
changeset
|
470 } |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
471 memcpy(_instructions->start(), _code->base(T_BYTE), _code_size); |
10540
0ba44a5a8420
Add sanity check to avoid overwriting the reserved code buffer for very large methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10410
diff
changeset
|
472 _instructions->set_end(end_pc); |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
473 |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
474 // copy the constant data into the newly created CodeBuffer |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
475 address end_data = _constants->start() + _constants_size; |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
476 arrayOop data = (arrayOop) HotSpotCompiledCode_DataSection::data(_dataSection); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
477 memcpy(_constants->start(), data->base(T_BYTE), data->length()); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
478 _constants->set_end(end_data); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
479 |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
480 objArrayOop patches = (objArrayOop) HotSpotCompiledCode_DataSection::patches(_dataSection); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
481 for (int i = 0; i < patches->length(); i++) { |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
482 oop patch = patches->obj_at(i); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
483 oop constant = HotSpotCompiledCode_HotSpotData::constant(patch); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
484 oop kind = Constant::kind(constant); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
485 char typeChar = Kind::typeChar(kind); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
486 switch (typeChar) { |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
487 case 'f': |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
488 case 'j': |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
489 case 'd': |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
490 record_metadata_in_constant(constant, _oop_recorder); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
491 break; |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
492 case 'a': |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
493 Handle obj = Constant::object(constant); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
494 jobject value = JNIHandles::make_local(obj()); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
495 int oop_index = _oop_recorder->find_index(value); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
496 |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
497 address dest = _constants->start() + HotSpotCompiledCode_HotSpotData::offset(patch); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
498 _constants->relocate(dest, oop_Relocation::spec(oop_index)); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
499 break; |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
500 } |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
501 } |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
502 |
1432
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
503 for (int i = 0; i < _sites->length(); i++) { |
10684 | 504 oop site = ((objArrayOop) (_sites))->obj_at(i); |
6674
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
505 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
|
506 |
6674
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
507 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
|
508 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
|
509 site_Call(buffer, pc_offset, site); |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
510 } else if (site->is_a(CompilationResult_Infopoint::klass())) { |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
511 // three reasons for infopoints denote actual safepoints |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
512 oop reason = CompilationResult_Infopoint::reason(site); |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
513 if (InfopointReason::SAFEPOINT() == reason || InfopointReason::CALL() == reason || InfopointReason::IMPLICIT_EXCEPTION() == reason) { |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
514 TRACE_graal_4("safepoint at %i", pc_offset); |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
515 site_Safepoint(buffer, pc_offset, site); |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
516 } else { |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
517 // if the infopoint is not an actual safepoint, it must have one of the other reasons |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
518 // (safeguard against new safepoint types that require handling above) |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
519 assert(InfopointReason::METHOD_START() == reason || InfopointReason::METHOD_END() == reason || InfopointReason::LINE_NUMBER() == reason, ""); |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
520 } |
6674
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
521 } 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
|
522 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
|
523 site_DataPatch(buffer, pc_offset, site); |
6674
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
524 } 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
|
525 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
|
526 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
|
527 } else { |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
528 fatal("unexpected Site subclass"); |
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 } |
9807
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9740
diff
changeset
|
531 |
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9740
diff
changeset
|
532 #ifndef PRODUCT |
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9740
diff
changeset
|
533 if (_comments != NULL) { |
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9740
diff
changeset
|
534 for (int i = 0; i < _comments->length(); i++) { |
10684 | 535 oop comment = ((objArrayOop) (_comments))->obj_at(i); |
9807
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9740
diff
changeset
|
536 assert(comment->is_a(HotSpotCompiledCode_Comment::klass()), "cce"); |
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9740
diff
changeset
|
537 jint offset = HotSpotCompiledCode_Comment::pcOffset(comment); |
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9740
diff
changeset
|
538 char* text = java_lang_String::as_utf8_string(HotSpotCompiledCode_Comment::text(comment)); |
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9740
diff
changeset
|
539 buffer.block_comment(offset, text); |
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9740
diff
changeset
|
540 } |
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9740
diff
changeset
|
541 } |
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9740
diff
changeset
|
542 #endif |
10540
0ba44a5a8420
Add sanity check to avoid overwriting the reserved code buffer for very large methods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10410
diff
changeset
|
543 return true; |
2048
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
544 } |
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
545 |
4670
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4583
diff
changeset
|
546 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
|
547 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
|
548 methodHandle method = getMethodFromHotSpotMethod(method_handle()); |
7101
0778b04fc682
better encoding of dependencies during dependency recording by Graal
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
549 _dependencies->assert_evol_method(method()); |
4670
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4583
diff
changeset
|
550 } |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4583
diff
changeset
|
551 |
9012
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
552 void CodeInstaller::assumption_NoFinalizableSubclass(Handle assumption) { |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
553 Handle receiverType_handle = Assumptions_NoFinalizableSubclass::receiverType(assumption()); |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13156
diff
changeset
|
554 Klass* receiverType = java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaClass(receiverType_handle)); |
9012
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
555 _dependencies->assert_has_no_finalizable_subclasses(receiverType); |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
556 } |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
557 |
3672
5e331d5f760e
removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3670
diff
changeset
|
558 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
|
559 Handle context_handle = Assumptions_ConcreteSubtype::context(assumption()); |
7094
eec7173947a1
removed remaining use of the C++ "compiler interface" (i.e. ci) by Graal for installing dependencies
Doug Simon <doug.simon@oracle.com>
parents:
7093
diff
changeset
|
560 Handle subtype_handle = Assumptions_ConcreteSubtype::subtype(assumption()); |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13156
diff
changeset
|
561 Klass* context = java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaClass(context_handle)); |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13156
diff
changeset
|
562 Klass* subtype = java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaClass(subtype_handle)); |
2048
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
563 |
7101
0778b04fc682
better encoding of dependencies during dependency recording by Graal
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
564 _dependencies->assert_leaf_type(subtype); |
7094
eec7173947a1
removed remaining use of the C++ "compiler interface" (i.e. ci) by Graal for installing dependencies
Doug Simon <doug.simon@oracle.com>
parents:
7093
diff
changeset
|
565 if (context != subtype) { |
2048
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
566 assert(context->is_abstract(), ""); |
7101
0778b04fc682
better encoding of dependencies during dependency recording by Graal
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
567 _dependencies->assert_abstract_with_unique_concrete_subtype(context, subtype); |
2048
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
568 } |
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
569 } |
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
570 |
3672
5e331d5f760e
removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3670
diff
changeset
|
571 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
|
572 Handle impl_handle = Assumptions_ConcreteMethod::impl(assumption()); |
7094
eec7173947a1
removed remaining use of the C++ "compiler interface" (i.e. ci) by Graal for installing dependencies
Doug Simon <doug.simon@oracle.com>
parents:
7093
diff
changeset
|
573 Handle context_handle = Assumptions_ConcreteMethod::context(assumption()); |
eec7173947a1
removed remaining use of the C++ "compiler interface" (i.e. ci) by Graal for installing dependencies
Doug Simon <doug.simon@oracle.com>
parents:
7093
diff
changeset
|
574 |
3704
342a54994e05
Made C++ changes to reflect changes to CiAssumptions.ConcreteMethod.
Doug Simon <doug.simon@oracle.com>
parents:
3690
diff
changeset
|
575 methodHandle impl = getMethodFromHotSpotMethod(impl_handle()); |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13156
diff
changeset
|
576 Klass* context = java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaClass(context_handle)); |
7094
eec7173947a1
removed remaining use of the C++ "compiler interface" (i.e. ci) by Graal for installing dependencies
Doug Simon <doug.simon@oracle.com>
parents:
7093
diff
changeset
|
577 |
7101
0778b04fc682
better encoding of dependencies during dependency recording by Graal
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
578 _dependencies->assert_unique_concrete_method(context, impl()); |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
579 } |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
580 |
8947
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
581 void CodeInstaller::assumption_CallSiteTargetValue(Handle assumption) { |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
582 Handle callSite = Assumptions_CallSiteTargetValue::callSite(assumption()); |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
583 Handle methodHandle = Assumptions_CallSiteTargetValue::methodHandle(assumption()); |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
584 |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
585 _dependencies->assert_call_site_target_value(callSite(), methodHandle()); |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
586 } |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
587 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
588 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
|
589 // 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
|
590 const int num_handlers = 5; |
1432
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
591 GrowableArray<intptr_t>* bcis = new GrowableArray<intptr_t> (num_handlers); |
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
592 GrowableArray<intptr_t>* scope_depths = new GrowableArray<intptr_t> (num_handlers); |
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
593 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
|
594 |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
595 if (_exception_handlers != NULL) { |
1432
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
596 for (int i = 0; i < _exception_handlers->length(); i++) { |
9972
91c16dff3fc1
Refactor CodeInstaller and CompilerToVM
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9891
diff
changeset
|
597 oop exc=((objArrayOop) (_exception_handlers))->obj_at(i); |
6674
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
598 jint pc_offset = CompilationResult_Site::pcOffset(exc); |
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
599 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
|
600 |
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
|
601 // 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
|
602 _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
|
603 |
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
|
604 // 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
|
605 _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
|
606 } |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
607 } |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
608 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
609 |
7154
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
610 // If deoptimization happens, the interpreter should reexecute these bytecodes. |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
611 // This function mainly helps the compilers to set up the reexecute bit. |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
612 static bool bytecode_should_reexecute(Bytecodes::Code code) { |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
613 switch (code) { |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
614 case Bytecodes::_invokedynamic: |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
615 case Bytecodes::_invokevirtual: |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
616 case Bytecodes::_invokeinterface: |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
617 case Bytecodes::_invokespecial: |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
618 case Bytecodes::_invokestatic: |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
619 return false; |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
620 default: |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
621 return true; |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
622 } |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
623 return true; |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
624 } |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
625 |
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
|
626 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
|
627 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
|
628 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
|
629 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
|
630 record_scope(pc_offset, caller_frame, objects); |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
631 } |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
632 |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
633 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
|
634 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
|
635 jint bci = BytecodePosition::bci(frame); |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
636 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
|
637 if (bci == -1 || bci == -2){ |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
638 reexecute = false; |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
639 } else { |
2182
9569fdf936ff
Made merge compile.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2059
diff
changeset
|
640 Bytecodes::Code code = Bytecodes::java_code_at(method, method->bcp_from(bci)); |
7154
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
7139
diff
changeset
|
641 reexecute = 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
|
642 if (frame != NULL) { |
6515
e722fa145b37
Fixed VS2010 warnings in HotSpot.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6446
diff
changeset
|
643 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
|
644 } |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
645 } |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
646 |
2901
d577d07cedec
Added time measurement for phases.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2891
diff
changeset
|
647 if (TraceGraal >= 2) { |
11248
b5f6188d79c5
minor logging improvement
Doug Simon <doug.simon@oracle.com>
parents:
10854
diff
changeset
|
648 tty->print_cr("Recording scope pc_offset=%d bci=%d method=%s", pc_offset, bci, method->name_and_sig_as_C_string()); |
1937
4853c5cad3aa
More deoptmization tracing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1936
diff
changeset
|
649 } |
4853c5cad3aa
More deoptmization tracing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1936
diff
changeset
|
650 |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
651 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
|
652 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
|
653 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
|
654 arrayOop values = (arrayOop) BytecodeFrame::values(frame); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
655 |
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
|
656 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
|
657 |
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
|
658 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
|
659 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
|
660 GrowableArray<MonitorValue*>* monitors = new GrowableArray<MonitorValue*> (); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
661 |
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
|
662 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
|
663 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
|
664 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
|
665 } |
1936
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1931
diff
changeset
|
666 |
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
|
667 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
|
668 ScopeValue* second = NULL; |
9972
91c16dff3fc1
Refactor CodeInstaller and CompilerToVM
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9891
diff
changeset
|
669 oop value=((objArrayOop) (values))->obj_at(i); |
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
|
670 if (i < local_count) { |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
671 ScopeValue* first = get_scope_value(value, _total_frame_size, objects, second, _oop_recorder); |
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
|
672 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
|
673 locals->append(second); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
674 } |
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
|
675 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
|
676 } else if (i < local_count + expression_count) { |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
677 ScopeValue* first = get_scope_value(value, _total_frame_size, objects, second, _oop_recorder); |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
678 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
|
679 expressions->append(second); |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
680 } |
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
|
681 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
|
682 } else { |
6996
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6950
diff
changeset
|
683 monitors->append(get_monitor_value(value, _total_frame_size, objects, _oop_recorder)); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
684 } |
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
|
685 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
|
686 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
|
687 assert(i < values->length(), "double-slot value not followed by Value.ILLEGAL"); |
9972
91c16dff3fc1
Refactor CodeInstaller and CompilerToVM
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9891
diff
changeset
|
688 assert(((objArrayOop) (values))->obj_at(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
|
689 } |
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
|
690 } |
3090
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
691 |
9887
4d5872186e76
Add compressed oops support in Graal/Hotspot site
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9807
diff
changeset
|
692 |
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
|
693 _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
|
694 |
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
|
695 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
|
696 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
|
697 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
|
698 |
6515
e722fa145b37
Fixed VS2010 warnings in HotSpot.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6446
diff
changeset
|
699 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
|
700 |
7933
85bd81dba8fc
Remove more code related to deferred writes.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7930
diff
changeset
|
701 _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
|
702 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
703 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
704 void CodeInstaller::site_Safepoint(CodeBuffer& buffer, jint pc_offset, oop site) { |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
705 oop debug_info = CompilationResult_Infopoint::debugInfo(site); |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
706 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
|
707 |
1432
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
708 // address instruction = _instructions->start() + pc_offset; |
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
709 // jint next_pc_offset = Assembler::locate_next_instruction(instruction) - _instructions->start(); |
7660
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7154
diff
changeset
|
710 _debug_recorder->add_safepoint(pc_offset, 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
|
711 |
7139
045c5f8ae689
modified code installation to handle debug info that only contains oop maps but no frame information
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
712 oop frame = DebugInfo::bytecodePosition(debug_info); |
045c5f8ae689
modified code installation to handle debug info that only contains oop maps but no frame information
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
713 if (frame != NULL) { |
045c5f8ae689
modified code installation to handle debug info that only contains oop maps but no frame information
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
714 record_scope(pc_offset, frame, new GrowableArray<ScopeValue*>()); |
045c5f8ae689
modified code installation to handle debug info that only contains oop maps but no frame information
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
715 } else { |
045c5f8ae689
modified code installation to handle debug info that only contains oop maps but no frame information
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
716 // Stubs do not record scope info, just oop maps |
045c5f8ae689
modified code installation to handle debug info that only contains oop maps but no frame information
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
717 } |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
718 |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
719 _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
|
720 } |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
721 |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
722 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
|
723 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
|
724 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
|
725 |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
726 oop hotspot_method = NULL; // JavaMethod |
9740
c4b1aa93b9af
rename: HotSpotRuntimeCallTarget -> HotSpotForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9669
diff
changeset
|
727 oop foreign_call = NULL; |
3561
bea018622324
Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents:
3560
diff
changeset
|
728 |
9740
c4b1aa93b9af
rename: HotSpotRuntimeCallTarget -> HotSpotForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9669
diff
changeset
|
729 if (target_klass->is_subclass_of(SystemDictionary::HotSpotForeignCallLinkage_klass())) { |
c4b1aa93b9af
rename: HotSpotRuntimeCallTarget -> HotSpotForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9669
diff
changeset
|
730 foreign_call = target; |
3561
bea018622324
Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents:
3560
diff
changeset
|
731 } else { |
bea018622324
Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents:
3560
diff
changeset
|
732 hotspot_method = target; |
bea018622324
Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents:
3560
diff
changeset
|
733 } |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
734 |
6674
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
735 oop debug_info = CompilationResult_Call::debugInfo(site); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
736 |
11827
ff1d8605f354
graal code installer: minor style cleanup
Bernhard Urban <bernhard.urban@jku.at>
parents:
11760
diff
changeset
|
737 assert(!!hotspot_method ^ !!foreign_call, "Call site needs exactly one type"); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
738 |
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
|
739 NativeInstruction* inst = nativeInstruction_at(_instructions->start() + pc_offset); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
740 jint next_pc_offset = CodeInstaller::pd_next_offset(inst, pc_offset, hotspot_method); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
741 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
742 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
|
743 oop frame = DebugInfo::bytecodePosition(debug_info); |
7660
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7154
diff
changeset
|
744 _debug_recorder->add_safepoint(next_pc_offset, create_oop_map(_total_frame_size, _parameter_count, debug_info)); |
7139
045c5f8ae689
modified code installation to handle debug info that only contains oop maps but no frame information
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
745 if (frame != NULL) { |
045c5f8ae689
modified code installation to handle debug info that only contains oop maps but no frame information
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
746 record_scope(next_pc_offset, frame, new GrowableArray<ScopeValue*>()); |
045c5f8ae689
modified code installation to handle debug info that only contains oop maps but no frame information
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
747 } else { |
045c5f8ae689
modified code installation to handle debug info that only contains oop maps but no frame information
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
748 // Stubs do not record scope info, just oop maps |
045c5f8ae689
modified code installation to handle debug info that only contains oop maps but no frame information
Doug Simon <doug.simon@oracle.com>
parents:
7125
diff
changeset
|
749 } |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
750 } |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
751 |
9740
c4b1aa93b9af
rename: HotSpotRuntimeCallTarget -> HotSpotForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9669
diff
changeset
|
752 if (foreign_call != NULL) { |
c4b1aa93b9af
rename: HotSpotRuntimeCallTarget -> HotSpotForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9669
diff
changeset
|
753 jlong foreign_call_destination = HotSpotForeignCallLinkage::address(foreign_call); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
754 CodeInstaller::pd_relocate_ForeignCall(inst, foreign_call_destination); |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
755 } else { // method != NULL |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
756 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
|
757 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
|
758 |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
759 TRACE_graal_3("method call"); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
760 CodeInstaller::pd_relocate_JavaMethod(hotspot_method, pc_offset); |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
761 } |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10810
diff
changeset
|
762 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
763 _next_call_type = MARK_INVOKE_INVALID; |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10810
diff
changeset
|
764 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
765 if (debug_info != NULL) { |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
766 _debug_recorder->end_safepoint(next_pc_offset); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
767 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
768 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
769 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
770 void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site) { |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
771 oop inlineData = CompilationResult_DataPatch::inlineData(site); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
772 if (inlineData != NULL) { |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
773 oop kind = Constant::kind(inlineData); |
10810
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10771
diff
changeset
|
774 char typeChar = Kind::typeChar(kind); |
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10771
diff
changeset
|
775 switch (typeChar) { |
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10771
diff
changeset
|
776 case 'f': |
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10771
diff
changeset
|
777 case 'j': |
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10771
diff
changeset
|
778 case 'd': |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
779 record_metadata_in_constant(inlineData, _oop_recorder); |
10810
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10771
diff
changeset
|
780 break; |
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10771
diff
changeset
|
781 } |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
782 } |
10684 | 783 CodeInstaller::pd_site_DataPatch(pc_offset, site); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
784 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
785 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
786 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
|
787 oop id_obj = CompilationResult_Mark::id(site); |
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
788 arrayOop references = (arrayOop) CompilationResult_Mark::references(site); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
789 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
790 if (id_obj != NULL) { |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
791 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
|
792 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
|
793 |
10771 | 794 address pc = _instructions->start() + pc_offset; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
795 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
796 switch (id) { |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
797 case MARK_UNVERIFIED_ENTRY: |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
798 _offsets.set_value(CodeOffsets::Entry, pc_offset); |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
799 break; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
800 case MARK_VERIFIED_ENTRY: |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
801 _offsets.set_value(CodeOffsets::Verified_Entry, pc_offset); |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
802 break; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
803 case MARK_OSR_ENTRY: |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
804 _offsets.set_value(CodeOffsets::OSR_Entry, pc_offset); |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
805 break; |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
806 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
|
807 _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
|
808 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
|
809 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
|
810 _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
|
811 break; |
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
|
812 case MARK_INVOKEVIRTUAL: |
10771 | 813 case MARK_INVOKEINTERFACE: |
7935
0799a7efbe7b
Clean up of usage of marks and code installation.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7933
diff
changeset
|
814 case MARK_INLINE_INVOKE: |
8136
c66aa27ef4da
Reenable patching of optimized and static calls but without out-of-line stubs.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7935
diff
changeset
|
815 case MARK_INVOKESTATIC: |
c66aa27ef4da
Reenable patching of optimized and static calls but without out-of-line stubs.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7935
diff
changeset
|
816 case MARK_INVOKESPECIAL: |
1432
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
817 _next_call_type = (MarkId) id; |
10771 | 818 _invoke_mark_pc = pc; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
819 break; |
11760
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
11338
diff
changeset
|
820 case MARK_POLL_NEAR: |
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
|
821 case MARK_POLL_FAR: |
11760
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
11338
diff
changeset
|
822 case MARK_POLL_RETURN_NEAR: |
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
|
823 case MARK_POLL_RETURN_FAR: |
11760
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
11338
diff
changeset
|
824 pd_relocate_poll(pc, id); |
3549
25765a764212
Add support for polling mark in code installer
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3538
diff
changeset
|
825 break; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
826 default: |
1931
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1484
diff
changeset
|
827 ShouldNotReachHere(); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
828 break; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
829 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
830 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
831 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
832 |