comparison src/share/vm/c1x/c1x_CodeInstaller.hpp @ 1428:695451afc619

refactoring classes into separate files
author Lukas Stadler <lukas.stadler@oracle.com>
date Thu, 19 Aug 2010 14:34:52 -0700
parents
children abc670a709dc
comparison
equal deleted inserted replaced
1427:149b1d2316de 1428:695451afc619
1 /*
2 * Copyright 2000-2010 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
23 */
24
25 class CodeInstaller {
26 private:
27 // this needs to correspond to HotSpotXirGenerator.java
28 enum MarkId {
29 MARK_VERIFIED_ENTRY = 0x0001,
30 MARK_UNVERIFIED_ENTRY = 0x0002,
31 MARK_OSR_ENTRY = 0x0003,
32 MARK_STATIC_CALL_STUB = 0x1000,
33 MARK_INVOKE_INVALID = 0x2000,
34 MARK_INVOKEINTERFACE = 0x2001,
35 MARK_INVOKESTATIC = 0x2002,
36 MARK_INVOKESPECIAL = 0x2003,
37 MARK_INVOKEVIRTUAL = 0x2004,
38 MARK_IMPLICIT_NULL_EXCEPTION_TARGET = 0x3000
39 };
40
41 ciEnv* _env;
42
43 oop _citarget_method;
44 oop _hotspot_method;
45 oop _name;
46 arrayOop _sites;
47 CodeOffsets _offsets;
48
49 arrayOop _code;
50 jint _code_size;
51 jint _frame_size;
52 jint _parameter_count;
53 jint _constants_size;
54 jint _total_size;
55
56 MarkId _next_call_type;
57 address _invoke_mark_pc;
58
59 CodeSection* _instructions;
60 CodeSection* _constants;
61
62 OopRecorder* _oop_recorder;
63 DebugInformationRecorder* _debug_recorder;
64 Dependencies* _dependencies;
65
66 public:
67
68 // constructor used to create a method
69 CodeInstaller(oop target_method);
70
71 // constructor used to create a stub
72 CodeInstaller(oop target_method, jlong& id);
73
74 private:
75 void initialize_fields(oop target_method);
76
77 // perform data and call relocation on the CodeBuffer
78 void initialize_buffer(CodeBuffer& buffer);
79
80 void site_Safepoint(CodeBuffer& buffer, jint pc_offset, oop site);
81 void site_Call(CodeBuffer& buffer, jint pc_offset, oop site);
82 void site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site);
83 void site_ExceptionHandler(CodeBuffer& buffer, jint pc_offset, oop site);
84 void site_Mark(CodeBuffer& buffer, jint pc_offset, oop site);
85
86 void record_frame(jint pc_offset, oop code_pos, oop frame);
87
88 };