Mercurial > hg > graal-compiler
annotate src/share/vm/opto/generateOptoStub.cpp @ 21814:5f07d936a14e
8058982: Better verification of an exceptional invokespecial
Summary: Throw VerifyError for illegal accesses
Reviewed-by: acorn, ahgross, coleenp
author | hseigel |
---|---|
date | Mon, 20 Oct 2014 15:14:56 -0400 |
parents | a9becfeecd1b |
children | 4ca6dc0799b6 |
rev | line source |
---|---|
0 | 1 /* |
17467
55fb97c4c58d
8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents:
12158
diff
changeset
|
2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
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 | 22 * |
23 */ | |
24 | |
1972 | 25 #include "precompiled.hpp" |
26 #include "opto/addnode.hpp" | |
27 #include "opto/callnode.hpp" | |
28 #include "opto/cfgnode.hpp" | |
29 #include "opto/compile.hpp" | |
30 #include "opto/connode.hpp" | |
31 #include "opto/locknode.hpp" | |
32 #include "opto/memnode.hpp" | |
33 #include "opto/mulnode.hpp" | |
34 #include "opto/node.hpp" | |
35 #include "opto/parse.hpp" | |
36 #include "opto/phaseX.hpp" | |
37 #include "opto/rootnode.hpp" | |
38 #include "opto/runtime.hpp" | |
39 #include "opto/type.hpp" | |
0 | 40 |
41 //--------------------gen_stub------------------------------- | |
42 void GraphKit::gen_stub(address C_function, | |
43 const char *name, | |
44 int is_fancy_jump, | |
45 bool pass_tls, | |
46 bool return_pc) { | |
47 ResourceMark rm; | |
48 | |
49 const TypeTuple *jdomain = C->tf()->domain(); | |
50 const TypeTuple *jrange = C->tf()->range(); | |
51 | |
52 // The procedure start | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
53 StartNode* start = new (C) StartNode(root(), jdomain); |
0 | 54 _gvn.set_type_bottom(start); |
55 | |
56 // Make a map, with JVM state | |
57 uint parm_cnt = jdomain->cnt(); | |
58 uint max_map = MAX2(2*parm_cnt+1, jrange->cnt()); | |
59 // %%% SynchronizationEntryBCI is redundant; use InvocationEntryBci in interfaces | |
60 assert(SynchronizationEntryBCI == InvocationEntryBci, ""); | |
61 JVMState* jvms = new (C) JVMState(0); | |
62 jvms->set_bci(InvocationEntryBci); | |
63 jvms->set_monoff(max_map); | |
12158
766fac3395d6
8012972: Incremental Inlining should support scalar replaced object in debug info
kvn
parents:
7994
diff
changeset
|
64 jvms->set_scloff(max_map); |
0 | 65 jvms->set_endoff(max_map); |
66 { | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
67 SafePointNode *map = new (C) SafePointNode( max_map, jvms ); |
0 | 68 jvms->set_map(map); |
69 set_jvms(jvms); | |
70 assert(map == this->map(), "kit.map is set"); | |
71 } | |
72 | |
73 // Make up the parameters | |
74 uint i; | |
75 for( i = 0; i < parm_cnt; i++ ) | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
76 map()->init_req(i, _gvn.transform(new (C) ParmNode(start, i))); |
0 | 77 for( ; i<map()->req(); i++ ) |
78 map()->init_req(i, top()); // For nicer debugging | |
79 | |
80 // GraphKit requires memory to be a MergeMemNode: | |
81 set_all_memory(map()->memory()); | |
82 | |
83 // Get base of thread-local storage area | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
84 Node* thread = _gvn.transform( new (C) ThreadLocalNode() ); |
0 | 85 |
86 const int NoAlias = Compile::AliasIdxBot; | |
87 | |
88 Node* adr_last_Java_pc = basic_plus_adr(top(), | |
89 thread, | |
90 in_bytes(JavaThread::frame_anchor_offset()) + | |
91 in_bytes(JavaFrameAnchor::last_Java_pc_offset())); | |
7994 | 92 #if defined(SPARC) |
0 | 93 Node* adr_flags = basic_plus_adr(top(), |
94 thread, | |
95 in_bytes(JavaThread::frame_anchor_offset()) + | |
96 in_bytes(JavaFrameAnchor::flags_offset())); | |
7994 | 97 #endif /* defined(SPARC) */ |
0 | 98 |
99 | |
100 // Drop in the last_Java_sp. last_Java_fp is not touched. | |
101 // Always do this after the other "last_Java_frame" fields are set since | |
102 // as soon as last_Java_sp != NULL the has_last_Java_frame is true and | |
103 // users will look at the other fields. | |
104 // | |
105 Node *adr_sp = basic_plus_adr(top(), thread, in_bytes(JavaThread::last_Java_sp_offset())); | |
106 Node *last_sp = basic_plus_adr(top(), frameptr(), (intptr_t) STACK_BIAS); | |
14429
2113136690bc
8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering
goetz
parents:
14422
diff
changeset
|
107 store_to_memory(NULL, adr_sp, last_sp, T_ADDRESS, NoAlias, MemNode::unordered); |
0 | 108 |
109 // Set _thread_in_native | |
110 // The order of stores into TLS is critical! Setting _thread_in_native MUST | |
111 // be last, because a GC is allowed at any time after setting it and the GC | |
112 // will require last_Java_pc and last_Java_sp. | |
113 | |
114 //----------------------------- | |
115 // Compute signature for C call. Varies from the Java signature! | |
116 const Type **fields = TypeTuple::fields(2*parm_cnt+2); | |
117 uint cnt = TypeFunc::Parms; | |
118 // The C routines gets the base of thread-local storage passed in as an | |
119 // extra argument. Not all calls need it, but its cheap to add here. | |
14418
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
120 for (uint pcnt = cnt; pcnt < parm_cnt; pcnt++, cnt++) { |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
121 // Convert ints to longs if required. |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
122 if (CCallingConventionRequiresIntsAsLongs && jdomain->field_at(pcnt)->isa_int()) { |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
123 fields[cnt++] = TypeLong::LONG; |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
124 fields[cnt] = Type::HALF; // must add an additional half for a long |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
125 } else { |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
126 fields[cnt] = jdomain->field_at(pcnt); |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
127 } |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
128 } |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
129 |
0 | 130 fields[cnt++] = TypeRawPtr::BOTTOM; // Thread-local storage |
131 // Also pass in the caller's PC, if asked for. | |
132 if( return_pc ) | |
133 fields[cnt++] = TypeRawPtr::BOTTOM; // Return PC | |
134 | |
135 const TypeTuple* domain = TypeTuple::make(cnt,fields); | |
136 // The C routine we are about to call cannot return an oop; it can block on | |
137 // exit and a GC will trash the oop while it sits in C-land. Instead, we | |
138 // return the oop through TLS for runtime calls. | |
139 // Also, C routines returning integer subword values leave the high | |
140 // order bits dirty; these must be cleaned up by explicit sign extension. | |
141 const Type* retval = (jrange->cnt() == TypeFunc::Parms) ? Type::TOP : jrange->field_at(TypeFunc::Parms); | |
142 // Make a private copy of jrange->fields(); | |
143 const Type **rfields = TypeTuple::fields(jrange->cnt() - TypeFunc::Parms); | |
144 // Fixup oop returns | |
145 int retval_ptr = retval->isa_oop_ptr(); | |
146 if( retval_ptr ) { | |
147 assert( pass_tls, "Oop must be returned thru TLS" ); | |
148 // Fancy-jumps return address; others return void | |
149 rfields[TypeFunc::Parms] = is_fancy_jump ? TypeRawPtr::BOTTOM : Type::TOP; | |
150 | |
151 } else if( retval->isa_int() ) { // Returning any integer subtype? | |
152 // "Fatten" byte, char & short return types to 'int' to show that | |
153 // the native C code can return values with junk high order bits. | |
154 // We'll sign-extend it below later. | |
155 rfields[TypeFunc::Parms] = TypeInt::INT; // It's "dirty" and needs sign-ext | |
156 | |
157 } else if( jrange->cnt() >= TypeFunc::Parms+1 ) { // Else copy other types | |
158 rfields[TypeFunc::Parms] = jrange->field_at(TypeFunc::Parms); | |
159 if( jrange->cnt() == TypeFunc::Parms+2 ) | |
160 rfields[TypeFunc::Parms+1] = jrange->field_at(TypeFunc::Parms+1); | |
161 } | |
162 const TypeTuple* range = TypeTuple::make(jrange->cnt(),rfields); | |
163 | |
164 // Final C signature | |
165 const TypeFunc *c_sig = TypeFunc::make(domain,range); | |
166 | |
167 //----------------------------- | |
168 // Make the call node | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
169 CallRuntimeNode *call = new (C) |
0 | 170 CallRuntimeNode(c_sig, C_function, name, TypePtr::BOTTOM); |
171 //----------------------------- | |
172 | |
173 // Fix-up the debug info for the call | |
174 call->set_jvms( new (C) JVMState(0) ); | |
175 call->jvms()->set_bci(0); | |
176 call->jvms()->set_offsets(cnt); | |
177 | |
178 // Set fixed predefined input arguments | |
179 cnt = 0; | |
14418
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
180 for (i = 0; i < TypeFunc::Parms; i++) |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
181 call->init_req(cnt++, map()->in(i)); |
0 | 182 // A little too aggressive on the parm copy; return address is not an input |
183 call->set_req(TypeFunc::ReturnAdr, top()); | |
14418
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
184 for (; i < parm_cnt; i++) { // Regular input arguments |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
185 // Convert ints to longs if required. |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
186 if (CCallingConventionRequiresIntsAsLongs && jdomain->field_at(i)->isa_int()) { |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
187 Node* int_as_long = _gvn.transform(new (C) ConvI2LNode(map()->in(i))); |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
188 call->init_req(cnt++, int_as_long); // long |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
189 call->init_req(cnt++, top()); // half |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
190 } else { |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
191 call->init_req(cnt++, map()->in(i)); |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
192 } |
cfd05ec74089
8024342: PPC64 (part 111): Support for C calling conventions that require 64-bit ints.
goetz
parents:
14403
diff
changeset
|
193 } |
0 | 194 |
195 call->init_req( cnt++, thread ); | |
196 if( return_pc ) // Return PC, if asked for | |
197 call->init_req( cnt++, returnadr() ); | |
198 _gvn.transform_no_reclaim(call); | |
199 | |
200 | |
201 //----------------------------- | |
202 // Now set up the return results | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
203 set_control( _gvn.transform( new (C) ProjNode(call,TypeFunc::Control)) ); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
204 set_i_o( _gvn.transform( new (C) ProjNode(call,TypeFunc::I_O )) ); |
0 | 205 set_all_memory_call(call); |
206 if (range->cnt() > TypeFunc::Parms) { | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
207 Node* retnode = _gvn.transform( new (C) ProjNode(call,TypeFunc::Parms) ); |
0 | 208 // C-land is allowed to return sub-word values. Convert to integer type. |
209 assert( retval != Type::TOP, "" ); | |
210 if (retval == TypeInt::BOOL) { | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
211 retnode = _gvn.transform( new (C) AndINode(retnode, intcon(0xFF)) ); |
0 | 212 } else if (retval == TypeInt::CHAR) { |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
213 retnode = _gvn.transform( new (C) AndINode(retnode, intcon(0xFFFF)) ); |
0 | 214 } else if (retval == TypeInt::BYTE) { |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
215 retnode = _gvn.transform( new (C) LShiftINode(retnode, intcon(24)) ); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
216 retnode = _gvn.transform( new (C) RShiftINode(retnode, intcon(24)) ); |
0 | 217 } else if (retval == TypeInt::SHORT) { |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
218 retnode = _gvn.transform( new (C) LShiftINode(retnode, intcon(16)) ); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
219 retnode = _gvn.transform( new (C) RShiftINode(retnode, intcon(16)) ); |
0 | 220 } |
221 map()->set_req( TypeFunc::Parms, retnode ); | |
222 } | |
223 | |
224 //----------------------------- | |
225 | |
226 // Clear last_Java_sp | |
14429
2113136690bc
8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering
goetz
parents:
14422
diff
changeset
|
227 store_to_memory(NULL, adr_sp, null(), T_ADDRESS, NoAlias, MemNode::unordered); |
0 | 228 // Clear last_Java_pc and (optionally)_flags |
14429
2113136690bc
8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering
goetz
parents:
14422
diff
changeset
|
229 store_to_memory(NULL, adr_last_Java_pc, null(), T_ADDRESS, NoAlias, MemNode::unordered); |
7994 | 230 #if defined(SPARC) |
14429
2113136690bc
8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering
goetz
parents:
14422
diff
changeset
|
231 store_to_memory(NULL, adr_flags, intcon(0), T_INT, NoAlias, MemNode::unordered); |
7994 | 232 #endif /* defined(SPARC) */ |
14403
75ef1a499665
8019973: PPC64 (part 11): Fix IA64 preprocessor conditionals on AIX.
goetz
parents:
7994
diff
changeset
|
233 #if (defined(IA64) && !defined(AIX)) |
0 | 234 Node* adr_last_Java_fp = basic_plus_adr(top(), thread, in_bytes(JavaThread::last_Java_fp_offset())); |
14429
2113136690bc
8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering
goetz
parents:
14422
diff
changeset
|
235 store_to_memory(NULL, adr_last_Java_fp, null(), T_ADDRESS, NoAlias, MemNode::unordered); |
0 | 236 #endif |
237 | |
238 // For is-fancy-jump, the C-return value is also the branch target | |
239 Node* target = map()->in(TypeFunc::Parms); | |
240 // Runtime call returning oop in TLS? Fetch it out | |
241 if( pass_tls ) { | |
242 Node* adr = basic_plus_adr(top(), thread, in_bytes(JavaThread::vm_result_offset())); | |
14429
2113136690bc
8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering
goetz
parents:
14422
diff
changeset
|
243 Node* vm_result = make_load(NULL, adr, TypeOopPtr::BOTTOM, T_OBJECT, NoAlias, MemNode::unordered); |
0 | 244 map()->set_req(TypeFunc::Parms, vm_result); // vm_result passed as result |
245 // clear thread-local-storage(tls) | |
14429
2113136690bc
8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering
goetz
parents:
14422
diff
changeset
|
246 store_to_memory(NULL, adr, null(), T_ADDRESS, NoAlias, MemNode::unordered); |
0 | 247 } |
248 | |
249 //----------------------------- | |
250 // check exception | |
251 Node* adr = basic_plus_adr(top(), thread, in_bytes(Thread::pending_exception_offset())); | |
14429
2113136690bc
8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering
goetz
parents:
14422
diff
changeset
|
252 Node* pending = make_load(NULL, adr, TypeOopPtr::BOTTOM, T_OBJECT, NoAlias, MemNode::unordered); |
0 | 253 |
254 Node* exit_memory = reset_memory(); | |
255 | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
256 Node* cmp = _gvn.transform( new (C) CmpPNode(pending, null()) ); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
257 Node* bo = _gvn.transform( new (C) BoolNode(cmp, BoolTest::ne) ); |
0 | 258 IfNode *iff = create_and_map_if(control(), bo, PROB_MIN, COUNT_UNKNOWN); |
259 | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
260 Node* if_null = _gvn.transform( new (C) IfFalseNode(iff) ); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
261 Node* if_not_null = _gvn.transform( new (C) IfTrueNode(iff) ); |
0 | 262 |
263 assert (StubRoutines::forward_exception_entry() != NULL, "must be generated before"); | |
264 Node *exc_target = makecon(TypeRawPtr::make( StubRoutines::forward_exception_entry() )); | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
265 Node *to_exc = new (C) TailCallNode(if_not_null, |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
266 i_o(), |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
267 exit_memory, |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
268 frameptr(), |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
269 returnadr(), |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
270 exc_target, null()); |
0 | 271 root()->add_req(_gvn.transform(to_exc)); // bind to root to keep live |
272 C->init_start(start); | |
273 | |
274 //----------------------------- | |
275 // If this is a normal subroutine return, issue the return and be done. | |
276 Node *ret; | |
277 switch( is_fancy_jump ) { | |
278 case 0: // Make a return instruction | |
279 // Return to caller, free any space for return address | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
280 ret = new (C) ReturnNode(TypeFunc::Parms, if_null, |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
281 i_o(), |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
282 exit_memory, |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
283 frameptr(), |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
284 returnadr()); |
0 | 285 if (C->tf()->range()->cnt() > TypeFunc::Parms) |
286 ret->add_req( map()->in(TypeFunc::Parms) ); | |
287 break; | |
288 case 1: // This is a fancy tail-call jump. Jump to computed address. | |
289 // Jump to new callee; leave old return address alone. | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
290 ret = new (C) TailCallNode(if_null, |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
291 i_o(), |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
292 exit_memory, |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
293 frameptr(), |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
294 returnadr(), |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
295 target, map()->in(TypeFunc::Parms)); |
0 | 296 break; |
297 case 2: // Pop return address & jump | |
298 // Throw away old return address; jump to new computed address | |
299 //assert(C_function == CAST_FROM_FN_PTR(address, OptoRuntime::rethrow_C), "fancy_jump==2 only for rethrow"); | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
300 ret = new (C) TailJumpNode(if_null, |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
301 i_o(), |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
302 exit_memory, |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
303 frameptr(), |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
1972
diff
changeset
|
304 target, map()->in(TypeFunc::Parms)); |
0 | 305 break; |
306 default: | |
307 ShouldNotReachHere(); | |
308 } | |
309 root()->add_req(_gvn.transform(ret)); | |
310 } |