Mercurial > hg > truffle
annotate src/share/vm/graal/graalCodeInstaller.cpp @ 16729:3d148f5e90b8
mx: refactor maven_install_truffle such that it uses specified paths from the project file
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Fri, 08 Aug 2014 23:14:37 +0200 |
parents | e7b7a5be4d21 |
children | 4e3b63e7a9f6 |
rev | line source |
---|---|
2516
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
1 /* |
14104 | 2 * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. |
2516
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" |
15046
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
25 #include "code/compiledIC.hpp" |
13816
d006a6332db8
Make sure a compile id is assigned
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13726
diff
changeset
|
26 #include "compiler/compileBroker.hpp" |
7735 | 27 #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
|
28 #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
|
29 #include "graal/graalEnv.hpp" |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
30 #include "graal/graalCompiler.hpp" |
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
31 #include "graal/graalCodeInstaller.hpp" |
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
32 #include "graal/graalJavaAccess.hpp" |
4221
bcbb918f5ac6
Renaming of VMExits and VMEntries part 2.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4220
diff
changeset
|
33 #include "graal/graalCompilerToVM.hpp" |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
7101
diff
changeset
|
34 #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
|
35 #include "asm/register.hpp" |
2048
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
36 #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
|
37 #include "code/vmreg.hpp" |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
38 |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
39 #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
|
40 # 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
|
41 #endif |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
42 #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
|
43 # 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
|
44 #endif |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
45 #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
|
46 # 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
|
47 #endif |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
48 #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
|
49 # 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
|
50 #endif |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
51 #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
|
52 # 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
|
53 #endif |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
54 |
14104 | 55 Method* getMethodFromHotSpotMethod(oop hotspot_method) { |
56 assert(hotspot_method != NULL && hotspot_method->is_a(HotSpotResolvedJavaMethod::klass()), "sanity"); | |
57 return asMethod(HotSpotResolvedJavaMethod::metaspaceMethod(hotspot_method)); | |
58 } | |
59 | |
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
|
60 // 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
|
61 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
|
62 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
|
63 return as_Register(graal_reg)->as_VMReg(); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
64 } else { |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
65 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
|
66 #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
|
67 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
|
68 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
|
69 } |
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
70 #endif |
16645
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
71 #ifdef TARGET_ARCH_sparc |
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
72 if (remainder < FloatRegisterImpl::number_of_registers) { |
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
73 return as_FloatRegister(remainder)->as_VMReg(); |
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
74 } |
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
75 #endif |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
76 ShouldNotReachHere(); |
7772
62bcf515831d
Fix warning that breaks windows build.
Roland Schatz <roland.schatz@oracle.com>
parents:
7742
diff
changeset
|
77 return NULL; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
78 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
79 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
80 |
5542
e318468952f5
Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5326
diff
changeset
|
81 const int MapWordBits = 64; |
e318468952f5
Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5326
diff
changeset
|
82 |
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
|
83 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
|
84 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
|
85 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
|
86 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
|
87 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
|
88 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
|
89 } |
e318468952f5
Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5326
diff
changeset
|
90 |
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
|
91 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
|
92 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
|
93 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
|
94 } |
52bb06250d35
Converted CiDebugInfo.registerRefMap field from type long to CiBitMap.
Doug Simon <doug.simon@oracle.com>
parents:
1468
diff
changeset
|
95 |
16093
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
96 static void set_vmreg_oops(OopMap* map, VMReg reg, oop bitset, int idx) { |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
97 bool is_oop = is_bit_set(bitset, 3 * idx); |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
98 if (is_oop) { |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
99 bool narrow1 = is_bit_set(bitset, 3 * idx + 1); |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
100 bool narrow2 = is_bit_set(bitset, 3 * idx + 2); |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
101 if (narrow1 || narrow2) { |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
102 if (narrow1) { |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
103 map->set_narrowoop(reg); |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
104 } |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
105 if (narrow2) { |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
106 map->set_narrowoop(reg->next()); |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
107 } |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
108 } else { |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
109 map->set_oop(reg); |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
110 } |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
111 } else { |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
112 map->set_value(reg); |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
113 } |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
114 } |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
115 |
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
|
116 // 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
|
117 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
|
118 OopMap* map = new OopMap(total_frame_size, parameter_count); |
13725
8d8732e14447
Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
13641
diff
changeset
|
119 oop reference_map = DebugInfo::referenceMap(debug_info); |
14562
45812e05cdb3
Move narrow oop handling in reference maps to hotspot specific code.
Roland Schatz <roland.schatz@oracle.com>
parents:
14561
diff
changeset
|
120 oop register_map = HotSpotReferenceMap::registerRefMap(reference_map); |
45812e05cdb3
Move narrow oop handling in reference maps to hotspot specific code.
Roland Schatz <roland.schatz@oracle.com>
parents:
14561
diff
changeset
|
121 oop frame_map = HotSpotReferenceMap::frameRefMap(reference_map); |
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
|
122 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
|
123 |
1469
52bb06250d35
Converted CiDebugInfo.registerRefMap field from type long to CiBitMap.
Doug Simon <doug.simon@oracle.com>
parents:
1468
diff
changeset
|
124 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
|
125 for (jint i = 0; i < RegisterImpl::number_of_registers; i++) { |
16093
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
126 set_vmreg_oops(map, as_Register(i)->as_VMReg(), register_map, i); |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
127 } |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
128 #ifdef TARGET_ARCH_x86 |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
129 for (jint i = 0; i < XMMRegisterImpl::number_of_registers; i++) { |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
130 VMReg reg = as_XMMRegister(i)->as_VMReg(); |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
131 int idx = RegisterImpl::number_of_registers + 4 * i; |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
132 for (jint j = 0; j < 4; j++) { |
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
133 set_vmreg_oops(map, reg->next(2 * j), register_map, idx + j); |
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
|
134 } |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
135 } |
16093
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
136 #endif |
16645
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
137 #ifdef TARGET_ARCH_sparc |
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
138 for (jint i = 0; i < FloatRegisterImpl::number_of_registers; i++) { |
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
139 VMReg reg = as_FloatRegister(i)->as_VMReg(); |
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
140 int idx = RegisterImpl::number_of_registers + i; |
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
141 set_vmreg_oops(map, reg, register_map, idx); |
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
142 } |
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
143 #endif |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
144 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
145 |
13726
343541fb3b49
Support narrow oops in reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
13725
diff
changeset
|
146 for (jint i = 0; i < bitset_size(frame_map) / 3; 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
|
147 // 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
|
148 VMReg reg = VMRegImpl::stack2reg(i * VMRegImpl::slots_per_word); |
16093
39be5bc00046
Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
15728
diff
changeset
|
149 set_vmreg_oops(map, reg, frame_map, i); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
150 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
151 |
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
|
152 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
|
153 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
|
154 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
|
155 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
|
156 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
|
157 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
|
158 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
|
159 // 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
|
160 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
|
161 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
|
162 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
|
163 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
|
164 #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
|
165 // (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
|
166 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
|
167 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
|
168 #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
|
169 } |
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
|
170 } |
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
|
171 |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
172 return map; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
173 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
174 |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
175 static void record_metadata_reference(oop obj, jlong prim, bool compressed, OopRecorder* oop_recorder) { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
176 if (obj->is_a(HotSpotResolvedObjectType::klass())) { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
177 Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaClass(obj)); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
178 if (compressed) { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
179 assert(Klass::decode_klass((narrowKlass) prim) == klass, err_msg("%s @ %p != %p", klass->name()->as_C_string(), klass, prim)); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
180 } else { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
181 assert((Klass*) prim == klass, err_msg("%s @ %p != %p", klass->name()->as_C_string(), klass, prim)); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
182 } |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
183 int index = oop_recorder->find_index(klass); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
184 TRACE_graal_3("metadata[%d of %d] = %s", index, oop_recorder->metadata_count(), klass->name()->as_C_string()); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
185 } else if (obj->is_a(HotSpotResolvedJavaMethod::klass())) { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
186 Method* method = (Method*) (address) HotSpotResolvedJavaMethod::metaspaceMethod(obj); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
187 assert(!compressed, err_msg("unexpected compressed method pointer %s @ %p = %p", method->name()->as_C_string(), method, prim)); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
188 int index = oop_recorder->find_index(method); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
189 TRACE_graal_3("metadata[%d of %d] = %s", index, oop_recorder->metadata_count(), method->name()->as_C_string()); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
190 } else { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
191 assert(java_lang_String::is_instance(obj), |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
192 err_msg("unexpected metadata reference (%s) for constant %ld (%p)", obj->klass()->name()->as_C_string(), prim, prim)); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
193 } |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
194 } |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
195 |
7084
9ba90252ce08
HotSpotResolvedJavaType is now the HotSpot implementation of ResolvedJavaType,
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7081
diff
changeset
|
196 // 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
|
197 static void record_metadata_in_constant(oop constant, OopRecorder* oop_recorder) { |
15018
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14729
diff
changeset
|
198 if (constant->is_a(HotSpotMetaspaceConstant::klass())) { |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14729
diff
changeset
|
199 oop obj = HotSpotMetaspaceConstant::metaspaceObject(constant); |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14729
diff
changeset
|
200 jlong prim = HotSpotMetaspaceConstant::primitive(constant); |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14729
diff
changeset
|
201 assert(Kind::typeChar(Constant::kind(constant)) == 'j', "must have word kind"); |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14729
diff
changeset
|
202 assert(obj != NULL, "must have an object"); |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14729
diff
changeset
|
203 assert(prim != 0, "must have a primitive value"); |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14729
diff
changeset
|
204 |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14729
diff
changeset
|
205 record_metadata_reference(obj, prim, false, oop_recorder); |
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
|
206 } |
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
|
207 } |
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
|
208 |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
209 static void record_metadata_in_patch(oop data, OopRecorder* oop_recorder) { |
14583
2ec76bd5f309
fix windows compiler warning (C4800)
Andreas Woess <andreas.woess@jku.at>
parents:
14574
diff
changeset
|
210 record_metadata_reference(MetaspaceData::annotation(data), MetaspaceData::value(data), MetaspaceData::compressed(data) != 0, oop_recorder); |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
211 } |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
212 |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
213 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
|
214 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
|
215 if (value == Value::ILLEGAL()) { |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
216 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
|
217 } |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
218 |
16580
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
219 oop lirKind = Value::lirKind(value); |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
220 oop platformKind = LIRKind::platformKind(lirKind); |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
221 jint referenceMask = LIRKind::referenceMask(lirKind); |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
222 assert(referenceMask == 0 || referenceMask == 1, "unexpected referenceMask"); |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
223 bool reference = referenceMask == 1; |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
224 |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
225 BasicType type = GraalRuntime::kindToBasicType(Kind::typeChar(platformKind)); |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
226 |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
227 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
|
228 jint number = code_Register::number(RegisterValue::reg(value)); |
16645
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
229 jint encoding = code_Register::encoding(RegisterValue::reg(value)); |
10684 | 230 if (number < RegisterImpl::number_of_registers) { |
16580
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
231 Location::Type locationType; |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
232 if (type == T_INT) { |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
233 locationType = reference ? Location::narrowoop : Location::int_in_long; |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
234 } else if (type == T_FLOAT) { |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
235 locationType = Location::int_in_long; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
236 } else if (type == T_LONG) { |
16580
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
237 locationType = reference ? Location::oop : Location::lng; |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
238 } else { |
16580
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
239 assert(type == T_OBJECT && reference, "unexpected type in cpu register"); |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
240 locationType = Location::oop; |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
241 } |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
242 ScopeValue* value = new LocationValue(Location::new_reg_loc(locationType, as_Register(number)->as_VMReg())); |
16580
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
243 if (type == T_LONG && !reference) { |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
244 second = value; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
245 } |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
246 return value; |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
247 } else { |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
248 assert(type == T_FLOAT || type == T_DOUBLE, "only float and double expected in xmm register"); |
16580
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
249 Location::Type locationType; |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
250 if (type == T_FLOAT) { |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
251 // 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
|
252 locationType = Location::normal; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
253 } else { |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
254 locationType = Location::dbl; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
255 } |
16589
6bdd2ec553eb
handle HotSpotCompressedNullConstant in graalCodeInstaller
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16580
diff
changeset
|
256 assert(!reference, "unexpected type in floating point register"); |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
257 #ifdef TARGET_ARCH_x86 |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
258 ScopeValue* value = new LocationValue(Location::new_reg_loc(locationType, as_XMMRegister(number - 16)->as_VMReg())); |
16589
6bdd2ec553eb
handle HotSpotCompressedNullConstant in graalCodeInstaller
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16580
diff
changeset
|
259 if (type == T_DOUBLE) { |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
260 second = value; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
261 } |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
262 return value; |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
263 #else |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
264 #ifdef TARGET_ARCH_sparc |
16645
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
265 ScopeValue* value = new LocationValue(Location::new_reg_loc(locationType, as_FloatRegister(encoding)->as_VMReg())); |
16589
6bdd2ec553eb
handle HotSpotCompressedNullConstant in graalCodeInstaller
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16580
diff
changeset
|
266 if (type == T_DOUBLE) { |
16645
8c70d65ec04a
[SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16520
diff
changeset
|
267 second = new ConstantIntValue(0); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
268 } |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
269 return value; |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
270 #else |
7742
9f8bf17b2d33
Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7735
diff
changeset
|
271 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
|
272 #endif |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
9891
diff
changeset
|
273 #endif |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
274 } |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
275 } else if (value->is_a(StackSlot::klass())) { |
16580
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
276 Location::Type locationType; |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
277 if (type == T_LONG) { |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
278 locationType = reference ? Location::oop : Location::lng; |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
279 } else if (type == T_INT) { |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
280 locationType = reference ? Location::narrowoop : Location::normal; |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
281 } else if (type == T_FLOAT) { |
16589
6bdd2ec553eb
handle HotSpotCompressedNullConstant in graalCodeInstaller
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16580
diff
changeset
|
282 assert(!reference, "unexpected type in stack slot"); |
16580
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
283 locationType = Location::normal; |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
284 } else if (type == T_DOUBLE) { |
16589
6bdd2ec553eb
handle HotSpotCompressedNullConstant in graalCodeInstaller
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16580
diff
changeset
|
285 assert(!reference, "unexpected type in stack slot"); |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
286 locationType = Location::dbl; |
16580
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
287 } else { |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
288 assert(type == T_OBJECT && reference, "unexpected type in stack slot"); |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
289 locationType = Location::oop; |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
290 } |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
291 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
|
292 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
|
293 offset += total_frame_size; |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
294 } |
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
|
295 ScopeValue* value = new LocationValue(Location::new_stk_loc(locationType, offset)); |
16580
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
296 if (type == T_DOUBLE || (type == T_LONG && !reference)) { |
2938
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
297 second = value; |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
298 } |
c7783b6773ea
fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
299 return value; |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
300 } 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
|
301 record_metadata_in_constant(value, oop_recorder); |
16580
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
302 if (value->is_a(PrimitiveConstant::klass())) { |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
303 assert(!reference, "unexpected primitive constant type"); |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
304 if (type == T_INT || type == T_FLOAT) { |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
305 jint prim = (jint)PrimitiveConstant::primitive(value); |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
306 return new ConstantIntValue(prim); |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
307 } else { |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
308 assert(type == T_LONG || type == T_DOUBLE, "unexpected primitive constant type"); |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
309 jlong prim = PrimitiveConstant::primitive(value); |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
310 second = new ConstantIntValue(0); |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
311 return new ConstantLongValue(prim); |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
312 } |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
313 } else { |
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
314 assert(reference, "unexpected object constant type"); |
16589
6bdd2ec553eb
handle HotSpotCompressedNullConstant in graalCodeInstaller
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16580
diff
changeset
|
315 if (value->is_a(NullConstant::klass()) || value->is_a(HotSpotCompressedNullConstant::klass())) { |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
316 return new ConstantOopWriteValue(NULL); |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
317 } else { |
16580
a7d9b88ecd68
use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents:
16573
diff
changeset
|
318 assert(value->is_a(HotSpotObjectConstant::klass()), "unexpected constant type"); |
15018
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14729
diff
changeset
|
319 oop obj = HotSpotObjectConstant::object(value); |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14729
diff
changeset
|
320 assert(obj != NULL, "null value must be in NullConstant"); |
3669
53636e2c9d03
No longer use shared ciFactory. Remove make_global usage in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3668
diff
changeset
|
321 return new ConstantOopWriteValue(JNIHandles::make_local(obj)); |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
322 } |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
323 } |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
324 } 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
|
325 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
|
326 int id = VirtualObject::id(value); |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13156
diff
changeset
|
327 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
|
328 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
|
329 bool isLongArray = klass == Universe::longArrayKlassObj(); |
3090
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
330 |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
331 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
|
332 ObjectValue* obj = (ObjectValue*) objects->at(i); |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
333 if (obj->id() == id) { |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
334 return obj; |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
335 } |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
336 } |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
337 |
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
|
338 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
|
339 objects->append(sv); |
3090
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
340 |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
341 arrayOop values = (arrayOop) VirtualObject::values(value); |
3090
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
342 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
|
343 ScopeValue* cur_second = NULL; |
9972
91c16dff3fc1
Refactor CodeInstaller and CompilerToVM
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9891
diff
changeset
|
344 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
|
345 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
|
346 |
5126
43d5ae1051f7
added better debug output when an optimistic deoptimization is disabled
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5104
diff
changeset
|
347 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
|
348 // 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
|
349 // add an int 0 constant |
5144
f7b2800b1738
Use VM_LITTLE_ENDIAN to determine endianness.
Andreas Woess <andreas.woess@jku.at>
parents:
5130
diff
changeset
|
350 #ifdef VM_LITTLE_ENDIAN |
f7b2800b1738
Use VM_LITTLE_ENDIAN to determine endianness.
Andreas Woess <andreas.woess@jku.at>
parents:
5130
diff
changeset
|
351 cur_second = new ConstantIntValue(0); |
f7b2800b1738
Use VM_LITTLE_ENDIAN to determine endianness.
Andreas Woess <andreas.woess@jku.at>
parents:
5130
diff
changeset
|
352 #else |
5126
43d5ae1051f7
added better debug output when an optimistic deoptimization is disabled
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5104
diff
changeset
|
353 cur_second = value; |
43d5ae1051f7
added better debug output when an optimistic deoptimization is disabled
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5104
diff
changeset
|
354 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
|
355 #endif |
5104
9ec2917fd0de
Allow ints to be put into a virtual long array.
Andreas Woess <andreas.woess@jku.at>
parents:
5000
diff
changeset
|
356 } |
9ec2917fd0de
Allow ints to be put into a virtual long array.
Andreas Woess <andreas.woess@jku.at>
parents:
5000
diff
changeset
|
357 |
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
|
358 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
|
359 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
|
360 } |
3090
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
361 sv->field_values()->append(value); |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
362 } |
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
363 return sv; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
364 } else { |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
365 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
|
366 value->print(); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
367 } |
2215
999f8086cc4f
More changes to make it compile and work on win64.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2182
diff
changeset
|
368 ShouldNotReachHere(); |
999f8086cc4f
More changes to make it compile and work on win64.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
2182
diff
changeset
|
369 return NULL; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
370 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
371 |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
372 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
|
373 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
|
374 |
b648304ba4ff
Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3710
diff
changeset
|
375 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
|
376 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
|
377 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
|
378 |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
379 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
|
380 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
|
381 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
|
382 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
|
383 |
3717
4177ddd2d1d1
Fix build error for Windows builds
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3714
diff
changeset
|
384 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
|
385 if (HotSpotMonitorValue::eliminated(value)) { |
3717
4177ddd2d1d1
Fix build error for Windows builds
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3714
diff
changeset
|
386 eliminated = true; |
4177ddd2d1d1
Fix build error for Windows builds
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3714
diff
changeset
|
387 } |
3714
b648304ba4ff
Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3710
diff
changeset
|
388 |
b648304ba4ff
Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3710
diff
changeset
|
389 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
|
390 } |
b648304ba4ff
Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents:
3710
diff
changeset
|
391 |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
392 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
|
393 _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
|
394 _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
|
395 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
|
396 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
|
397 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
|
398 int length = assumptions->length(); |
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3669
diff
changeset
|
399 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
|
400 Handle assumption = assumptions->obj_at(i); |
5e331d5f760e
removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3670
diff
changeset
|
401 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
|
402 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
|
403 assumption_MethodContents(assumption); |
9012
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
404 } else if (assumption->klass() == Assumptions_NoFinalizableSubclass::klass()) { |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
405 assumption_NoFinalizableSubclass(assumption); |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
406 } 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
|
407 assumption_ConcreteSubtype(assumption); |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
408 } 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
|
409 assumption_ConcreteMethod(assumption); |
8947
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
410 } else if (assumption->klass() == Assumptions_CallSiteTargetValue::klass()) { |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
411 assumption_CallSiteTargetValue(assumption); |
3657
47edfca346ab
Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
412 } else { |
47edfca346ab
Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
413 assumption->print(); |
47edfca346ab
Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
414 fatal("unexpected Assumption subclass"); |
47edfca346ab
Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
415 } |
47edfca346ab
Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
416 } |
47edfca346ab
Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
417 } |
47edfca346ab
Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
418 } |
3668
46f211fe010c
Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3667
diff
changeset
|
419 } |
46f211fe010c
Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3667
diff
changeset
|
420 |
46f211fe010c
Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3667
diff
changeset
|
421 // constructor used to create a method |
13641
5a9afbf72714
Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13630
diff
changeset
|
422 GraalEnv::CodeInstallResult CodeInstaller::install(Handle& compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log) { |
15582
063ec2920d21
made Graal runtime initialization in hosted mode lazy
Doug Simon <doug.simon@oracle.com>
parents:
15463
diff
changeset
|
423 BufferBlob* buffer_blob = GraalRuntime::initialize_buffer_blob(); |
13156
2e76d94f8383
propagate code-cache-full message up to Java to throw exception instead of crashing VM
twisti
parents:
11827
diff
changeset
|
424 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
|
425 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
|
426 } |
2e76d94f8383
propagate code-cache-full message up to Java to throw exception instead of crashing VM
twisti
parents:
11827
diff
changeset
|
427 |
2e76d94f8383
propagate code-cache-full message up to Java to throw exception instead of crashing VM
twisti
parents:
11827
diff
changeset
|
428 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
|
429 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
|
430 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
|
431 |
10684 | 432 // Get instructions and constants CodeSections early because we need it. |
433 _instructions = buffer.insts(); | |
434 _constants = buffer.consts(); | |
435 | |
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
|
436 { |
6e1abd79e7c8
Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3663
diff
changeset
|
437 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
|
438 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
|
439 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
|
440 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
|
441 } |
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
|
442 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
|
443 } |
6e1abd79e7c8
Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3663
diff
changeset
|
444 |
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
|
445 int stack_slots = _total_frame_size / HeapWordSize; // conversion to words |
4319
3c21eee8ab4d
Add installMethodCallback() to HotSpotRuntime.
Andreas Woess <andreas.woess@jku.at>
parents:
4232
diff
changeset
|
446 |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
447 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
|
448 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
|
449 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
|
450 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
|
451 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
|
452 &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
|
453 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
|
454 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
|
455 _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
|
456 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
|
457 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
|
458 } 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
|
459 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
|
460 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
|
461 jint entry_bci = HotSpotCompiledNmethod::entryBCI(compiled_code); |
13630
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13576
diff
changeset
|
462 jint id = HotSpotCompiledNmethod::id(compiled_code); |
15463
a20be10ad437
made Graal work with the HotSpot compiler queue and compiler threads, enabled by -XX:-UseGraalCompilationQueue
Doug Simon <doug.simon@oracle.com>
parents:
15264
diff
changeset
|
463 CompileTask* task = (CompileTask*) (address) HotSpotCompiledNmethod::ctask(compiled_code); |
13816
d006a6332db8
Make sure a compile id is assigned
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13726
diff
changeset
|
464 if (id == -1) { |
d006a6332db8
Make sure a compile id is assigned
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13726
diff
changeset
|
465 // Make sure a valid compile_id is associated with every compile |
13969
fe034af88233
Acquire proper locks before calling assign_compile_id
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13816
diff
changeset
|
466 id = CompileBroker::assign_compile_id_unlocked(Thread::current(), method, entry_bci); |
13816
d006a6332db8
Make sure a compile id is assigned
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13726
diff
changeset
|
467 } |
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
|
468 result = GraalEnv::register_method(method, nm, entry_bci, &_offsets, _custom_stack_area_offset, &buffer, stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table, |
15463
a20be10ad437
made Graal work with the HotSpot compiler queue and compiler threads, enabled by -XX:-UseGraalCompilationQueue
Doug Simon <doug.simon@oracle.com>
parents:
15264
diff
changeset
|
469 GraalCompiler::instance(), _debug_recorder, _dependencies, task, id, false, installed_code, speculation_log); |
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
|
470 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
|
471 } |
10684 | 472 |
473 if (cb != NULL) { | |
474 // Make sure the pre-calculated constants section size was correct. | |
475 guarantee((cb->code_begin() - cb->content_begin()) == _constants_size, err_msg("%d != %d", cb->code_begin() - cb->content_begin(), _constants_size)); | |
476 } | |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13261
diff
changeset
|
477 return result; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
478 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
479 |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
480 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
|
481 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
|
482 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
|
483 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
|
484 methodHandle method = getMethodFromHotSpotMethod(hotspotJavaMethod); |
5839
58a607307306
renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents:
5823
diff
changeset
|
485 _parameter_count = method->size_of_parameters(); |
58a607307306
renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents:
5823
diff
changeset
|
486 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
|
487 } else { |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
488 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
|
489 // 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
|
490 _parameter_count = 0; |
3660
c805dfba251d
Fixed regression.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3659
diff
changeset
|
491 } |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
492 _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
|
493 _exception_handlers = (arrayOop) HotSpotCompiledCode::exceptionHandlers(compiled_code); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
494 |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
495 _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
|
496 _code_size = CompilationResult::targetCodeSize(comp_result); |
15180
7a9531f50cd8
renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents:
15176
diff
changeset
|
497 _total_frame_size = CompilationResult::totalFrameSize(comp_result); |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9654
diff
changeset
|
498 _custom_stack_area_offset = CompilationResult::customStackAreaOffset(comp_result); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
499 |
10684 | 500 // 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
|
501 _dataSection = HotSpotCompiledCode::dataSection(compiled_code); |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
502 guarantee(DataSection::sectionAlignment(_dataSection) <= _constants->alignment(), "Alignment inside constants section is restricted by alignment of section begin"); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
503 arrayOop data = (arrayOop) DataSection::data(_dataSection); |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
504 _constants_size = data->length(); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
505 if (_constants_size > 0) { |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
506 _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
|
507 } |
10684 | 508 |
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
|
509 #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
|
510 _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
|
511 #endif |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
512 |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
513 _next_call_type = INVOKE_INVALID; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
514 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
515 |
15046
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
516 int CodeInstaller::estimate_stub_entries() { |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
517 // Estimate the number of static call stubs that might be emitted. |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
518 int static_call_stubs = 0; |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
519 for (int i = 0; i < _sites->length(); i++) { |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
520 oop site = ((objArrayOop) (_sites))->obj_at(i); |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
521 if (site->is_a(CompilationResult_Mark::klass())) { |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
522 oop id_obj = CompilationResult_Mark::id(site); |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
523 if (id_obj != NULL) { |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
524 assert(java_lang_boxing_object::is_instance(id_obj, T_INT), "Integer id expected"); |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
525 jint id = id_obj->int_field(java_lang_boxing_object::value_offset_in_bytes(T_INT)); |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
526 if (id == INVOKESTATIC || id == INVOKESPECIAL) { |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
527 static_call_stubs++; |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
528 } |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
529 } |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
530 } |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
531 } |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
532 return static_call_stubs; |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
533 } |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
534 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
535 // 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
|
536 bool CodeInstaller::initialize_buffer(CodeBuffer& buffer) { |
1931
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1484
diff
changeset
|
537 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
|
538 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
|
539 buffer.insts()->initialize_shared_locs((relocInfo*)locs_buffer, locs_buffer_size / sizeof(relocInfo)); |
15046
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
540 // Allocate enough space in the stub section for the static call |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
541 // stubs. Stubs have extra relocs but they are managed by the stub |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
542 // section itself so they don't need to be accounted for in the |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
543 // locs_buffer above. |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
544 buffer.initialize_stubs_size(estimate_stub_entries() * CompiledStaticCall::to_interp_stub_size()); |
1931
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1484
diff
changeset
|
545 buffer.initialize_consts_size(_constants_size); |
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1484
diff
changeset
|
546 |
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
|
547 _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
|
548 _debug_recorder->set_oopmaps(new OopMapSet()); |
8947
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
549 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
550 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
|
551 |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
552 // 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
|
553 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
|
554 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
|
555 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
|
556 } |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
557 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
|
558 _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
|
559 |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
560 // 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
|
561 address end_data = _constants->start() + _constants_size; |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
562 arrayOop data = (arrayOop) DataSection::data(_dataSection); |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
563 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
|
564 _constants->set_end(end_data); |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
565 |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
566 objArrayOop patches = (objArrayOop) DataSection::patches(_dataSection); |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
567 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
|
568 oop patch = patches->obj_at(i); |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
569 oop data = CompilationResult_DataPatch::data(patch); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
570 if (data->is_a(MetaspaceData::klass())) { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
571 record_metadata_in_patch(data, _oop_recorder); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
572 } else if (data->is_a(OopData::klass())) { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
573 Handle obj = OopData::object(data); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
574 jobject value = JNIHandles::make_local(obj()); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
575 int oop_index = _oop_recorder->find_index(value); |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
576 |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
577 address dest = _constants->start() + CompilationResult_Site::pcOffset(patch); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
578 assert(!OopData::compressed(data), err_msg("unexpected compressed oop in data section")); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
579 _constants->relocate(dest, oop_Relocation::spec(oop_index)); |
14729
8db730993642
check that data patches are of the expected type
Doug Simon <doug.simon@oracle.com>
parents:
14583
diff
changeset
|
580 } else { |
8db730993642
check that data patches are of the expected type
Doug Simon <doug.simon@oracle.com>
parents:
14583
diff
changeset
|
581 ShouldNotReachHere(); |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
582 } |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13493
diff
changeset
|
583 } |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
584 jint last_pc_offset = -1; |
1432
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
585 for (int i = 0; i < _sites->length(); i++) { |
10684 | 586 oop site = ((objArrayOop) (_sites))->obj_at(i); |
6674
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
587 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
|
588 |
6674
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
589 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
|
590 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
|
591 site_Call(buffer, pc_offset, site); |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
592 } 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
|
593 // three reasons for infopoints denote actual safepoints |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
594 oop reason = CompilationResult_Infopoint::reason(site); |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
595 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
|
596 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
|
597 site_Safepoint(buffer, pc_offset, site); |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
598 } else { |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
599 // 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
|
600 // (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
|
601 assert(InfopointReason::METHOD_START() == reason || InfopointReason::METHOD_END() == reason || InfopointReason::LINE_NUMBER() == reason, ""); |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
602 site_Infopoint(buffer, pc_offset, site); |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8589
diff
changeset
|
603 } |
6674
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
604 } 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
|
605 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
|
606 site_DataPatch(buffer, pc_offset, site); |
6674
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
607 } 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
|
608 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
|
609 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
|
610 } else { |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
611 fatal("unexpected Site subclass"); |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
612 } |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
613 last_pc_offset = pc_offset; |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
614 } |
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
|
615 |
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
|
616 #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
|
617 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
|
618 for (int i = 0; i < _comments->length(); i++) { |
10684 | 619 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
|
620 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
|
621 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
|
622 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
|
623 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
|
624 } |
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
|
625 } |
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
|
626 #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
|
627 return true; |
2048
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
628 } |
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
629 |
4670
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4583
diff
changeset
|
630 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
|
631 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
|
632 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
|
633 _dependencies->assert_evol_method(method()); |
4670
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4583
diff
changeset
|
634 } |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4583
diff
changeset
|
635 |
9012
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
636 void CodeInstaller::assumption_NoFinalizableSubclass(Handle assumption) { |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
637 Handle receiverType_handle = Assumptions_NoFinalizableSubclass::receiverType(assumption()); |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13156
diff
changeset
|
638 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
|
639 _dependencies->assert_has_no_finalizable_subclasses(receiverType); |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
640 } |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
641 |
3672
5e331d5f760e
removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3670
diff
changeset
|
642 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
|
643 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
|
644 Handle subtype_handle = Assumptions_ConcreteSubtype::subtype(assumption()); |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13156
diff
changeset
|
645 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
|
646 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
|
647 |
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
|
648 if (context != subtype) { |
2048
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
649 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
|
650 _dependencies->assert_abstract_with_unique_concrete_subtype(context, subtype); |
15728
22f56c3eadb7
CodeInstalled not need to assert_leaf_type when asserting abstract_with_unique_concrete_subtype
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15582
diff
changeset
|
651 } else { |
22f56c3eadb7
CodeInstalled not need to assert_leaf_type when asserting abstract_with_unique_concrete_subtype
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15582
diff
changeset
|
652 _dependencies->assert_leaf_type(subtype); |
2048
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
653 } |
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
654 } |
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2046
diff
changeset
|
655 |
3672
5e331d5f760e
removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3670
diff
changeset
|
656 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
|
657 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
|
658 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
|
659 |
3704
342a54994e05
Made C++ changes to reflect changes to CiAssumptions.ConcreteMethod.
Doug Simon <doug.simon@oracle.com>
parents:
3690
diff
changeset
|
660 methodHandle impl = getMethodFromHotSpotMethod(impl_handle()); |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13156
diff
changeset
|
661 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
|
662 |
7101
0778b04fc682
better encoding of dependencies during dependency recording by Graal
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
663 _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
|
664 } |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
665 |
8947
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
666 void CodeInstaller::assumption_CallSiteTargetValue(Handle assumption) { |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
667 Handle callSite = Assumptions_CallSiteTargetValue::callSite(assumption()); |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
668 Handle methodHandle = Assumptions_CallSiteTargetValue::methodHandle(assumption()); |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
669 |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
670 _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
|
671 } |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
8589
diff
changeset
|
672 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
673 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
|
674 // 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
|
675 const int num_handlers = 5; |
1432
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
676 GrowableArray<intptr_t>* bcis = new GrowableArray<intptr_t> (num_handlers); |
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
677 GrowableArray<intptr_t>* scope_depths = new GrowableArray<intptr_t> (num_handlers); |
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
678 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
|
679 |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
680 if (_exception_handlers != NULL) { |
1432
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
681 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
|
682 oop exc=((objArrayOop) (_exception_handlers))->obj_at(i); |
6674
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
683 jint pc_offset = CompilationResult_Site::pcOffset(exc); |
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
684 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
|
685 |
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
|
686 // 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
|
687 _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
|
688 |
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
|
689 // 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
|
690 _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
|
691 } |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
692 } |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
693 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
694 |
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
|
695 // 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
|
696 // 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
|
697 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
|
698 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
|
699 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
|
700 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
|
701 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
|
702 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
|
703 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
|
704 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
|
705 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
|
706 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
|
707 } |
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
|
708 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
|
709 } |
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
|
710 |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
711 void CodeInstaller::record_scope(jint pc_offset, oop position, GrowableArray<ScopeValue*>* objects) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
712 oop frame = NULL; |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
713 if (position->is_a(BytecodeFrame::klass())) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
714 frame = position; |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
715 } |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
716 oop caller_frame = BytecodePosition::caller(position); |
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
|
717 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
|
718 record_scope(pc_offset, caller_frame, objects); |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
719 } |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
720 |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
721 oop hotspot_method = BytecodePosition::method(position); |
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
|
722 Method* method = getMethodFromHotSpotMethod(hotspot_method); |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
723 jint bci = BytecodePosition::bci(position); |
15264
29e3ba750c9e
graalCodeInstaller translate BytecodeFrame::BEFORE_BCI into SynchronizationEntryBCI
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15180
diff
changeset
|
724 if (bci == BytecodeFrame::BEFORE_BCI()) { |
29e3ba750c9e
graalCodeInstaller translate BytecodeFrame::BEFORE_BCI into SynchronizationEntryBCI
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15180
diff
changeset
|
725 bci = SynchronizationEntryBCI; |
29e3ba750c9e
graalCodeInstaller translate BytecodeFrame::BEFORE_BCI into SynchronizationEntryBCI
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15180
diff
changeset
|
726 } |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
727 |
2901
d577d07cedec
Added time measurement for phases.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2891
diff
changeset
|
728 if (TraceGraal >= 2) { |
11248
b5f6188d79c5
minor logging improvement
Doug Simon <doug.simon@oracle.com>
parents:
10854
diff
changeset
|
729 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
|
730 } |
4853c5cad3aa
More deoptmization tracing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1936
diff
changeset
|
731 |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
732 bool reexecute = false; |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
733 if (frame != NULL) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
734 if (bci == SynchronizationEntryBCI){ |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
735 reexecute = false; |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
736 } else { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
737 Bytecodes::Code code = Bytecodes::java_code_at(method, method->bcp_from(bci)); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
738 reexecute = bytecode_should_reexecute(code); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
739 if (frame != NULL) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
740 reexecute = (BytecodeFrame::duringCall(frame) == JNI_FALSE); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
741 } |
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
|
742 } |
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
|
743 } |
3090
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3053
diff
changeset
|
744 |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
745 DebugToken* locals_token = NULL; |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
746 DebugToken* expressions_token = NULL; |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
747 DebugToken* monitors_token = NULL; |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
748 bool throw_exception = false; |
9887
4d5872186e76
Add compressed oops support in Graal/Hotspot site
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
9807
diff
changeset
|
749 |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
750 if (frame != NULL) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
751 jint local_count = BytecodeFrame::numLocals(frame); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
752 jint expression_count = BytecodeFrame::numStack(frame); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
753 jint monitor_count = BytecodeFrame::numLocks(frame); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
754 arrayOop values = (arrayOop) BytecodeFrame::values(frame); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
755 |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
756 assert(local_count + expression_count + monitor_count == values->length(), "unexpected values length"); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
757 |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
758 GrowableArray<ScopeValue*>* locals = new GrowableArray<ScopeValue*> (); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
759 GrowableArray<ScopeValue*>* expressions = new GrowableArray<ScopeValue*> (); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
760 GrowableArray<MonitorValue*>* monitors = new GrowableArray<MonitorValue*> (); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
761 |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
762 if (TraceGraal >= 2) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
763 tty->print_cr("Scope at bci %d with %d values", bci, values->length()); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
764 tty->print_cr("%d locals %d expressions, %d monitors", local_count, expression_count, monitor_count); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
765 } |
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
|
766 |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
767 for (jint i = 0; i < values->length(); i++) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
768 ScopeValue* second = NULL; |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
769 oop value=((objArrayOop) (values))->obj_at(i); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
770 if (i < local_count) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
771 ScopeValue* first = get_scope_value(value, _total_frame_size, objects, second, _oop_recorder); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
772 if (second != NULL) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
773 locals->append(second); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
774 } |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
775 locals->append(first); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
776 } else if (i < local_count + expression_count) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
777 ScopeValue* first = get_scope_value(value, _total_frame_size, objects, second, _oop_recorder); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
778 if (second != NULL) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
779 expressions->append(second); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
780 } |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
781 expressions->append(first); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
782 } else { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
783 monitors->append(get_monitor_value(value, _total_frame_size, objects, _oop_recorder)); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
784 } |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
785 if (second != NULL) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
786 i++; |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
787 assert(i < values->length(), "double-slot value not followed by Value.ILLEGAL"); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
788 assert(((objArrayOop) (values))->obj_at(i) == Value::ILLEGAL(), "double-slot value not followed by Value.ILLEGAL"); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
789 } |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
790 } |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
791 |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
792 _debug_recorder->dump_object_pool(objects); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
793 |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
794 locals_token = _debug_recorder->create_scope_values(locals); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
795 expressions_token = _debug_recorder->create_scope_values(expressions); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
796 monitors_token = _debug_recorder->create_monitor_values(monitors); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
797 |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
798 throw_exception = BytecodeFrame::rethrowException(frame) == JNI_TRUE; |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
799 } |
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
|
800 |
7933
85bd81dba8fc
Remove more code related to deferred writes.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7930
diff
changeset
|
801 _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
|
802 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
803 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
804 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
|
805 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
|
806 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
|
807 |
1432
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
808 // address instruction = _instructions->start() + pc_offset; |
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
809 // 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
|
810 _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
|
811 |
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
|
812 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
|
813 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
|
814 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
|
815 } 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
|
816 // 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
|
817 } |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
818 |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
819 _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
|
820 } |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
821 |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
822 void CodeInstaller::site_Infopoint(CodeBuffer& buffer, jint pc_offset, oop site) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
823 oop debug_info = CompilationResult_Infopoint::debugInfo(site); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
824 assert(debug_info != NULL, "debug info expected"); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
825 |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
826 _debug_recorder->add_non_safepoint(pc_offset); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
827 |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
828 oop position = DebugInfo::bytecodePosition(debug_info); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
829 if (position != NULL) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
830 record_scope(pc_offset, position, NULL); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
831 } |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
832 |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
833 _debug_recorder->end_non_safepoint(pc_offset); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
834 } |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
16520
diff
changeset
|
835 |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
836 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
|
837 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
|
838 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
|
839 |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
840 oop hotspot_method = NULL; // JavaMethod |
9740
c4b1aa93b9af
rename: HotSpotRuntimeCallTarget -> HotSpotForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9669
diff
changeset
|
841 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
|
842 |
9740
c4b1aa93b9af
rename: HotSpotRuntimeCallTarget -> HotSpotForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9669
diff
changeset
|
843 if (target_klass->is_subclass_of(SystemDictionary::HotSpotForeignCallLinkage_klass())) { |
c4b1aa93b9af
rename: HotSpotRuntimeCallTarget -> HotSpotForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9669
diff
changeset
|
844 foreign_call = target; |
3561
bea018622324
Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents:
3560
diff
changeset
|
845 } else { |
bea018622324
Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents:
3560
diff
changeset
|
846 hotspot_method = target; |
bea018622324
Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents:
3560
diff
changeset
|
847 } |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
848 |
6674
fd71ca8c5f88
VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents:
6559
diff
changeset
|
849 oop debug_info = CompilationResult_Call::debugInfo(site); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
850 |
11827
ff1d8605f354
graal code installer: minor style cleanup
Bernhard Urban <bernhard.urban@jku.at>
parents:
11760
diff
changeset
|
851 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
|
852 |
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
|
853 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
|
854 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
|
855 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
856 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
|
857 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
|
858 _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
|
859 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
|
860 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
|
861 } 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
|
862 // 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
|
863 } |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
864 } |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
865 |
9740
c4b1aa93b9af
rename: HotSpotRuntimeCallTarget -> HotSpotForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9669
diff
changeset
|
866 if (foreign_call != NULL) { |
c4b1aa93b9af
rename: HotSpotRuntimeCallTarget -> HotSpotForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9669
diff
changeset
|
867 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
|
868 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
|
869 } else { // method != NULL |
5554
70f715dfbb41
Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5553
diff
changeset
|
870 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
|
871 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
|
872 |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
873 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
|
874 CodeInstaller::pd_relocate_JavaMethod(hotspot_method, pc_offset); |
15046
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
875 if (_next_call_type == INVOKESTATIC || _next_call_type == INVOKESPECIAL) { |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
876 // Need a static call stub for transitions from compiled to interpreted. |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
877 CompiledStaticCall::emit_to_interp_stub(buffer, _instructions->start() + pc_offset); |
5c71dcf0915d
use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
15018
diff
changeset
|
878 } |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
879 } |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10810
diff
changeset
|
880 |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
881 _next_call_type = INVOKE_INVALID; |
10854
e1fcdda22831
SPARC: can compile some stubs now but they don't work yet
twisti
parents:
10810
diff
changeset
|
882 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
883 if (debug_info != NULL) { |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
884 _debug_recorder->end_safepoint(next_pc_offset); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
885 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
886 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
887 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
888 void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site) { |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
889 oop data = CompilationResult_DataPatch::data(site); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
890 if (data->is_a(MetaspaceData::klass())) { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
891 record_metadata_in_patch(data, _oop_recorder); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
892 } else if (data->is_a(OopData::klass())) { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
893 pd_patch_OopData(pc_offset, data); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
894 } else if (data->is_a(DataSectionReference::klass())) { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
895 pd_patch_DataSectionReference(pc_offset, data); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
896 } else { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14172
diff
changeset
|
897 fatal("unknown data patch type"); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
898 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
899 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
900 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
901 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
|
902 oop id_obj = CompilationResult_Mark::id(site); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
903 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
904 if (id_obj != NULL) { |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
905 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
|
906 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
|
907 |
10771 | 908 address pc = _instructions->start() + pc_offset; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
909 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
910 switch (id) { |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
911 case UNVERIFIED_ENTRY: |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
912 _offsets.set_value(CodeOffsets::Entry, pc_offset); |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
913 break; |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
914 case VERIFIED_ENTRY: |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
915 _offsets.set_value(CodeOffsets::Verified_Entry, pc_offset); |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
916 break; |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
917 case OSR_ENTRY: |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
918 _offsets.set_value(CodeOffsets::OSR_Entry, pc_offset); |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
919 break; |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
920 case EXCEPTION_HANDLER_ENTRY: |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
921 _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
|
922 break; |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
923 case DEOPT_HANDLER_ENTRY: |
1936
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1931
diff
changeset
|
924 _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
|
925 break; |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
926 case INVOKEVIRTUAL: |
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
927 case INVOKEINTERFACE: |
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
928 case INLINE_INVOKE: |
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
929 case INVOKESTATIC: |
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
930 case INVOKESPECIAL: |
1432
b61a43cd1255
sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
931 _next_call_type = (MarkId) id; |
10771 | 932 _invoke_mark_pc = pc; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
933 break; |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
934 case POLL_NEAR: |
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
935 case POLL_FAR: |
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
936 case POLL_RETURN_NEAR: |
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14562
diff
changeset
|
937 case 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
|
938 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
|
939 break; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
940 default: |
1931
48bbaead8b6c
Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1484
diff
changeset
|
941 ShouldNotReachHere(); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
942 break; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
943 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
944 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
945 } |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
946 |