annotate src/share/vm/c1/c1_FrameMap.hpp @ 1721:413ad0331a0c

6977924: Changes for 6975078 produce build error with certain gcc versions Summary: The changes introduced for 6975078 assign badHeapOopVal to the _allocation field in the ResourceObj class. In 32 bit linux builds with certain versions of gcc this assignment will be flagged as an error while compiling allocation.cpp. In 32 bit builds the constant value badHeapOopVal (which is cast to an intptr_t) is negative. The _allocation field is typed as an unsigned intptr_t and gcc catches this as an error. Reviewed-by: jcoomes, ysr, phh
author johnc
date Wed, 18 Aug 2010 10:59:06 -0700
parents 126ea7725993
children f95d63e2154a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1579
jrose
parents: 1552 1564
diff changeset
2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 class ciMethod;
a61af66fc99e Initial load
duke
parents:
diff changeset
26 class CallingConvention;
a61af66fc99e Initial load
duke
parents:
diff changeset
27 class BasicTypeArray;
a61af66fc99e Initial load
duke
parents:
diff changeset
28 class BasicTypeList;
a61af66fc99e Initial load
duke
parents:
diff changeset
29
a61af66fc99e Initial load
duke
parents:
diff changeset
30 //--------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // FrameMap
a61af66fc99e Initial load
duke
parents:
diff changeset
32 //--------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 // This class is responsible of mapping items (locals, monitors, spill
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // slots and registers to their frame location
a61af66fc99e Initial load
duke
parents:
diff changeset
36 //
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // The monitors are specified by a consecutive index, although each monitor entry
a61af66fc99e Initial load
duke
parents:
diff changeset
38 // occupies two words. The monitor_index is 0.._num_monitors
a61af66fc99e Initial load
duke
parents:
diff changeset
39 // The spill index is similar to local index; it is in range 0..(open)
a61af66fc99e Initial load
duke
parents:
diff changeset
40 //
a61af66fc99e Initial load
duke
parents:
diff changeset
41 // The CPU registers are mapped using a fixed table; register with number 0
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // is the most used one.
a61af66fc99e Initial load
duke
parents:
diff changeset
43
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 // stack grow direction --> SP
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // +----------+---+----------+-------+------------------------+-----+
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // |arguments | x | monitors | spill | reserved argument area | ABI |
a61af66fc99e Initial load
duke
parents:
diff changeset
48 // +----------+---+----------+-------+------------------------+-----+
a61af66fc99e Initial load
duke
parents:
diff changeset
49 //
a61af66fc99e Initial load
duke
parents:
diff changeset
50 // x = ABI area (SPARC) or return adress and link (i486)
a61af66fc99e Initial load
duke
parents:
diff changeset
51 // ABI = ABI area (SPARC) or nothing (i486)
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53
a61af66fc99e Initial load
duke
parents:
diff changeset
54 class LIR_OprDesc;
a61af66fc99e Initial load
duke
parents:
diff changeset
55 typedef LIR_OprDesc* LIR_Opr;
a61af66fc99e Initial load
duke
parents:
diff changeset
56
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 class FrameMap : public CompilationResourceObj {
a61af66fc99e Initial load
duke
parents:
diff changeset
59 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
60 enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
61 nof_cpu_regs = pd_nof_cpu_regs_frame_map,
a61af66fc99e Initial load
duke
parents:
diff changeset
62 nof_fpu_regs = pd_nof_fpu_regs_frame_map,
a61af66fc99e Initial load
duke
parents:
diff changeset
63
a61af66fc99e Initial load
duke
parents:
diff changeset
64 nof_cpu_regs_reg_alloc = pd_nof_cpu_regs_reg_alloc,
a61af66fc99e Initial load
duke
parents:
diff changeset
65 nof_fpu_regs_reg_alloc = pd_nof_fpu_regs_reg_alloc,
a61af66fc99e Initial load
duke
parents:
diff changeset
66
a61af66fc99e Initial load
duke
parents:
diff changeset
67 nof_caller_save_cpu_regs = pd_nof_caller_save_cpu_regs_frame_map,
a61af66fc99e Initial load
duke
parents:
diff changeset
68 nof_caller_save_fpu_regs = pd_nof_caller_save_fpu_regs_frame_map,
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 spill_slot_size_in_bytes = 4
a61af66fc99e Initial load
duke
parents:
diff changeset
71 };
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 # include "incls/_c1_FrameMap_pd.hpp.incl" // platform dependent declarations
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75 friend class LIR_OprDesc;
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
78 static bool _init_done;
a61af66fc99e Initial load
duke
parents:
diff changeset
79 static Register _cpu_rnr2reg [nof_cpu_regs];
a61af66fc99e Initial load
duke
parents:
diff changeset
80 static int _cpu_reg2rnr [nof_cpu_regs];
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 static LIR_Opr _caller_save_cpu_regs [nof_caller_save_cpu_regs];
a61af66fc99e Initial load
duke
parents:
diff changeset
83 static LIR_Opr _caller_save_fpu_regs [nof_caller_save_fpu_regs];
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 int _framesize;
a61af66fc99e Initial load
duke
parents:
diff changeset
86 int _argcount;
a61af66fc99e Initial load
duke
parents:
diff changeset
87 int _num_monitors;
a61af66fc99e Initial load
duke
parents:
diff changeset
88 int _num_spills;
a61af66fc99e Initial load
duke
parents:
diff changeset
89 int _reserved_argument_area_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 int _oop_map_arg_count;
a61af66fc99e Initial load
duke
parents:
diff changeset
91
a61af66fc99e Initial load
duke
parents:
diff changeset
92 CallingConvention* _incoming_arguments;
a61af66fc99e Initial load
duke
parents:
diff changeset
93 intArray* _argument_locations;
a61af66fc99e Initial load
duke
parents:
diff changeset
94
a61af66fc99e Initial load
duke
parents:
diff changeset
95 void check_spill_index (int spill_index) const { assert(spill_index >= 0, "bad index"); }
a61af66fc99e Initial load
duke
parents:
diff changeset
96 void check_monitor_index (int monitor_index) const { assert(monitor_index >= 0 &&
a61af66fc99e Initial load
duke
parents:
diff changeset
97 monitor_index < _num_monitors, "bad index"); }
a61af66fc99e Initial load
duke
parents:
diff changeset
98
a61af66fc99e Initial load
duke
parents:
diff changeset
99 static Register cpu_rnr2reg (int rnr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
100 assert(_init_done, "tables not initialized");
a61af66fc99e Initial load
duke
parents:
diff changeset
101 debug_only(cpu_range_check(rnr);)
a61af66fc99e Initial load
duke
parents:
diff changeset
102 return _cpu_rnr2reg[rnr];
a61af66fc99e Initial load
duke
parents:
diff changeset
103 }
a61af66fc99e Initial load
duke
parents:
diff changeset
104
a61af66fc99e Initial load
duke
parents:
diff changeset
105 static int cpu_reg2rnr (Register reg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
106 assert(_init_done, "tables not initialized");
a61af66fc99e Initial load
duke
parents:
diff changeset
107 debug_only(cpu_range_check(reg->encoding());)
a61af66fc99e Initial load
duke
parents:
diff changeset
108 return _cpu_reg2rnr[reg->encoding()];
a61af66fc99e Initial load
duke
parents:
diff changeset
109 }
a61af66fc99e Initial load
duke
parents:
diff changeset
110
a61af66fc99e Initial load
duke
parents:
diff changeset
111 static void map_register(int rnr, Register reg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
112 debug_only(cpu_range_check(rnr);)
a61af66fc99e Initial load
duke
parents:
diff changeset
113 debug_only(cpu_range_check(reg->encoding());)
a61af66fc99e Initial load
duke
parents:
diff changeset
114 _cpu_rnr2reg[rnr] = reg;
a61af66fc99e Initial load
duke
parents:
diff changeset
115 _cpu_reg2rnr[reg->encoding()] = rnr;
a61af66fc99e Initial load
duke
parents:
diff changeset
116 }
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 void update_reserved_argument_area_size (int size) {
a61af66fc99e Initial load
duke
parents:
diff changeset
119 assert(size >= 0, "check");
a61af66fc99e Initial load
duke
parents:
diff changeset
120 _reserved_argument_area_size = MAX2(_reserved_argument_area_size, size);
a61af66fc99e Initial load
duke
parents:
diff changeset
121 }
a61af66fc99e Initial load
duke
parents:
diff changeset
122
a61af66fc99e Initial load
duke
parents:
diff changeset
123 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
124 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
125 static void cpu_range_check (int rnr) { assert(0 <= rnr && rnr < nof_cpu_regs, "cpu register number is too big"); }
a61af66fc99e Initial load
duke
parents:
diff changeset
126 static void fpu_range_check (int rnr) { assert(0 <= rnr && rnr < nof_fpu_regs, "fpu register number is too big"); }
a61af66fc99e Initial load
duke
parents:
diff changeset
127 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129
a61af66fc99e Initial load
duke
parents:
diff changeset
130 ByteSize sp_offset_for_monitor_base(const int idx) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
131
a61af66fc99e Initial load
duke
parents:
diff changeset
132 Address make_new_address(ByteSize sp_offset) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
133
a61af66fc99e Initial load
duke
parents:
diff changeset
134 ByteSize sp_offset_for_slot(const int idx) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
135 ByteSize sp_offset_for_double_slot(const int idx) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
136 ByteSize sp_offset_for_spill(const int idx) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
137 ByteSize sp_offset_for_monitor_lock(int monitor_index) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
138 ByteSize sp_offset_for_monitor_object(int monitor_index) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140 VMReg sp_offset2vmreg(ByteSize offset) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
141
a61af66fc99e Initial load
duke
parents:
diff changeset
142 // platform dependent hook used to check that frame is properly
a61af66fc99e Initial load
duke
parents:
diff changeset
143 // addressable on the platform. Used by sparc to verify that all
a61af66fc99e Initial load
duke
parents:
diff changeset
144 // stack addresses are expressable in a simm13.
a61af66fc99e Initial load
duke
parents:
diff changeset
145 bool validate_frame();
a61af66fc99e Initial load
duke
parents:
diff changeset
146
a61af66fc99e Initial load
duke
parents:
diff changeset
147 static LIR_Opr map_to_opr(BasicType type, VMRegPair* reg, bool incoming);
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
150 // Opr representing the stack_pointer on this platform
a61af66fc99e Initial load
duke
parents:
diff changeset
151 static LIR_Opr stack_pointer();
a61af66fc99e Initial load
duke
parents:
diff changeset
152
1564
61b2245abf36 6930772: JSR 292 needs to support SPARC C1
twisti
parents: 0
diff changeset
153 // JSR 292
61b2245abf36 6930772: JSR 292 needs to support SPARC C1
twisti
parents: 0
diff changeset
154 static LIR_Opr method_handle_invoke_SP_save_opr();
61b2245abf36 6930772: JSR 292 needs to support SPARC C1
twisti
parents: 0
diff changeset
155
0
a61af66fc99e Initial load
duke
parents:
diff changeset
156 static BasicTypeArray* signature_type_array_for(const ciMethod* method);
a61af66fc99e Initial load
duke
parents:
diff changeset
157
a61af66fc99e Initial load
duke
parents:
diff changeset
158 // for outgoing calls, these also update the reserved area to
a61af66fc99e Initial load
duke
parents:
diff changeset
159 // include space for arguments and any ABI area.
a61af66fc99e Initial load
duke
parents:
diff changeset
160 CallingConvention* c_calling_convention (const BasicTypeArray* signature);
a61af66fc99e Initial load
duke
parents:
diff changeset
161 CallingConvention* java_calling_convention (const BasicTypeArray* signature, bool outgoing);
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 // deopt support
a61af66fc99e Initial load
duke
parents:
diff changeset
164 ByteSize sp_offset_for_orig_pc() { return sp_offset_for_monitor_base(_num_monitors); }
a61af66fc99e Initial load
duke
parents:
diff changeset
165
a61af66fc99e Initial load
duke
parents:
diff changeset
166 static LIR_Opr as_opr(Register r) {
a61af66fc99e Initial load
duke
parents:
diff changeset
167 return LIR_OprFact::single_cpu(cpu_reg2rnr(r));
a61af66fc99e Initial load
duke
parents:
diff changeset
168 }
a61af66fc99e Initial load
duke
parents:
diff changeset
169 static LIR_Opr as_oop_opr(Register r) {
a61af66fc99e Initial load
duke
parents:
diff changeset
170 return LIR_OprFact::single_cpu_oop(cpu_reg2rnr(r));
a61af66fc99e Initial load
duke
parents:
diff changeset
171 }
a61af66fc99e Initial load
duke
parents:
diff changeset
172
a61af66fc99e Initial load
duke
parents:
diff changeset
173 FrameMap(ciMethod* method, int monitors, int reserved_argument_area_size);
a61af66fc99e Initial load
duke
parents:
diff changeset
174 bool finalize_frame(int nof_slots);
a61af66fc99e Initial load
duke
parents:
diff changeset
175
a61af66fc99e Initial load
duke
parents:
diff changeset
176 int reserved_argument_area_size () const { return _reserved_argument_area_size; }
a61af66fc99e Initial load
duke
parents:
diff changeset
177 int framesize () const { assert(_framesize != -1, "hasn't been calculated"); return _framesize; }
a61af66fc99e Initial load
duke
parents:
diff changeset
178 ByteSize framesize_in_bytes () const { return in_ByteSize(framesize() * 4); }
a61af66fc99e Initial load
duke
parents:
diff changeset
179 int num_monitors () const { return _num_monitors; }
a61af66fc99e Initial load
duke
parents:
diff changeset
180 int num_spills () const { assert(_num_spills >= 0, "not set"); return _num_spills; }
a61af66fc99e Initial load
duke
parents:
diff changeset
181 int argcount () const { assert(_argcount >= 0, "not set"); return _argcount; }
a61af66fc99e Initial load
duke
parents:
diff changeset
182
a61af66fc99e Initial load
duke
parents:
diff changeset
183 int oop_map_arg_count() const { return _oop_map_arg_count; }
a61af66fc99e Initial load
duke
parents:
diff changeset
184
a61af66fc99e Initial load
duke
parents:
diff changeset
185 CallingConvention* incoming_arguments() const { return _incoming_arguments; }
a61af66fc99e Initial load
duke
parents:
diff changeset
186
a61af66fc99e Initial load
duke
parents:
diff changeset
187 // convenience routines
a61af66fc99e Initial load
duke
parents:
diff changeset
188 Address address_for_slot(int index, int sp_adjust = 0) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
189 return make_new_address(sp_offset_for_slot(index) + in_ByteSize(sp_adjust));
a61af66fc99e Initial load
duke
parents:
diff changeset
190 }
a61af66fc99e Initial load
duke
parents:
diff changeset
191 Address address_for_double_slot(int index, int sp_adjust = 0) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
192 return make_new_address(sp_offset_for_double_slot(index) + in_ByteSize(sp_adjust));
a61af66fc99e Initial load
duke
parents:
diff changeset
193 }
a61af66fc99e Initial load
duke
parents:
diff changeset
194 Address address_for_monitor_lock(int monitor_index) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
195 return make_new_address(sp_offset_for_monitor_lock(monitor_index));
a61af66fc99e Initial load
duke
parents:
diff changeset
196 }
a61af66fc99e Initial load
duke
parents:
diff changeset
197 Address address_for_monitor_object(int monitor_index) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
198 return make_new_address(sp_offset_for_monitor_object(monitor_index));
a61af66fc99e Initial load
duke
parents:
diff changeset
199 }
a61af66fc99e Initial load
duke
parents:
diff changeset
200
a61af66fc99e Initial load
duke
parents:
diff changeset
201 void print_frame_layout() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
202
a61af66fc99e Initial load
duke
parents:
diff changeset
203 // Creates Location describing desired slot and returns it via pointer
a61af66fc99e Initial load
duke
parents:
diff changeset
204 // to Location object. Returns true if the stack frame offset was legal
a61af66fc99e Initial load
duke
parents:
diff changeset
205 // (as defined by Location::legal_offset_in_bytes()), false otherwise.
a61af66fc99e Initial load
duke
parents:
diff changeset
206 // Do not use the returned location if this returns false.
a61af66fc99e Initial load
duke
parents:
diff changeset
207 bool location_for_sp_offset(ByteSize byte_offset_from_sp,
a61af66fc99e Initial load
duke
parents:
diff changeset
208 Location::Type loc_type, Location* loc) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
209
a61af66fc99e Initial load
duke
parents:
diff changeset
210 bool location_for_monitor_lock (int monitor_index, Location* loc) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
211 return location_for_sp_offset(sp_offset_for_monitor_lock(monitor_index), Location::normal, loc);
a61af66fc99e Initial load
duke
parents:
diff changeset
212 }
a61af66fc99e Initial load
duke
parents:
diff changeset
213 bool location_for_monitor_object(int monitor_index, Location* loc) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
214 return location_for_sp_offset(sp_offset_for_monitor_object(monitor_index), Location::oop, loc);
a61af66fc99e Initial load
duke
parents:
diff changeset
215 }
a61af66fc99e Initial load
duke
parents:
diff changeset
216 bool locations_for_slot (int index, Location::Type loc_type,
a61af66fc99e Initial load
duke
parents:
diff changeset
217 Location* loc, Location* second = NULL) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
218
a61af66fc99e Initial load
duke
parents:
diff changeset
219 VMReg slot_regname(int index) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
220 return sp_offset2vmreg(sp_offset_for_slot(index));
a61af66fc99e Initial load
duke
parents:
diff changeset
221 }
a61af66fc99e Initial load
duke
parents:
diff changeset
222 VMReg monitor_object_regname(int monitor_index) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
223 return sp_offset2vmreg(sp_offset_for_monitor_object(monitor_index));
a61af66fc99e Initial load
duke
parents:
diff changeset
224 }
a61af66fc99e Initial load
duke
parents:
diff changeset
225 VMReg regname(LIR_Opr opr) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
226
a61af66fc99e Initial load
duke
parents:
diff changeset
227 static LIR_Opr caller_save_cpu_reg_at(int i) {
a61af66fc99e Initial load
duke
parents:
diff changeset
228 assert(i >= 0 && i < nof_caller_save_cpu_regs, "out of bounds");
a61af66fc99e Initial load
duke
parents:
diff changeset
229 return _caller_save_cpu_regs[i];
a61af66fc99e Initial load
duke
parents:
diff changeset
230 }
a61af66fc99e Initial load
duke
parents:
diff changeset
231
a61af66fc99e Initial load
duke
parents:
diff changeset
232 static LIR_Opr caller_save_fpu_reg_at(int i) {
a61af66fc99e Initial load
duke
parents:
diff changeset
233 assert(i >= 0 && i < nof_caller_save_fpu_regs, "out of bounds");
a61af66fc99e Initial load
duke
parents:
diff changeset
234 return _caller_save_fpu_regs[i];
a61af66fc99e Initial load
duke
parents:
diff changeset
235 }
a61af66fc99e Initial load
duke
parents:
diff changeset
236
1584
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1579
diff changeset
237 static void initialize();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
238 };
a61af66fc99e Initial load
duke
parents:
diff changeset
239
a61af66fc99e Initial load
duke
parents:
diff changeset
240 // CallingConvention
a61af66fc99e Initial load
duke
parents:
diff changeset
241 //--------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
242
a61af66fc99e Initial load
duke
parents:
diff changeset
243 class CallingConvention: public ResourceObj {
a61af66fc99e Initial load
duke
parents:
diff changeset
244 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
245 LIR_OprList* _args;
a61af66fc99e Initial load
duke
parents:
diff changeset
246 int _reserved_stack_slots;
a61af66fc99e Initial load
duke
parents:
diff changeset
247
a61af66fc99e Initial load
duke
parents:
diff changeset
248 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
249 CallingConvention (LIR_OprList* args, int reserved_stack_slots)
a61af66fc99e Initial load
duke
parents:
diff changeset
250 : _args(args)
a61af66fc99e Initial load
duke
parents:
diff changeset
251 , _reserved_stack_slots(reserved_stack_slots) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
252
a61af66fc99e Initial load
duke
parents:
diff changeset
253 LIR_OprList* args() { return _args; }
a61af66fc99e Initial load
duke
parents:
diff changeset
254
a61af66fc99e Initial load
duke
parents:
diff changeset
255 LIR_Opr at(int i) const { return _args->at(i); }
a61af66fc99e Initial load
duke
parents:
diff changeset
256 int length() const { return _args->length(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
257
a61af66fc99e Initial load
duke
parents:
diff changeset
258 // Indicates number of real frame slots used by arguments passed on stack.
a61af66fc99e Initial load
duke
parents:
diff changeset
259 int reserved_stack_slots() const { return _reserved_stack_slots; }
a61af66fc99e Initial load
duke
parents:
diff changeset
260
a61af66fc99e Initial load
duke
parents:
diff changeset
261 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
262 void print () const {
a61af66fc99e Initial load
duke
parents:
diff changeset
263 for (int i = 0; i < length(); i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
264 at(i)->print();
a61af66fc99e Initial load
duke
parents:
diff changeset
265 }
a61af66fc99e Initial load
duke
parents:
diff changeset
266 }
a61af66fc99e Initial load
duke
parents:
diff changeset
267 #endif // PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
268 };