Fri, 12 Feb 2010 10:34:11 -0800
6926048: Improve Zero performance
Summary: Make Zero figure out result types in a similar way to C++ interpreter implementation.
Reviewed-by: kvn
Contributed-by: gbenson@redhat.com
1 /*
2 * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
3 * Copyright 2007 Red Hat, Inc.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
22 * have any questions.
23 *
24 */
26 // We have interfaces for the following instructions:
27 // - NativeInstruction
28 // - - NativeCall
29 // - - NativeMovConstReg
30 // - - NativeMovConstRegPatching
31 // - - NativeJump
32 // - - NativeIllegalOpCode
33 // - - NativeReturn
34 // - - NativeReturnX (return with argument)
35 // - - NativePushConst
36 // - - NativeTstRegMem
38 // The base class for different kinds of native instruction abstractions.
39 // Provides the primitive operations to manipulate code relative to this.
41 class NativeInstruction VALUE_OBJ_CLASS_SPEC {
42 public:
43 bool is_jump() {
44 ShouldNotCallThis();
45 }
47 bool is_safepoint_poll() {
48 ShouldNotCallThis();
49 }
50 };
52 inline NativeInstruction* nativeInstruction_at(address address) {
53 ShouldNotCallThis();
54 }
56 class NativeCall : public NativeInstruction {
57 public:
58 enum zero_specific_constants {
59 instruction_size = 0 // not used within the interpreter
60 };
62 address instruction_address() const {
63 ShouldNotCallThis();
64 }
66 address next_instruction_address() const {
67 ShouldNotCallThis();
68 }
70 address return_address() const {
71 ShouldNotCallThis();
72 }
74 address destination() const {
75 ShouldNotCallThis();
76 }
78 void set_destination_mt_safe(address dest) {
79 ShouldNotCallThis();
80 }
82 void verify_alignment() {
83 ShouldNotCallThis();
84 }
86 void verify() {
87 ShouldNotCallThis();
88 }
90 static bool is_call_before(address return_address) {
91 ShouldNotCallThis();
92 }
93 };
95 inline NativeCall* nativeCall_before(address return_address) {
96 ShouldNotCallThis();
97 }
99 inline NativeCall* nativeCall_at(address address) {
100 ShouldNotCallThis();
101 }
103 class NativeMovConstReg : public NativeInstruction {
104 public:
105 address next_instruction_address() const {
106 ShouldNotCallThis();
107 }
109 intptr_t data() const {
110 ShouldNotCallThis();
111 }
113 void set_data(intptr_t x) {
114 ShouldNotCallThis();
115 }
116 };
118 inline NativeMovConstReg* nativeMovConstReg_at(address address) {
119 ShouldNotCallThis();
120 }
122 class NativeMovRegMem : public NativeInstruction {
123 public:
124 int offset() const {
125 ShouldNotCallThis();
126 }
128 void set_offset(intptr_t x) {
129 ShouldNotCallThis();
130 }
132 void add_offset_in_bytes(int add_offset) {
133 ShouldNotCallThis();
134 }
135 };
137 inline NativeMovRegMem* nativeMovRegMem_at(address address) {
138 ShouldNotCallThis();
139 }
141 class NativeJump : public NativeInstruction {
142 public:
143 enum zero_specific_constants {
144 instruction_size = 0 // not used within the interpreter
145 };
147 address jump_destination() const {
148 ShouldNotCallThis();
149 }
151 void set_jump_destination(address dest) {
152 ShouldNotCallThis();
153 }
155 static void check_verified_entry_alignment(address entry,
156 address verified_entry) {
157 }
159 static void patch_verified_entry(address entry,
160 address verified_entry,
161 address dest);
162 };
164 inline NativeJump* nativeJump_at(address address) {
165 ShouldNotCallThis();
166 }
168 class NativeGeneralJump : public NativeInstruction {
169 public:
170 address jump_destination() const {
171 ShouldNotCallThis();
172 }
174 static void insert_unconditional(address code_pos, address entry) {
175 ShouldNotCallThis();
176 }
178 static void replace_mt_safe(address instr_addr, address code_buffer) {
179 ShouldNotCallThis();
180 }
181 };
183 inline NativeGeneralJump* nativeGeneralJump_at(address address) {
184 ShouldNotCallThis();
185 }