annotate src/share/vm/graal/graalCodeInstaller.cpp @ 20044:c1f116cd4b67

Speed up debug info generation for virtual objects
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Fri, 27 Mar 2015 00:41:11 -0700
parents deab43a789ad
children 92fc95e8667d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2516
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
1 /*
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14029
diff changeset
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
a7a93887b4c4 fix Solaris build and initial SPARC support
twisti
parents: 7716
diff changeset
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
18173
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
55
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
56 // frequently used constants
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
57 // Allocate them with new so they are never destroyed (otherwise, a
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
58 // forced exit could destroy these objects while they are still in
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
59 // use).
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
60 ConstantOopWriteValue* CodeInstaller::_oop_null_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantOopWriteValue(NULL);
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
61 ConstantIntValue* CodeInstaller::_int_m1_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(-1);
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
62 ConstantIntValue* CodeInstaller::_int_0_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(0);
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
63 ConstantIntValue* CodeInstaller::_int_1_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(1);
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
64 ConstantIntValue* CodeInstaller::_int_2_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(2);
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
65 LocationValue* CodeInstaller::_illegal_value = new (ResourceObj::C_HEAP, mtCompiler) LocationValue(Location());
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
66
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14029
diff changeset
67 Method* getMethodFromHotSpotMethod(oop hotspot_method) {
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18196
diff changeset
68 assert(hotspot_method != NULL && hotspot_method->is_a(HotSpotResolvedJavaMethodImpl::klass()), "sanity");
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18196
diff changeset
69 return asMethod(HotSpotResolvedJavaMethodImpl::metaspaceMethod(hotspot_method));
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14029
diff changeset
70 }
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14029
diff changeset
71
5542
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
72 const int MapWordBits = 64;
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
73
18174
26d381457145 More efficient use of BitSet during install
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18173
diff changeset
74 static bool is_bit_set(typeArrayOop words, int i) {
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9192
diff changeset
75 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
76 assert(words_idx >= 0 && words_idx < words->length(), "unexpected index");
18172
c59612b9d110 Use arrayOop subclasses in graalJavaAccess
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18043
diff changeset
77 jlong word = words->long_at(words_idx);
5542
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
78 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
79 }
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
80
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
81 static int bitset_size(oop bitset) {
18172
c59612b9d110 Use arrayOop subclasses in graalJavaAccess
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18043
diff changeset
82 typeArrayOop arr = BitSet::words(bitset);
5542
e318468952f5 Remove CiBitMap and replace usages with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5326
diff changeset
83 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
84 }
52bb06250d35 Converted CiDebugInfo.registerRefMap field from type long to CiBitMap.
Doug Simon <doug.simon@oracle.com>
parents: 1468
diff changeset
85
18174
26d381457145 More efficient use of BitSet during install
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18173
diff changeset
86 static void set_vmreg_oops(OopMap* map, VMReg reg, typeArrayOop words, int idx) {
26d381457145 More efficient use of BitSet during install
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18173
diff changeset
87 bool is_oop = is_bit_set(words, 3 * idx);
16093
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
88 if (is_oop) {
18174
26d381457145 More efficient use of BitSet during install
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18173
diff changeset
89 bool narrow1 = is_bit_set(words, 3 * idx + 1);
26d381457145 More efficient use of BitSet during install
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18173
diff changeset
90 bool narrow2 = is_bit_set(words, 3 * idx + 2);
16093
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
91 if (narrow1 || narrow2) {
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
92 if (narrow1) {
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
93 map->set_narrowoop(reg);
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
94 }
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
95 if (narrow2) {
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
96 map->set_narrowoop(reg->next());
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
97 }
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
98 } else {
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
99 map->set_oop(reg);
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
100 }
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
101 } else {
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
102 map->set_value(reg);
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
103 }
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
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
106 // 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
107 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
108 OopMap* map = new OopMap(total_frame_size, parameter_count);
13725
8d8732e14447 Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 13641
diff changeset
109 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
110 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
111 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
112 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
113
1469
52bb06250d35 Converted CiDebugInfo.registerRefMap field from type long to CiBitMap.
Doug Simon <doug.simon@oracle.com>
parents: 1468
diff changeset
114 if (register_map != NULL) {
18174
26d381457145 More efficient use of BitSet during install
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18173
diff changeset
115 typeArrayOop words = BitSet::words(register_map);
7742
9f8bf17b2d33 Remove hardcoding of x86 registers in the Graal code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7735
diff changeset
116 for (jint i = 0; i < RegisterImpl::number_of_registers; i++) {
18174
26d381457145 More efficient use of BitSet during install
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18173
diff changeset
117 set_vmreg_oops(map, as_Register(i)->as_VMReg(), words, i);
16093
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
118 }
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
119 #ifdef TARGET_ARCH_x86
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
120 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
121 VMReg reg = as_XMMRegister(i)->as_VMReg();
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
122 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
123 for (jint j = 0; j < 4; j++) {
18174
26d381457145 More efficient use of BitSet during install
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18173
diff changeset
124 set_vmreg_oops(map, reg->next(2 * j), words, 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
125 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
126 }
16093
39be5bc00046 Support XMM registers in oop maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 15728
diff changeset
127 #endif
16645
8c70d65ec04a [SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16520
diff changeset
128 #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
129 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
130 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
131 int idx = RegisterImpl::number_of_registers + i;
18174
26d381457145 More efficient use of BitSet during install
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18173
diff changeset
132 set_vmreg_oops(map, reg, words, idx);
16645
8c70d65ec04a [SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16520
diff changeset
133 }
8c70d65ec04a [SPARC] Fix issues when deoptimizing with floats in local scope.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16520
diff changeset
134 #endif
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
135 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
136
18174
26d381457145 More efficient use of BitSet during install
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18173
diff changeset
137 typeArrayOop words = BitSet::words(frame_map);
26d381457145 More efficient use of BitSet during install
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18173
diff changeset
138 int size = bitset_size(frame_map) / 3;
26d381457145 More efficient use of BitSet during install
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18173
diff changeset
139 for (jint i = 0; i < size; 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
140 // 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
141 VMReg reg = VMRegImpl::stack2reg(i * VMRegImpl::slots_per_word);
18174
26d381457145 More efficient use of BitSet during install
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18173
diff changeset
142 set_vmreg_oops(map, reg, words, i);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
143 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
144
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
145 if (callee_save_info != NULL) {
18172
c59612b9d110 Use arrayOop subclasses in graalJavaAccess
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18043
diff changeset
146 objArrayOop registers = RegisterSaveLayout::registers(callee_save_info);
c59612b9d110 Use arrayOop subclasses in graalJavaAccess
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18043
diff changeset
147 typeArrayOop slots = RegisterSaveLayout::slots(callee_save_info);
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9192
diff changeset
148 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
149 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
150 jint graal_reg_number = code_Register::number(graal_reg);
17024
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16996
diff changeset
151 VMReg hotspot_reg = CodeInstaller::get_hotspot_reg(graal_reg_number);
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 // HotSpot stack slots are 4 bytes
18172
c59612b9d110 Use arrayOop subclasses in graalJavaAccess
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18043
diff changeset
153 jint graal_slot = slots->int_at(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
154 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
155 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
156 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
157 #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
158 // (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
159 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
160 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
161 #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
162 }
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 }
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
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
165 return map;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
166 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
167
18179
37be28df9dd7 fix Windows build
Christian Wirth <christian.wirth@oracle.com>
parents: 18177
diff changeset
168 static void record_metadata_reference(oop obj, jlong prim, jboolean compressed, OopRecorder* oop_recorder) {
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
169 if (obj->is_a(HotSpotResolvedObjectTypeImpl::klass())) {
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
170 Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedObjectTypeImpl::javaClass(obj));
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
171 if (compressed) {
18855
82e5b5ccdb0c fix format string
Doug Simon <doug.simon@oracle.com>
parents: 18661
diff changeset
172 assert(Klass::decode_klass((narrowKlass) prim) == klass, err_msg("%s @ " INTPTR_FORMAT " != " PTR64_FORMAT, klass->name()->as_C_string(), p2i(klass), prim));
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
173 } else {
18855
82e5b5ccdb0c fix format string
Doug Simon <doug.simon@oracle.com>
parents: 18661
diff changeset
174 assert((Klass*) prim == klass, err_msg("%s @ " INTPTR_FORMAT " != " PTR64_FORMAT, klass->name()->as_C_string(), p2i(klass), prim));
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
175 }
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
176 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
177 TRACE_graal_3("metadata[%d of %d] = %s", index, oop_recorder->metadata_count(), klass->name()->as_C_string());
18222
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18196
diff changeset
178 } else if (obj->is_a(HotSpotResolvedJavaMethodImpl::klass())) {
a8cff27ca2e1 converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18196
diff changeset
179 Method* method = (Method*) (address) HotSpotResolvedJavaMethodImpl::metaspaceMethod(obj);
18855
82e5b5ccdb0c fix format string
Doug Simon <doug.simon@oracle.com>
parents: 18661
diff changeset
180 assert(!compressed, err_msg("unexpected compressed method pointer %s @ " INTPTR_FORMAT " = " PTR64_FORMAT, method->name()->as_C_string(), p2i(method), prim));
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
181 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
182 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
183 } else {
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
184 assert(java_lang_String::is_instance(obj),
18855
82e5b5ccdb0c fix format string
Doug Simon <doug.simon@oracle.com>
parents: 18661
diff changeset
185 err_msg("unexpected metadata reference (%s) for constant " JLONG_FORMAT " (" PTR64_FORMAT ")", obj->klass()->name()->as_C_string(), prim, prim));
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
186 }
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
187 }
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
188
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
189 // Records any Metadata values embedded in a Constant (e.g., the value returned by HotSpotResolvedObjectTypeImpl.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
190 static void record_metadata_in_constant(oop constant, OopRecorder* oop_recorder) {
18266
ae181ec869c5 converted HotSpotMetaspaceConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18262
diff changeset
191 if (constant->is_a(HotSpotMetaspaceConstantImpl::klass())) {
ae181ec869c5 converted HotSpotMetaspaceConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18262
diff changeset
192 oop obj = HotSpotMetaspaceConstantImpl::metaspaceObject(constant);
ae181ec869c5 converted HotSpotMetaspaceConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18262
diff changeset
193 jlong prim = HotSpotMetaspaceConstantImpl::primitive(constant);
18319
56cc1a799a60 (re)converted Value to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18266
diff changeset
194 assert(Kind::typeChar(AbstractValue::kind(constant)) == 'j', "must have word kind");
15018
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14729
diff changeset
195 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
196 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
197
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14729
diff changeset
198 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
199 }
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
200 }
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
201
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
202 static void record_metadata_in_patch(Handle& constant, OopRecorder* oop_recorder) {
18266
ae181ec869c5 converted HotSpotMetaspaceConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18262
diff changeset
203 record_metadata_reference(HotSpotMetaspaceConstantImpl::metaspaceObject(constant), HotSpotMetaspaceConstantImpl::primitive(constant), HotSpotMetaspaceConstantImpl::compressed(constant), oop_recorder);
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
204 }
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
205
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
206 ScopeValue* CodeInstaller::get_scope_value(oop value, GrowableArray<ScopeValue*>* objects, ScopeValue* &second) {
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
207 second = NULL;
18319
56cc1a799a60 (re)converted Value to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18266
diff changeset
208 if (value == AbstractValue::ILLEGAL()) {
18173
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
209 return _illegal_value;
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
210 }
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
211
18319
56cc1a799a60 (re)converted Value to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18266
diff changeset
212 oop lirKind = AbstractValue::lirKind(value);
16580
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
213 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
214 jint referenceMask = LIRKind::referenceMask(lirKind);
19732
6a3832494e24 Check for derived pointers before passing BytecodeFrame into HotSpot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19731
diff changeset
215 assert(referenceMask != -1, "derived pointers are not allowed");
16580
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
216 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
217 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
218
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
219 BasicType type = GraalRuntime::kindToBasicType(Kind::typeChar(platformKind));
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
220
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
221 if (value->is_a(RegisterValue::klass())) {
16996
6ea6d4c260c8 [SPARC/AMD64] Fixing handling of floatingpoint register handling
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16941
diff changeset
222 oop reg = RegisterValue::reg(value);
6ea6d4c260c8 [SPARC/AMD64] Fixing handling of floatingpoint register handling
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16941
diff changeset
223 jint number = code_Register::number(reg);
17024
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16996
diff changeset
224 VMReg hotspotRegister = get_hotspot_reg(number);
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16996
diff changeset
225 if (is_general_purpose_reg(hotspotRegister)) {
16580
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
226 Location::Type locationType;
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
227 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
228 locationType = reference ? Location::narrowoop : Location::int_in_long;
16941
4e3b63e7a9f6 Fixing relock on interpreter when entering synchronized methods.
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16662
diff changeset
229 } else if(type == T_SHORT || type == T_CHAR || type == T_BYTE || type == T_BOOLEAN) {
4e3b63e7a9f6 Fixing relock on interpreter when entering synchronized methods.
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16662
diff changeset
230 locationType = Location::int_in_long;
16580
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
231 } else if (type == T_FLOAT) {
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
232 locationType = Location::int_in_long;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
233 } 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
234 locationType = reference ? Location::oop : Location::lng;
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
235 } else {
16580
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
236 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
237 locationType = Location::oop;
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
238 }
17024
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16996
diff changeset
239 ScopeValue* value = new LocationValue(Location::new_reg_loc(locationType, hotspotRegister));
16580
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
240 if (type == T_LONG && !reference) {
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
241 second = value;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
242 }
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
243 return value;
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
244 } else {
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
245 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
246 Location::Type locationType;
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
247 if (type == T_FLOAT) {
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
248 // 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
249 locationType = Location::normal;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
250 } else {
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
251 locationType = Location::dbl;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
252 }
16589
6bdd2ec553eb handle HotSpotCompressedNullConstant in graalCodeInstaller
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16580
diff changeset
253 assert(!reference, "unexpected type in floating point register");
17024
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16996
diff changeset
254 ScopeValue* value = new LocationValue(Location::new_reg_loc(locationType, hotspotRegister));
16589
6bdd2ec553eb handle HotSpotCompressedNullConstant in graalCodeInstaller
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16580
diff changeset
255 if (type == T_DOUBLE) {
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
256 second = value;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
257 }
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
258 return value;
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
259 }
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
260 } 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
261 Location::Type locationType;
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
262 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
263 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
264 } 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
265 locationType = reference ? Location::narrowoop : Location::normal;
16941
4e3b63e7a9f6 Fixing relock on interpreter when entering synchronized methods.
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16662
diff changeset
266 } else if(type == T_SHORT || type == T_CHAR || type == T_BYTE || type == T_BOOLEAN) {
4e3b63e7a9f6 Fixing relock on interpreter when entering synchronized methods.
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16662
diff changeset
267 locationType = Location::normal;
16580
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
268 } else if (type == T_FLOAT) {
16589
6bdd2ec553eb handle HotSpotCompressedNullConstant in graalCodeInstaller
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16580
diff changeset
269 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
270 locationType = Location::normal;
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
271 } else if (type == T_DOUBLE) {
16589
6bdd2ec553eb handle HotSpotCompressedNullConstant in graalCodeInstaller
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16580
diff changeset
272 assert(!reference, "unexpected type in stack slot");
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
273 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
274 } else {
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
275 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
276 locationType = Location::oop;
2938
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
277 }
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
278 jint offset = StackSlot::offset(value);
16941
4e3b63e7a9f6 Fixing relock on interpreter when entering synchronized methods.
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16662
diff changeset
279 #ifdef TARGET_ARCH_sparc
4e3b63e7a9f6 Fixing relock on interpreter when entering synchronized methods.
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16662
diff changeset
280 if(offset >= 0) {
4e3b63e7a9f6 Fixing relock on interpreter when entering synchronized methods.
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16662
diff changeset
281 offset += 128;
4e3b63e7a9f6 Fixing relock on interpreter when entering synchronized methods.
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16662
diff changeset
282 }
4e3b63e7a9f6 Fixing relock on interpreter when entering synchronized methods.
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16662
diff changeset
283 #endif
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
284 if (StackSlot::addFrameSize(value)) {
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
285 offset += _total_frame_size;
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
286 }
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
287 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
288 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
289 second = value;
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
290 }
c7783b6773ea fixed graph start frame state
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
291 return value;
18187
9619ba4daf4c Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents: 18186
diff changeset
292 } else if (value->is_a(JavaConstant::klass())){
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
293 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
294 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
295 assert(!reference, "unexpected primitive constant type");
17084
26f5733fb645 Fix the endianess issue, when using JSR/RET instruction and deoptimization happens in this subroutine
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17024
diff changeset
296 if(value->is_a(RawConstant::klass())) {
26f5733fb645 Fix the endianess issue, when using JSR/RET instruction and deoptimization happens in this subroutine
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17024
diff changeset
297 jlong prim = PrimitiveConstant::primitive(value);
26f5733fb645 Fix the endianess issue, when using JSR/RET instruction and deoptimization happens in this subroutine
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17024
diff changeset
298 return new ConstantLongValue(prim);
26f5733fb645 Fix the endianess issue, when using JSR/RET instruction and deoptimization happens in this subroutine
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17024
diff changeset
299 } else if (type == T_INT || type == T_FLOAT) {
16580
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
300 jint prim = (jint)PrimitiveConstant::primitive(value);
18173
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
301 switch (prim) {
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
302 case -1: return _int_m1_scope_value;
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
303 case 0: return _int_0_scope_value;
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
304 case 1: return _int_1_scope_value;
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
305 case 2: return _int_2_scope_value;
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
306 default: return new ConstantIntValue(prim);
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
307 }
16580
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
308 } else {
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
309 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
310 jlong prim = PrimitiveConstant::primitive(value);
18173
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
311 second = _int_1_scope_value;
16580
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
312 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
313 }
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
314 } else {
a7d9b88ecd68 use LIRKind in graalCodeInstaller, support compressed oops in frame states
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16573
diff changeset
315 assert(reference, "unexpected object constant type");
16589
6bdd2ec553eb handle HotSpotCompressedNullConstant in graalCodeInstaller
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16580
diff changeset
316 if (value->is_a(NullConstant::klass()) || value->is_a(HotSpotCompressedNullConstant::klass())) {
18173
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
317 return _oop_null_scope_value;
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
318 } else {
18262
f7d45e2426d4 converted HotSpotObjectConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18238
diff changeset
319 assert(value->is_a(HotSpotObjectConstantImpl::klass()), "unexpected constant type");
f7d45e2426d4 converted HotSpotObjectConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18238
diff changeset
320 oop obj = HotSpotObjectConstantImpl::object(value);
15018
db4254246f9a Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14729
diff changeset
321 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
322 return new ConstantOopWriteValue(JNIHandles::make_local(obj));
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
323 }
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
324 }
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
325 } 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
326 int id = VirtualObject::id(value);
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
327 ScopeValue* object = objects->at(id);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
328 assert(object != NULL, "missing value");
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
329 return object;
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
330 } else {
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
331 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
332 value->print();
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
333 }
2215
999f8086cc4f More changes to make it compile and work on win64.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 2182
diff changeset
334 ShouldNotReachHere();
999f8086cc4f More changes to make it compile and work on win64.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 2182
diff changeset
335 return NULL;
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
336 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
337
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
338 void CodeInstaller::record_object_value(ObjectValue* sv, oop value, GrowableArray<ScopeValue*>* objects) {
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
339 oop type = VirtualObject::type(value);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
340 int id = VirtualObject::id(value);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
341 oop javaMirror = HotSpotResolvedObjectTypeImpl::javaClass(type);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
342 Klass* klass = java_lang_Class::as_Klass(javaMirror);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
343 bool isLongArray = klass == Universe::longArrayKlassObj();
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
344
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
345 objArrayOop values = VirtualObject::values(value);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
346 for (jint i = 0; i < values->length(); i++) {
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
347 ScopeValue* cur_second = NULL;
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
348 oop object = values->obj_at(i);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
349 ScopeValue* value = get_scope_value(object, objects, cur_second);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
350
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
351 if (isLongArray && cur_second == NULL) {
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
352 // we're trying to put ints into a long array... this isn't really valid, but it's used for some optimizations.
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
353 // add an int 0 constant
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
354 cur_second = _int_0_scope_value;
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
355 }
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
356
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
357 if (cur_second != NULL) {
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
358 sv->field_values()->append(cur_second);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
359 }
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
360 assert(value != NULL, "missing value");
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
361 sv->field_values()->append(value);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
362 }
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
363 }
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
364
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
365 MonitorValue* CodeInstaller::get_monitor_value(oop value, GrowableArray<ScopeValue*>* objects) {
19595
b6beb2161e7a Move stack monitor value into api.code
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19426
diff changeset
366 guarantee(value->is_a(StackLockValue::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
367
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
368 ScopeValue* second = NULL;
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
369 ScopeValue* owner_value = get_scope_value(StackLockValue::owner(value), objects, second);
3714
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
370 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
371
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
372 ScopeValue* lock_data_value = get_scope_value(StackLockValue::slot(value), objects, second);
4174
79c91d220d73 Use callee save area to model the saved rbp register. Remove various hacks that added the saved area size in native code.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3717
diff changeset
373 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
374 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
375 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
376
3717
4177ddd2d1d1 Fix build error for Windows builds
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3714
diff changeset
377 bool eliminated = false;
19595
b6beb2161e7a Move stack monitor value into api.code
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19426
diff changeset
378 if (StackLockValue::eliminated(value)) {
3717
4177ddd2d1d1 Fix build error for Windows builds
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3714
diff changeset
379 eliminated = true;
4177ddd2d1d1 Fix build error for Windows builds
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3714
diff changeset
380 }
3714
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
381
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
382 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
383 }
b648304ba4ff Change Graal monitor enter and exit from BasicObjectLock to BasicLock
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3710
diff changeset
384
19306
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
385 void CodeInstaller::initialize_dependencies(oop compiled_code) {
18226
6eda3b299460 Record compilation dependencies with +LogCompilation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18196
diff changeset
386 JavaThread* thread = JavaThread::current();
6eda3b299460 Record compilation dependencies with +LogCompilation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18196
diff changeset
387 CompilerThread* compilerThread = thread->is_Compiler_thread() ? thread->as_CompilerThread() : NULL;
17375
44b83285b645 Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17335
diff changeset
388 _oop_recorder = new OopRecorder(&_arena, true);
18226
6eda3b299460 Record compilation dependencies with +LogCompilation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18196
diff changeset
389 _dependencies = new Dependencies(&_arena, _oop_recorder, compilerThread != NULL ? compilerThread->log() : NULL);
19251
063e8873bd14 changed type of assumptions field in CompilationResult from Assumptions to Assumption[]
Doug Simon <doug.simon@oracle.com>
parents: 18950
diff changeset
390 objArrayHandle assumptions = CompilationResult::assumptions(HotSpotCompiledCode::comp(compiled_code));
063e8873bd14 changed type of assumptions field in CompilationResult from Assumptions to Assumption[]
Doug Simon <doug.simon@oracle.com>
parents: 18950
diff changeset
391 if (!assumptions.is_null()) {
3670
f198b24093f3 put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3669
diff changeset
392 int length = assumptions->length();
f198b24093f3 put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3669
diff changeset
393 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
394 Handle assumption = assumptions->obj_at(i);
5e331d5f760e removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3670
diff changeset
395 if (!assumption.is_null()) {
19306
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
396 if (assumption->klass() == Assumptions_NoFinalizableSubclass::klass()) {
9012
2979aaac95af assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents: 9004
diff changeset
397 assumption_NoFinalizableSubclass(assumption);
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
398 } 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
399 assumption_ConcreteSubtype(assumption);
19796
deab43a789ad Split LeafType off from ConcreteSubtype
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19732
diff changeset
400 } else if (assumption->klass() == Assumptions_LeafType::klass()) {
deab43a789ad Split LeafType off from ConcreteSubtype
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19732
diff changeset
401 assumption_LeafType(assumption);
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
402 } 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
403 assumption_ConcreteMethod(assumption);
8947
707b20dd9512 draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents: 8589
diff changeset
404 } else if (assumption->klass() == Assumptions_CallSiteTargetValue::klass()) {
707b20dd9512 draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents: 8589
diff changeset
405 assumption_CallSiteTargetValue(assumption);
3657
47edfca346ab Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
406 } else {
47edfca346ab Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
407 assumption->print();
47edfca346ab Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
408 fatal("unexpected Assumption subclass");
47edfca346ab Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
409 }
47edfca346ab Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
410 }
47edfca346ab Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
411 }
47edfca346ab Fix a safepoint bug in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
412 }
19306
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
413 objArrayHandle methods = CompilationResult::methods(HotSpotCompiledCode::comp(compiled_code));
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
414 if (!methods.is_null()) {
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
415 int length = methods->length();
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
416 for (int i = 0; i < length; ++i) {
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
417 Handle method_handle = methods->obj_at(i);
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
418 methodHandle method = getMethodFromHotSpotMethod(method_handle());
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
419 _dependencies->assert_evol_method(method());
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
420 }
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
421 }
3668
46f211fe010c Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3667
diff changeset
422 }
46f211fe010c Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3667
diff changeset
423
46f211fe010c Removed global handle usage in ci interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3667
diff changeset
424 // 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
425 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
426 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
427 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
428 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
429 }
2e76d94f8383 propagate code-cache-full message up to Java to throw exception instead of crashing VM
twisti
parents: 11827
diff changeset
430
2e76d94f8383 propagate code-cache-full message up to Java to throw exception instead of crashing VM
twisti
parents: 11827
diff changeset
431 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
432 jobject compiled_code_obj = JNIHandles::make_local(compiled_code());
19306
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
433 initialize_dependencies(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
434
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10540
diff changeset
435 // Get instructions and constants CodeSections early because we need it.
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10540
diff changeset
436 _instructions = buffer.insts();
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10540
diff changeset
437 _constants = buffer.consts();
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10540
diff changeset
438
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
439 {
9669
ed6202820ecf renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents: 9654
diff changeset
440 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
441 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
442 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
443 }
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
444 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
445 }
6e1abd79e7c8 Register assumptions before anything else. Don't free code blob (it is reused).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3663
diff changeset
446
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
447 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
448
13493
03bb0ee05409 made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents: 13261
diff changeset
449 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
450 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
451 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
452 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
453 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
454 &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
455 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
456 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
457 _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
458 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
459 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
460 } 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
461 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
462 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
463 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
464 jint id = HotSpotCompiledNmethod::id(compiled_code);
19321
98592ae4b1fa only record method dependencies if JVMTI hotswapping or breakpointing is enabled
Doug Simon <doug.simon@oracle.com>
parents: 19306
diff changeset
465 GraalEnv* env = (GraalEnv*) (address) HotSpotCompiledNmethod::graalEnv(compiled_code);
13816
d006a6332db8 Make sure a compile id is assigned
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13726
diff changeset
466 if (id == -1) {
d006a6332db8 Make sure a compile id is assigned
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13726
diff changeset
467 // 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
468 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
469 }
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 result = GraalEnv::register_method(method, nm, entry_bci, &_offsets, _custom_stack_area_offset, &buffer, stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table,
19426
dd8989d5547f provide more detail when Graal code installation fails due to a failed dependency check
Doug Simon <doug.simon@oracle.com>
parents: 19321
diff changeset
471 GraalCompiler::instance(), _debug_recorder, _dependencies, env, id, false, installed_code, compiled_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
472 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
473 }
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10540
diff changeset
474
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10540
diff changeset
475 if (cb != NULL) {
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10540
diff changeset
476 // Make sure the pre-calculated constants section size was correct.
18238
4221c8332c34 Remove unnecessary padding in constants section.
Roland Schatz <roland.schatz@oracle.com>
parents: 18229
diff changeset
477 guarantee((cb->code_begin() - cb->content_begin()) >= _constants_size, err_msg("%d < %d", (int)(cb->code_begin() - cb->content_begin()), _constants_size));
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10540
diff changeset
478 }
13493
03bb0ee05409 made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents: 13261
diff changeset
479 return result;
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
480 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
481
9669
ed6202820ecf renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents: 9654
diff changeset
482 void CodeInstaller::initialize_fields(oop compiled_code) {
17241
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
483 Handle comp_result = HotSpotCompiledCode::comp(compiled_code);
9669
ed6202820ecf renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents: 9654
diff changeset
484 if (compiled_code->is_a(HotSpotCompiledNmethod::klass())) {
17241
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
485 Handle hotspotJavaMethod = HotSpotCompiledNmethod::method(compiled_code);
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
486 methodHandle method = getMethodFromHotSpotMethod(hotspotJavaMethod());
5839
58a607307306 renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
487 _parameter_count = method->size_of_parameters();
58a607307306 renaming in native code for CiTargetMethod -> CompilationResult
Doug Simon <doug.simon@oracle.com>
parents: 5823
diff changeset
488 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
489 } else {
9669
ed6202820ecf renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents: 9654
diff changeset
490 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
491 // 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
492 _parameter_count = 0;
3660
c805dfba251d Fixed regression.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3659
diff changeset
493 }
17335
508e88b5f1d3 Don't hang onto code install references after install finished
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17241
diff changeset
494 _sites_handle = JNIHandles::make_local(HotSpotCompiledCode::sites(compiled_code));
508e88b5f1d3 Don't hang onto code install references after install finished
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17241
diff changeset
495 _exception_handlers_handle = JNIHandles::make_local(HotSpotCompiledCode::exceptionHandlers(compiled_code));
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
496
17335
508e88b5f1d3 Don't hang onto code install references after install finished
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17241
diff changeset
497 _code_handle = JNIHandles::make_local(CompilationResult::targetCode(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 _code_size = CompilationResult::targetCodeSize(comp_result);
15180
7a9531f50cd8 renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents: 15176
diff changeset
499 _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
500 _custom_stack_area_offset = CompilationResult::customStackAreaOffset(comp_result);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
501
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10540
diff changeset
502 // Pre-calculate the constants section size. This is required for PC-relative addressing.
17335
508e88b5f1d3 Don't hang onto code install references after install finished
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17241
diff changeset
503 _data_section_handle = JNIHandles::make_local(HotSpotCompiledCode::dataSection(compiled_code));
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
504 guarantee(HotSpotCompiledCode::dataSectionAlignment(compiled_code) <= _constants->alignment(), "Alignment inside constants section is restricted by alignment of section begin");
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
505 _constants_size = data_section()->length();
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10540
diff changeset
506
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
507 _data_section_patches_handle = JNIHandles::make_local(HotSpotCompiledCode::dataSectionPatches(compiled_code));
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
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
18172
c59612b9d110 Use arrayOop subclasses in graalJavaAccess
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18043
diff changeset
510 _comments_handle = JNIHandles::make_local(HotSpotCompiledCode::comments(compiled_code));
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
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;
17241
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
519 objArrayOop sites = this->sites();
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
520 for (int i = 0; i < sites->length(); i++) {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
521 oop site = sites->obj_at(i);
15046
5c71dcf0915d use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15018
diff changeset
522 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
523 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
524 if (id_obj != NULL) {
5c71dcf0915d use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15018
diff changeset
525 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
526 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
527 if (id == INVOKESTATIC || id == INVOKESPECIAL) {
5c71dcf0915d use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15018
diff changeset
528 static_call_stubs++;
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 }
5c71dcf0915d use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15018
diff changeset
533 return static_call_stubs;
5c71dcf0915d use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15018
diff changeset
534 }
5c71dcf0915d use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15018
diff changeset
535
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
536 // 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
537 bool CodeInstaller::initialize_buffer(CodeBuffer& buffer) {
17241
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
538 HandleMark hm;
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
539 objArrayHandle sites = this->sites();
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
540 int locs_buffer_size = sites->length() * (relocInfo::length_limit + sizeof(relocInfo));
1931
48bbaead8b6c Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1484
diff changeset
541 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
542 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
543 // 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
544 // 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
545 // 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
546 // locs_buffer above.
5c71dcf0915d use hotspot static stubs for call sites
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15018
diff changeset
547 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
548 buffer.initialize_consts_size(_constants_size);
48bbaead8b6c Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1484
diff changeset
549
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
550 _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
551 _debug_recorder->set_oopmaps(new OopMapSet());
8947
707b20dd9512 draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents: 8589
diff changeset
552
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
553 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
554
18196
ff1f1481b367 Fix bug in code installer.
Roland Schatz <roland.schatz@oracle.com>
parents: 18187
diff changeset
555 // copy the constant data into the newly created CodeBuffer
ff1f1481b367 Fix bug in code installer.
Roland Schatz <roland.schatz@oracle.com>
parents: 18187
diff changeset
556 address end_data = _constants->start() + _constants_size;
ff1f1481b367 Fix bug in code installer.
Roland Schatz <roland.schatz@oracle.com>
parents: 18187
diff changeset
557 memcpy(_constants->start(), data_section()->base(T_BYTE), _constants_size);
ff1f1481b367 Fix bug in code installer.
Roland Schatz <roland.schatz@oracle.com>
parents: 18187
diff changeset
558 _constants->set_end(end_data);
ff1f1481b367 Fix bug in code installer.
Roland Schatz <roland.schatz@oracle.com>
parents: 18187
diff changeset
559
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
560 // 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
561 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
562 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
563 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
564 }
18196
ff1f1481b367 Fix bug in code installer.
Roland Schatz <roland.schatz@oracle.com>
parents: 18187
diff changeset
565 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
566 _instructions->set_end(end_pc);
18855
82e5b5ccdb0c fix format string
Doug Simon <doug.simon@oracle.com>
parents: 18661
diff changeset
567
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
568 for (int i = 0; i < data_section_patches()->length(); i++) {
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
569 Handle patch = data_section_patches()->obj_at(i);
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
570 Handle reference = CompilationResult_DataPatch::reference(patch);
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
571 assert(reference->is_a(CompilationResult_ConstantReference::klass()), err_msg("patch in data section must be a ConstantReference"));
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
572 Handle constant = CompilationResult_ConstantReference::constant(reference);
18266
ae181ec869c5 converted HotSpotMetaspaceConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18262
diff changeset
573 if (constant->is_a(HotSpotMetaspaceConstantImpl::klass())) {
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
574 record_metadata_in_patch(constant, _oop_recorder);
18262
f7d45e2426d4 converted HotSpotObjectConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18238
diff changeset
575 } else if (constant->is_a(HotSpotObjectConstantImpl::klass())) {
f7d45e2426d4 converted HotSpotObjectConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18238
diff changeset
576 Handle obj = HotSpotObjectConstantImpl::object(constant);
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
577 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
578 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
579
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
580 address dest = _constants->start() + CompilationResult_Site::pcOffset(patch);
18262
f7d45e2426d4 converted HotSpotObjectConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18238
diff changeset
581 if (HotSpotObjectConstantImpl::compressed(constant)) {
18177
89f97291c3a5 Hotspot: Support narrow oop relocations in constants section.
Roland Schatz <roland.schatz@oracle.com>
parents: 18176
diff changeset
582 #ifdef _LP64
89f97291c3a5 Hotspot: Support narrow oop relocations in constants section.
Roland Schatz <roland.schatz@oracle.com>
parents: 18176
diff changeset
583 _constants->relocate(dest, oop_Relocation::spec(oop_index), relocInfo::narrow_oop_in_const);
89f97291c3a5 Hotspot: Support narrow oop relocations in constants section.
Roland Schatz <roland.schatz@oracle.com>
parents: 18176
diff changeset
584 #else
89f97291c3a5 Hotspot: Support narrow oop relocations in constants section.
Roland Schatz <roland.schatz@oracle.com>
parents: 18176
diff changeset
585 fatal("unexpected compressed oop in 32-bit mode");
89f97291c3a5 Hotspot: Support narrow oop relocations in constants section.
Roland Schatz <roland.schatz@oracle.com>
parents: 18176
diff changeset
586 #endif
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
587 } else {
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
588 _constants->relocate(dest, oop_Relocation::spec(oop_index));
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
589 }
14729
8db730993642 check that data patches are of the expected type
Doug Simon <doug.simon@oracle.com>
parents: 14583
diff changeset
590 } else {
8db730993642 check that data patches are of the expected type
Doug Simon <doug.simon@oracle.com>
parents: 14583
diff changeset
591 ShouldNotReachHere();
13576
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 13493
diff changeset
592 }
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 13493
diff changeset
593 }
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
594 jint last_pc_offset = -1;
17241
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
595 for (int i = 0; i < sites->length(); i++) {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
596 {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
597 No_Safepoint_Verifier no_safepoint;
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
598 oop site = sites->obj_at(i);
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
599 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
600
17241
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
601 if (site->is_a(CompilationResult_Call::klass())) {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
602 TRACE_graal_4("call at %i", pc_offset);
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
603 site_Call(buffer, pc_offset, site);
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
604 } else if (site->is_a(CompilationResult_Infopoint::klass())) {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
605 // three reasons for infopoints denote actual safepoints
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
606 oop reason = CompilationResult_Infopoint::reason(site);
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
607 if (InfopointReason::SAFEPOINT() == reason || InfopointReason::CALL() == reason || InfopointReason::IMPLICIT_EXCEPTION() == reason) {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
608 TRACE_graal_4("safepoint at %i", pc_offset);
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
609 site_Safepoint(buffer, pc_offset, site);
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
610 } else {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
611 // if the infopoint is not an actual safepoint, it must have one of the other reasons
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
612 // (safeguard against new safepoint types that require handling above)
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
613 assert(InfopointReason::METHOD_START() == reason || InfopointReason::METHOD_END() == reason || InfopointReason::LINE_NUMBER() == reason, "");
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
614 site_Infopoint(buffer, pc_offset, site);
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
615 }
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
616 } else if (site->is_a(CompilationResult_DataPatch::klass())) {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
617 TRACE_graal_4("datapatch at %i", pc_offset);
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
618 site_DataPatch(buffer, pc_offset, site);
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
619 } else if (site->is_a(CompilationResult_Mark::klass())) {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
620 TRACE_graal_4("mark at %i", pc_offset);
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
621 site_Mark(buffer, pc_offset, site);
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
622 } else {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
623 fatal("unexpected Site subclass");
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
624 }
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
625 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
626 }
17241
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
627 if (CodeInstallSafepointChecks && SafepointSynchronize::do_call_back()) {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
628 // this is a hacky way to force a safepoint check but nothing else was jumping out at me.
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
629 ThreadToNativeFromVM ttnfv(JavaThread::current());
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
630 }
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
631 }
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
632
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
633 #ifndef PRODUCT
17241
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
634 if (comments() != NULL) {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
635 No_Safepoint_Verifier no_safepoint;
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
636 for (int i = 0; i < comments()->length(); i++) {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
637 oop comment = 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
638 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
639 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
640 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
641 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
642 }
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
643 }
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
644 #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
645 return true;
2048
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
646 }
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
647
9012
2979aaac95af assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents: 9004
diff changeset
648 void CodeInstaller::assumption_NoFinalizableSubclass(Handle assumption) {
2979aaac95af assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents: 9004
diff changeset
649 Handle receiverType_handle = Assumptions_NoFinalizableSubclass::receiverType(assumption());
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
650 Klass* receiverType = java_lang_Class::as_Klass(HotSpotResolvedObjectTypeImpl::javaClass(receiverType_handle));
9012
2979aaac95af assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents: 9004
diff changeset
651 _dependencies->assert_has_no_finalizable_subclasses(receiverType);
2979aaac95af assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents: 9004
diff changeset
652 }
2979aaac95af assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents: 9004
diff changeset
653
3672
5e331d5f760e removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3670
diff changeset
654 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
655 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
656 Handle subtype_handle = Assumptions_ConcreteSubtype::subtype(assumption());
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
657 Klass* context = java_lang_Class::as_Klass(HotSpotResolvedObjectTypeImpl::javaClass(context_handle));
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
658 Klass* subtype = java_lang_Class::as_Klass(HotSpotResolvedObjectTypeImpl::javaClass(subtype_handle));
2048
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
659
19796
deab43a789ad Split LeafType off from ConcreteSubtype
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19732
diff changeset
660 assert(context->is_abstract(), "");
deab43a789ad Split LeafType off from ConcreteSubtype
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19732
diff changeset
661 _dependencies->assert_abstract_with_unique_concrete_subtype(context, subtype);
deab43a789ad Split LeafType off from ConcreteSubtype
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19732
diff changeset
662 }
deab43a789ad Split LeafType off from ConcreteSubtype
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19732
diff changeset
663
deab43a789ad Split LeafType off from ConcreteSubtype
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19732
diff changeset
664 void CodeInstaller::assumption_LeafType(Handle assumption) {
deab43a789ad Split LeafType off from ConcreteSubtype
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19732
diff changeset
665 Handle context_handle = Assumptions_LeafType::context(assumption());
deab43a789ad Split LeafType off from ConcreteSubtype
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19732
diff changeset
666 Klass* context = java_lang_Class::as_Klass(HotSpotResolvedObjectTypeImpl::javaClass(context_handle));
deab43a789ad Split LeafType off from ConcreteSubtype
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19732
diff changeset
667
deab43a789ad Split LeafType off from ConcreteSubtype
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19732
diff changeset
668 _dependencies->assert_leaf_type(context);
2048
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
669 }
177398c6147d Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2046
diff changeset
670
3672
5e331d5f760e removed transition to vm in ci interface
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3670
diff changeset
671 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
672 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
673 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
674
3704
342a54994e05 Made C++ changes to reflect changes to CiAssumptions.ConcreteMethod.
Doug Simon <doug.simon@oracle.com>
parents: 3690
diff changeset
675 methodHandle impl = getMethodFromHotSpotMethod(impl_handle());
18223
17c98fad6980 converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18222
diff changeset
676 Klass* context = java_lang_Class::as_Klass(HotSpotResolvedObjectTypeImpl::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
677
7101
0778b04fc682 better encoding of dependencies during dependency recording by Graal
Doug Simon <doug.simon@oracle.com>
parents: 7094
diff changeset
678 _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
679 }
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
680
8947
707b20dd9512 draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents: 8589
diff changeset
681 void CodeInstaller::assumption_CallSiteTargetValue(Handle assumption) {
707b20dd9512 draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents: 8589
diff changeset
682 Handle callSite = Assumptions_CallSiteTargetValue::callSite(assumption());
707b20dd9512 draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents: 8589
diff changeset
683 Handle methodHandle = Assumptions_CallSiteTargetValue::methodHandle(assumption());
707b20dd9512 draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents: 8589
diff changeset
684
707b20dd9512 draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents: 8589
diff changeset
685 _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
686 }
707b20dd9512 draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents: 8589
diff changeset
687
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
688 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
689 // 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
690 const int num_handlers = 5;
1432
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
691 GrowableArray<intptr_t>* bcis = new GrowableArray<intptr_t> (num_handlers);
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
692 GrowableArray<intptr_t>* scope_depths = new GrowableArray<intptr_t> (num_handlers);
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
693 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
694
17241
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
695 if (exception_handlers() != NULL) {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
696 objArrayOop handlers = exception_handlers();
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
697 for (int i = 0; i < handlers->length(); i++) {
6fcb6691fe5f Add safepoint checks during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 17084
diff changeset
698 oop exc = handlers->obj_at(i);
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
699 jint pc_offset = CompilationResult_Site::pcOffset(exc);
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
700 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
701
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
702 // 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
703 _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
704
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
705 // 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
706 _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
707 }
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
708 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
709 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
710
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
711 // 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
712 // 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
713 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
714 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
715 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
716 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
717 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
718 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
719 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
720 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
721 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
722 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
723 }
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
724 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
725 }
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
726
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
727 GrowableArray<ScopeValue*>* CodeInstaller::record_virtual_objects(oop debug_info) {
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
728 objArrayOop virtualObjects = DebugInfo::virtualObjectMapping(debug_info);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
729 if (virtualObjects == NULL) {
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
730 return NULL;
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
731 }
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
732 GrowableArray<ScopeValue*>* objects = new GrowableArray<ScopeValue*>(virtualObjects->length(), virtualObjects->length(), NULL);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
733 // Create the unique ObjectValues
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
734 for (int i = 0; i < virtualObjects->length(); i++) {
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
735 oop value = virtualObjects->obj_at(i);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
736 int id = VirtualObject::id(value);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
737 oop type = VirtualObject::type(value);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
738 oop javaMirror = HotSpotResolvedObjectTypeImpl::javaClass(type);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
739 ObjectValue* sv = new ObjectValue(id, new ConstantOopWriteValue(JNIHandles::make_local(Thread::current(), javaMirror)));
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
740 assert(objects->at(id) == NULL, "once");
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
741 objects->at_put(id, sv);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
742 }
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
743 // All the values which could be referenced by the VirtualObjects
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
744 // exist, so now describe all the VirtualObjects themselves.
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
745 for (int i = 0; i < virtualObjects->length(); i++) {
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
746 oop value = virtualObjects->obj_at(i);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
747 int id = VirtualObject::id(value);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
748 record_object_value(objects->at(id)->as_ObjectValue(), value, objects);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
749 }
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
750 _debug_recorder->dump_object_pool(objects);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
751 return objects;
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
752 }
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
753
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
754 void CodeInstaller::record_scope(jint pc_offset, oop debug_info) {
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
755 oop position = DebugInfo::bytecodePosition(debug_info);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
756 if (position == NULL) {
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
757 // Stubs do not record scope info, just oop maps
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
758 return;
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
759 }
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
760
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
761 GrowableArray<ScopeValue*>* objectMapping = record_virtual_objects(debug_info);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
762 record_scope(pc_offset, position, objectMapping);
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
763 }
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
764
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
765 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
766 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
767 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
768 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
769 }
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 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
771 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
772 record_scope(pc_offset, caller_frame, objects);
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
773 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
774
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
775 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
776 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
777 jint bci = BytecodePosition::bci(position);
15264
29e3ba750c9e graalCodeInstaller translate BytecodeFrame::BEFORE_BCI into SynchronizationEntryBCI
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15180
diff changeset
778 if (bci == BytecodeFrame::BEFORE_BCI()) {
29e3ba750c9e graalCodeInstaller translate BytecodeFrame::BEFORE_BCI into SynchronizationEntryBCI
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15180
diff changeset
779 bci = SynchronizationEntryBCI;
29e3ba750c9e graalCodeInstaller translate BytecodeFrame::BEFORE_BCI into SynchronizationEntryBCI
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15180
diff changeset
780 }
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
781
2901
d577d07cedec Added time measurement for phases.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2891
diff changeset
782 if (TraceGraal >= 2) {
11248
b5f6188d79c5 minor logging improvement
Doug Simon <doug.simon@oracle.com>
parents: 10854
diff changeset
783 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
784 }
4853c5cad3aa More deoptmization tracing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1936
diff changeset
785
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
786 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
787 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
788 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
789 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
790 } 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
791 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
792 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
793 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
794 reexecute = (BytecodeFrame::duringCall(frame) == JNI_FALSE);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
795 }
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
796 }
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
797 }
3090
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3053
diff changeset
798
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
799 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
800 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
801 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
802 bool throw_exception = false;
9887
4d5872186e76 Add compressed oops support in Graal/Hotspot site
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9807
diff changeset
803
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
804 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
805 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
806 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
807 jint monitor_count = BytecodeFrame::numLocks(frame);
18172
c59612b9d110 Use arrayOop subclasses in graalJavaAccess
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18043
diff changeset
808 objArrayOop values = BytecodeFrame::values(frame);
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
809
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
810 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
811
18173
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
812 GrowableArray<ScopeValue*>* locals = local_count > 0 ? new GrowableArray<ScopeValue*> (local_count) : NULL;
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
813 GrowableArray<ScopeValue*>* expressions = expression_count > 0 ? new GrowableArray<ScopeValue*> (expression_count) : NULL;
8c079b8d0446 Reduce allocation during scope recording
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18172
diff changeset
814 GrowableArray<MonitorValue*>* monitors = monitor_count > 0 ? new GrowableArray<MonitorValue*> (monitor_count) : NULL;
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
815
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
816 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
817 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
818 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
819 }
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
820
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
821 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
822 ScopeValue* second = NULL;
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
823 oop value = values->obj_at(i);
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
824 if (i < local_count) {
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
825 ScopeValue* first = get_scope_value(value, objects, second);
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
826 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
827 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
828 }
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 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
830 } else if (i < local_count + expression_count) {
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
831 ScopeValue* first = get_scope_value(value, objects, second);
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
832 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
833 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
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 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
836 } else {
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
837 monitors->append(get_monitor_value(value, objects));
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
838 }
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
839 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
840 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
841 assert(i < values->length(), "double-slot value not followed by Value.ILLEGAL");
18319
56cc1a799a60 (re)converted Value to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18266
diff changeset
842 assert(values->obj_at(i) == AbstractValue::ILLEGAL(), "double-slot value not followed by Value.ILLEGAL");
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
843 }
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
844 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
845
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
846 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
847 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
848 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
849
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
850 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
851 }
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
852
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
853 _debug_recorder->describe_scope(pc_offset, method, NULL, bci, reexecute, throw_exception, false, false,
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
854 locals_token, expressions_token, monitors_token);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
855 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
856
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
857 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
858 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
859 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
860
1432
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
861 // address instruction = _instructions->start() + pc_offset;
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
862 // 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
863 _debug_recorder->add_safepoint(pc_offset, create_oop_map(_total_frame_size, _parameter_count, debug_info));
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
864 record_scope(pc_offset, debug_info);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
865 _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
866 }
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
867
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
868 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
869 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
870 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
871
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
872 _debug_recorder->add_non_safepoint(pc_offset);
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
873 record_scope(pc_offset, debug_info);
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
874 _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
875 }
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
876
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
877 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
878 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
879 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
880
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
881 oop hotspot_method = NULL; // JavaMethod
9740
c4b1aa93b9af rename: HotSpotRuntimeCallTarget -> HotSpotForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents: 9669
diff changeset
882 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
883
18350
23a2faa68470 converted HotSpotForeignCallLinkage to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18319
diff changeset
884 if (target_klass->is_subclass_of(SystemDictionary::HotSpotForeignCallLinkageImpl_klass())) {
9740
c4b1aa93b9af rename: HotSpotRuntimeCallTarget -> HotSpotForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents: 9669
diff changeset
885 foreign_call = target;
3561
bea018622324 Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 3560
diff changeset
886 } else {
bea018622324 Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 3560
diff changeset
887 hotspot_method = target;
bea018622324 Changes to JavaAccess as a result of CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 3560
diff changeset
888 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
889
6674
fd71ca8c5f88 VM infrstructure for OnStackReplacement
Lukas Stadler <lukas.stadler@jku.at>
parents: 6559
diff changeset
890 oop debug_info = CompilationResult_Call::debugInfo(site);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
891
11827
ff1d8605f354 graal code installer: minor style cleanup
Bernhard Urban <bernhard.urban@jku.at>
parents: 11760
diff changeset
892 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
893
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
894 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
895 jint next_pc_offset = CodeInstaller::pd_next_offset(inst, pc_offset, hotspot_method);
18855
82e5b5ccdb0c fix format string
Doug Simon <doug.simon@oracle.com>
parents: 18661
diff changeset
896
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
897 if (debug_info != NULL) {
7660
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7154
diff changeset
898 _debug_recorder->add_safepoint(next_pc_offset, create_oop_map(_total_frame_size, _parameter_count, debug_info));
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19796
diff changeset
899 record_scope(next_pc_offset, debug_info);
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
900 }
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
901
9740
c4b1aa93b9af rename: HotSpotRuntimeCallTarget -> HotSpotForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents: 9669
diff changeset
902 if (foreign_call != NULL) {
18350
23a2faa68470 converted HotSpotForeignCallLinkage to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18319
diff changeset
903 jlong foreign_call_destination = HotSpotForeignCallLinkageImpl::address(foreign_call);
9934
0f7ca53be929 CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents: 9891
diff changeset
904 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
905 } else { // method != NULL
5554
70f715dfbb41 Bring Java renamings and restructurings to the C++ part.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5553
diff changeset
906 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
907 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
908
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
909 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
910 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
911 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
912 // 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
913 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
914 }
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
915 }
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10810
diff changeset
916
14574
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
917 _next_call_type = INVOKE_INVALID;
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10810
diff changeset
918
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
919 if (debug_info != NULL) {
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
920 _debug_recorder->end_safepoint(next_pc_offset);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
921 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
922 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
923
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
924 void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site) {
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
925 oop reference = CompilationResult_DataPatch::reference(site);
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
926 if (reference->is_a(CompilationResult_ConstantReference::klass())) {
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
927 Handle constant = CompilationResult_ConstantReference::constant(reference);
18262
f7d45e2426d4 converted HotSpotObjectConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18238
diff changeset
928 if (constant->is_a(HotSpotObjectConstantImpl::klass())) {
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
929 pd_patch_OopConstant(pc_offset, constant);
18266
ae181ec869c5 converted HotSpotMetaspaceConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents: 18262
diff changeset
930 } else if (constant->is_a(HotSpotMetaspaceConstantImpl::klass())) {
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
931 record_metadata_in_patch(constant, _oop_recorder);
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
932 } else {
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
933 fatal("unknown constant type in data patch");
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
934 }
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
935 } else if (reference->is_a(CompilationResult_DataSectionReference::klass())) {
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
936 int data_offset = CompilationResult_DataSectionReference::offset(reference);
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
937 assert(0 <= data_offset && data_offset < _constants_size, err_msg("data offset 0x%X points outside data section (size 0x%X)", data_offset, _constants_size));
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 18174
diff changeset
938 pd_patch_DataSectionReference(pc_offset, data_offset);
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
939 } else {
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14172
diff changeset
940 fatal("unknown data patch type");
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
941 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
942 }
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 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
945 oop id_obj = CompilationResult_Mark::id(site);
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
946
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
947 if (id_obj != NULL) {
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
948 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
949 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
950
10771
ec8ee1c2ad7a Move non_oop_bits value up to Graal.
twisti
parents: 10684
diff changeset
951 address pc = _instructions->start() + pc_offset;
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
952
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
953 switch (id) {
14574
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
954 case UNVERIFIED_ENTRY:
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
955 _offsets.set_value(CodeOffsets::Entry, pc_offset);
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
956 break;
14574
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
957 case VERIFIED_ENTRY:
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
958 _offsets.set_value(CodeOffsets::Verified_Entry, pc_offset);
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
959 break;
14574
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
960 case OSR_ENTRY:
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
961 _offsets.set_value(CodeOffsets::OSR_Entry, pc_offset);
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
962 break;
14574
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
963 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
964 _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
965 break;
14574
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
966 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
967 _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
968 break;
14574
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
969 case INVOKEVIRTUAL:
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
970 case INVOKEINTERFACE:
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
971 case INLINE_INVOKE:
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
972 case INVOKESTATIC:
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
973 case INVOKESPECIAL:
1432
b61a43cd1255 sourcecode formatting
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
974 _next_call_type = (MarkId) id;
10771
ec8ee1c2ad7a Move non_oop_bits value up to Graal.
twisti
parents: 10684
diff changeset
975 _invoke_mark_pc = pc;
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
976 break;
14574
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
977 case POLL_NEAR:
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
978 case POLL_FAR:
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
979 case POLL_RETURN_NEAR:
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14562
diff changeset
980 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
981 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
982 break;
18661
aa4f2e3629ca Added card table PIC support
adlertz
parents: 18350
diff changeset
983 case CARD_TABLE_SHIFT:
aa4f2e3629ca Added card table PIC support
adlertz
parents: 18350
diff changeset
984 case CARD_TABLE_ADDRESS:
aa4f2e3629ca Added card table PIC support
adlertz
parents: 18350
diff changeset
985 break;
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
986 default:
1931
48bbaead8b6c Adjustments after merge with OpenJDK repository.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1484
diff changeset
987 ShouldNotReachHere();
1428
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
988 break;
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
989 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
990 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
991 }
695451afc619 refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
992