Mercurial > hg > graal-compiler
annotate src/share/vm/graal/graalCodeInstaller.hpp @ 3549:25765a764212
Add support for polling mark in code installer
author | Gilles Duboscq <gilles.duboscq@oracle.com> |
---|---|
date | Fri, 19 Aug 2011 17:28:37 +0200 |
parents | 536528f48708 |
children | aee1479c0a4b |
rev | line source |
---|---|
2516
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
1 /* |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
4 * |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
7 * published by the Free Software Foundation. |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
8 * |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
13 * accompanied this code). |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
14 * |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
18 * |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
a384fac3fd34
Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2502
diff
changeset
|
21 * questions. |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
22 */ |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
23 |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
24 /* |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
25 * This class handles the conversion from a CiTargetMethod to a CodeBlob or an nmethod. |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
26 */ |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
27 class CodeInstaller { |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
28 private: |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
29 // these need to correspond to HotSpotXirGenerator.java |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
30 enum MarkId { |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
31 MARK_VERIFIED_ENTRY = 0x0001, |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
32 MARK_UNVERIFIED_ENTRY = 0x0002, |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
33 MARK_OSR_ENTRY = 0x0003, |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
34 MARK_UNWIND_ENTRY = 0x0004, |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
35 MARK_EXCEPTION_HANDLER_ENTRY = 0x0005, |
1936
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1447
diff
changeset
|
36 MARK_DEOPT_HANDLER_ENTRY = 0x0006, |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
37 MARK_STATIC_CALL_STUB = 0x1000, |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
38 MARK_INVOKE_INVALID = 0x2000, |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
39 MARK_INVOKEINTERFACE = 0x2001, |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
40 MARK_INVOKESTATIC = 0x2002, |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
41 MARK_INVOKESPECIAL = 0x2003, |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
42 MARK_INVOKEVIRTUAL = 0x2004, |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
43 MARK_IMPLICIT_NULL = 0x3000, |
3549
25765a764212
Add support for polling mark in code installer
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3090
diff
changeset
|
44 MARK_POLL = 0x3001, |
25765a764212
Add support for polling mark in code installer
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3090
diff
changeset
|
45 MARK_POLL_RETURN = 0x3002, |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
46 MARK_KLASS_PATCHING = 0x4000, |
1433
efba53f86c4f
various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1432
diff
changeset
|
47 MARK_DUMMY_OOP_RELOCATION = 0x4001, |
efba53f86c4f
various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1432
diff
changeset
|
48 MARK_ACCESS_FIELD_PATCHING = 0x4002 |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
49 }; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
50 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
51 ciEnv* _env; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
52 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
53 oop _citarget_method; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
54 oop _hotspot_method; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
55 oop _name; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
56 arrayOop _sites; |
2048
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1938
diff
changeset
|
57 arrayOop _assumptions; |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
58 arrayOop _exception_handlers; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
59 CodeOffsets _offsets; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
60 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
61 arrayOop _code; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
62 jint _code_size; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
63 jint _frame_size; |
1938
1aa5b22a7716
Support for custom stack area (needed for deoptimization).
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1936
diff
changeset
|
64 jint _custom_stack_area_offset; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
65 jint _parameter_count; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
66 jint _constants_size; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
67 jint _total_size; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
68 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
69 MarkId _next_call_type; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
70 address _invoke_mark_pc; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
71 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
72 CodeSection* _instructions; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
73 CodeSection* _constants; |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
74 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
75 OopRecorder* _oop_recorder; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
76 DebugInformationRecorder* _debug_recorder; |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
77 Dependencies* _dependencies; |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
78 ExceptionHandlerTable _exception_handler_table; |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
79 ImplicitExceptionTable _implicit_exception_table; |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
80 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
81 public: |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
82 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
83 // constructor used to create a method |
1938
1aa5b22a7716
Support for custom stack area (needed for deoptimization).
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1936
diff
changeset
|
84 CodeInstaller(Handle target_method); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
85 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
86 // constructor used to create a stub |
1938
1aa5b22a7716
Support for custom stack area (needed for deoptimization).
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1936
diff
changeset
|
87 CodeInstaller(Handle target_method, jlong& id); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
88 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
89 private: |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1433
diff
changeset
|
90 // extract the fields of the CiTargetMethod |
1938
1aa5b22a7716
Support for custom stack area (needed for deoptimization).
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1936
diff
changeset
|
91 void initialize_fields(Handle target_method); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
92 |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
93 // perform data and call relocation on the CodeBuffer |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
94 void initialize_buffer(CodeBuffer& buffer); |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
95 |
2048
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1938
diff
changeset
|
96 void assumption_ConcreteSubtype(oop assumption); |
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1938
diff
changeset
|
97 void assumption_ConcreteMethod(oop assumption); |
177398c6147d
Added unique concrete subtype assumption.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1938
diff
changeset
|
98 |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
99 void site_Safepoint(CodeBuffer& buffer, jint pc_offset, oop site); |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
100 void site_Call(CodeBuffer& buffer, jint pc_offset, oop site); |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
101 void site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site); |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
102 void site_Mark(CodeBuffer& buffer, jint pc_offset, oop site); |
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
103 |
3090
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
2890
diff
changeset
|
104 void record_scope(jint pc_offset, oop code_pos, GrowableArray<ScopeValue*>* objects); |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
105 |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
106 void process_exception_handlers(); |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
107 |
1428
695451afc619
refactoring classes into separate files
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
108 }; |