Mercurial > hg > truffle
comparison src/share/vm/opto/callGenerator.cpp @ 7421:ad5dd04754ee
8005031: Some cleanup in c2 to prepare for incremental inlining support
Summary: collection of small changes to prepare for incremental inlining.
Reviewed-by: twisti, kvn
author | roland |
---|---|
date | Tue, 18 Dec 2012 14:55:25 +0100 |
parents | beebba0acc11 |
children | d092d1b31229 |
comparison
equal
deleted
inserted
replaced
7420:18d56ca3e901 | 7421:ad5dd04754ee |
---|---|
272 | 272 |
273 // Convert the CallStaticJava into an inline | 273 // Convert the CallStaticJava into an inline |
274 virtual void do_late_inline(); | 274 virtual void do_late_inline(); |
275 | 275 |
276 virtual JVMState* generate(JVMState* jvms) { | 276 virtual JVMState* generate(JVMState* jvms) { |
277 Compile *C = Compile::current(); | |
278 C->print_inlining_skip(this); | |
279 | |
277 // Record that this call site should be revisited once the main | 280 // Record that this call site should be revisited once the main |
278 // parse is finished. | 281 // parse is finished. |
279 Compile::current()->add_late_inline(this); | 282 Compile::current()->add_late_inline(this); |
280 | 283 |
281 // Emit the CallStaticJava and request separate projections so | 284 // Emit the CallStaticJava and request separate projections so |
282 // that the late inlining logic can distinguish between fall | 285 // that the late inlining logic can distinguish between fall |
283 // through and exceptional uses of the memory and io projections | 286 // through and exceptional uses of the memory and io projections |
284 // as is done for allocations and macro expansion. | 287 // as is done for allocations and macro expansion. |
285 return DirectCallGenerator::generate(jvms); | 288 return DirectCallGenerator::generate(jvms); |
286 } | 289 } |
287 | |
288 }; | 290 }; |
289 | 291 |
290 | 292 |
291 void LateInlineCallGenerator::do_late_inline() { | 293 void LateInlineCallGenerator::do_late_inline() { |
292 // Can't inline it | 294 // Can't inline it |
305 map->init_req(i1, call->in(i1)); | 307 map->init_req(i1, call->in(i1)); |
306 } | 308 } |
307 | 309 |
308 // Make sure the state is a MergeMem for parsing. | 310 // Make sure the state is a MergeMem for parsing. |
309 if (!map->in(TypeFunc::Memory)->is_MergeMem()) { | 311 if (!map->in(TypeFunc::Memory)->is_MergeMem()) { |
310 map->set_req(TypeFunc::Memory, MergeMemNode::make(C, map->in(TypeFunc::Memory))); | 312 Node* mem = MergeMemNode::make(C, map->in(TypeFunc::Memory)); |
313 C->initial_gvn()->set_type_bottom(mem); | |
314 map->set_req(TypeFunc::Memory, mem); | |
311 } | 315 } |
312 | 316 |
313 // Make enough space for the expression stack and transfer the incoming arguments | 317 // Make enough space for the expression stack and transfer the incoming arguments |
314 int nargs = method()->arg_size(); | 318 int nargs = method()->arg_size(); |
315 jvms->set_map(map); | 319 jvms->set_map(map); |
317 if (nargs > 0) { | 321 if (nargs > 0) { |
318 for (int i1 = 0; i1 < nargs; i1++) { | 322 for (int i1 = 0; i1 < nargs; i1++) { |
319 map->set_req(i1 + jvms->argoff(), call->in(TypeFunc::Parms + i1)); | 323 map->set_req(i1 + jvms->argoff(), call->in(TypeFunc::Parms + i1)); |
320 } | 324 } |
321 } | 325 } |
326 | |
327 C->print_inlining_insert(this); | |
322 | 328 |
323 CompileLog* log = C->log(); | 329 CompileLog* log = C->log(); |
324 if (log != NULL) { | 330 if (log != NULL) { |
325 log->head("late_inline method='%d'", log->identify(method())); | 331 log->head("late_inline method='%d'", log->identify(method())); |
326 JVMState* p = jvms; | 332 JVMState* p = jvms; |
606 const int vtable_index = Method::invalid_vtable_index; | 612 const int vtable_index = Method::invalid_vtable_index; |
607 CallGenerator* cg = C->call_generator(target, vtable_index, false, jvms, true, PROB_ALWAYS); | 613 CallGenerator* cg = C->call_generator(target, vtable_index, false, jvms, true, PROB_ALWAYS); |
608 if (cg != NULL && cg->is_inline()) | 614 if (cg != NULL && cg->is_inline()) |
609 return cg; | 615 return cg; |
610 } else { | 616 } else { |
611 if (PrintInlining) CompileTask::print_inlining(callee, jvms->depth() - 1, jvms->bci(), "receiver not constant"); | 617 if (PrintInlining) C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), "receiver not constant"); |
612 } | 618 } |
613 } | 619 } |
614 break; | 620 break; |
615 | 621 |
616 case vmIntrinsics::_linkToVirtual: | 622 case vmIntrinsics::_linkToVirtual: |