Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalCodeInstaller.hpp @ 2890:c23d45daff9b
Renamed cpp/hpp file directory.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 08 Jun 2011 13:40:25 +0200 |
parents | src/share/vm/c1x/graalCodeInstaller.hpp@2fb867285938 |
children | 536528f48708 |
comparison
equal
deleted
inserted
replaced
2889:2fb867285938 | 2890:c23d45daff9b |
---|---|
1 /* | |
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. | |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 * or visit www.oracle.com if you need additional information or have any | |
21 * questions. | |
22 */ | |
23 | |
24 /* | |
25 * This class handles the conversion from a CiTargetMethod to a CodeBlob or an nmethod. | |
26 */ | |
27 class CodeInstaller { | |
28 private: | |
29 // these need to correspond to HotSpotXirGenerator.java | |
30 enum MarkId { | |
31 MARK_VERIFIED_ENTRY = 0x0001, | |
32 MARK_UNVERIFIED_ENTRY = 0x0002, | |
33 MARK_OSR_ENTRY = 0x0003, | |
34 MARK_UNWIND_ENTRY = 0x0004, | |
35 MARK_EXCEPTION_HANDLER_ENTRY = 0x0005, | |
36 MARK_DEOPT_HANDLER_ENTRY = 0x0006, | |
37 MARK_STATIC_CALL_STUB = 0x1000, | |
38 MARK_INVOKE_INVALID = 0x2000, | |
39 MARK_INVOKEINTERFACE = 0x2001, | |
40 MARK_INVOKESTATIC = 0x2002, | |
41 MARK_INVOKESPECIAL = 0x2003, | |
42 MARK_INVOKEVIRTUAL = 0x2004, | |
43 MARK_IMPLICIT_NULL = 0x3000, | |
44 MARK_KLASS_PATCHING = 0x4000, | |
45 MARK_DUMMY_OOP_RELOCATION = 0x4001, | |
46 MARK_ACCESS_FIELD_PATCHING = 0x4002 | |
47 }; | |
48 | |
49 ciEnv* _env; | |
50 | |
51 oop _citarget_method; | |
52 oop _hotspot_method; | |
53 oop _name; | |
54 arrayOop _sites; | |
55 arrayOop _assumptions; | |
56 arrayOop _exception_handlers; | |
57 CodeOffsets _offsets; | |
58 | |
59 arrayOop _code; | |
60 jint _code_size; | |
61 jint _frame_size; | |
62 jint _custom_stack_area_offset; | |
63 jint _parameter_count; | |
64 jint _constants_size; | |
65 jint _total_size; | |
66 | |
67 MarkId _next_call_type; | |
68 address _invoke_mark_pc; | |
69 | |
70 CodeSection* _instructions; | |
71 CodeSection* _constants; | |
72 | |
73 OopRecorder* _oop_recorder; | |
74 DebugInformationRecorder* _debug_recorder; | |
75 Dependencies* _dependencies; | |
76 ExceptionHandlerTable _exception_handler_table; | |
77 ImplicitExceptionTable _implicit_exception_table; | |
78 | |
79 public: | |
80 | |
81 // constructor used to create a method | |
82 CodeInstaller(Handle target_method); | |
83 | |
84 // constructor used to create a stub | |
85 CodeInstaller(Handle target_method, jlong& id); | |
86 | |
87 private: | |
88 // extract the fields of the CiTargetMethod | |
89 void initialize_fields(Handle target_method); | |
90 | |
91 // perform data and call relocation on the CodeBuffer | |
92 void initialize_buffer(CodeBuffer& buffer); | |
93 | |
94 void assumption_ConcreteSubtype(oop assumption); | |
95 void assumption_ConcreteMethod(oop assumption); | |
96 | |
97 void site_Safepoint(CodeBuffer& buffer, jint pc_offset, oop site); | |
98 void site_Call(CodeBuffer& buffer, jint pc_offset, oop site); | |
99 void site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site); | |
100 void site_Mark(CodeBuffer& buffer, jint pc_offset, oop site); | |
101 | |
102 void record_scope(jint pc_offset, oop code_pos); | |
103 | |
104 void process_exception_handlers(); | |
105 | |
106 }; |