Mercurial > hg > truffle
comparison src/share/vm/opto/callGenerator.cpp @ 20340:fbc31318922c hs25.40-b06
Merge
author | amurillo |
---|---|
date | Thu, 21 Aug 2014 14:42:54 -0700 |
parents | 411e30e5fbb8 |
children | 8ed0a8dbea70 |
comparison
equal
deleted
inserted
replaced
20322:4d5c3760ebb4 | 20340:fbc31318922c |
---|---|
61 _expected_uses = expected_uses; | 61 _expected_uses = expected_uses; |
62 assert(InlineTree::check_can_parse(method) == NULL, "parse must be possible"); | 62 assert(InlineTree::check_can_parse(method) == NULL, "parse must be possible"); |
63 } | 63 } |
64 | 64 |
65 virtual bool is_parse() const { return true; } | 65 virtual bool is_parse() const { return true; } |
66 virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); | 66 virtual JVMState* generate(JVMState* jvms); |
67 int is_osr() { return _is_osr; } | 67 int is_osr() { return _is_osr; } |
68 | 68 |
69 }; | 69 }; |
70 | 70 |
71 JVMState* ParseGenerator::generate(JVMState* jvms, Parse* parent_parser) { | 71 JVMState* ParseGenerator::generate(JVMState* jvms) { |
72 Compile* C = Compile::current(); | 72 Compile* C = Compile::current(); |
73 | 73 |
74 if (is_osr()) { | 74 if (is_osr()) { |
75 // The JVMS for a OSR has a single argument (see its TypeFunc). | 75 // The JVMS for a OSR has a single argument (see its TypeFunc). |
76 assert(jvms->depth() == 1, "no inline OSR"); | 76 assert(jvms->depth() == 1, "no inline OSR"); |
78 | 78 |
79 if (C->failing()) { | 79 if (C->failing()) { |
80 return NULL; // bailing out of the compile; do not try to parse | 80 return NULL; // bailing out of the compile; do not try to parse |
81 } | 81 } |
82 | 82 |
83 Parse parser(jvms, method(), _expected_uses, parent_parser); | 83 Parse parser(jvms, method(), _expected_uses); |
84 // Grab signature for matching/allocation | 84 // Grab signature for matching/allocation |
85 #ifdef ASSERT | 85 #ifdef ASSERT |
86 if (parser.tf() != (parser.depth() == 1 ? C->tf() : tf())) { | 86 if (parser.tf() != (parser.depth() == 1 ? C->tf() : tf())) { |
87 MutexLockerEx ml(Compile_lock, Mutex::_no_safepoint_check_flag); | 87 MutexLockerEx ml(Compile_lock, Mutex::_no_safepoint_check_flag); |
88 assert(C->env()->system_dictionary_modification_counter_changed(), | 88 assert(C->env()->system_dictionary_modification_counter_changed(), |
117 DirectCallGenerator(ciMethod* method, bool separate_io_proj) | 117 DirectCallGenerator(ciMethod* method, bool separate_io_proj) |
118 : CallGenerator(method), | 118 : CallGenerator(method), |
119 _separate_io_proj(separate_io_proj) | 119 _separate_io_proj(separate_io_proj) |
120 { | 120 { |
121 } | 121 } |
122 virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); | 122 virtual JVMState* generate(JVMState* jvms); |
123 | 123 |
124 CallStaticJavaNode* call_node() const { return _call_node; } | 124 CallStaticJavaNode* call_node() const { return _call_node; } |
125 }; | 125 }; |
126 | 126 |
127 JVMState* DirectCallGenerator::generate(JVMState* jvms, Parse* parent_parser) { | 127 JVMState* DirectCallGenerator::generate(JVMState* jvms) { |
128 GraphKit kit(jvms); | 128 GraphKit kit(jvms); |
129 bool is_static = method()->is_static(); | 129 bool is_static = method()->is_static(); |
130 address target = is_static ? SharedRuntime::get_resolve_static_call_stub() | 130 address target = is_static ? SharedRuntime::get_resolve_static_call_stub() |
131 : SharedRuntime::get_resolve_opt_virtual_call_stub(); | 131 : SharedRuntime::get_resolve_opt_virtual_call_stub(); |
132 | 132 |
169 { | 169 { |
170 assert(vtable_index == Method::invalid_vtable_index || | 170 assert(vtable_index == Method::invalid_vtable_index || |
171 vtable_index >= 0, "either invalid or usable"); | 171 vtable_index >= 0, "either invalid or usable"); |
172 } | 172 } |
173 virtual bool is_virtual() const { return true; } | 173 virtual bool is_virtual() const { return true; } |
174 virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); | 174 virtual JVMState* generate(JVMState* jvms); |
175 }; | 175 }; |
176 | 176 |
177 JVMState* VirtualCallGenerator::generate(JVMState* jvms, Parse* parent_parser) { | 177 JVMState* VirtualCallGenerator::generate(JVMState* jvms) { |
178 GraphKit kit(jvms); | 178 GraphKit kit(jvms); |
179 Node* receiver = kit.argument(0); | 179 Node* receiver = kit.argument(0); |
180 | 180 |
181 if (kit.C->log() != NULL) { | 181 if (kit.C->log() != NULL) { |
182 kit.C->log()->elem("virtual_call bci='%d'", jvms->bci()); | 182 kit.C->log()->elem("virtual_call bci='%d'", jvms->bci()); |
274 virtual bool is_late_inline() const { return true; } | 274 virtual bool is_late_inline() const { return true; } |
275 | 275 |
276 // Convert the CallStaticJava into an inline | 276 // Convert the CallStaticJava into an inline |
277 virtual void do_late_inline(); | 277 virtual void do_late_inline(); |
278 | 278 |
279 virtual JVMState* generate(JVMState* jvms, Parse* parent_parser) { | 279 virtual JVMState* generate(JVMState* jvms) { |
280 Compile *C = Compile::current(); | 280 Compile *C = Compile::current(); |
281 C->print_inlining_skip(this); | 281 C->print_inlining_skip(this); |
282 | 282 |
283 // Record that this call site should be revisited once the main | 283 // Record that this call site should be revisited once the main |
284 // parse is finished. | 284 // parse is finished. |
288 | 288 |
289 // Emit the CallStaticJava and request separate projections so | 289 // Emit the CallStaticJava and request separate projections so |
290 // that the late inlining logic can distinguish between fall | 290 // that the late inlining logic can distinguish between fall |
291 // through and exceptional uses of the memory and io projections | 291 // through and exceptional uses of the memory and io projections |
292 // as is done for allocations and macro expansion. | 292 // as is done for allocations and macro expansion. |
293 return DirectCallGenerator::generate(jvms, parent_parser); | 293 return DirectCallGenerator::generate(jvms); |
294 } | 294 } |
295 | 295 |
296 virtual void print_inlining_late(const char* msg) { | 296 virtual void print_inlining_late(const char* msg) { |
297 CallNode* call = call_node(); | 297 CallNode* call = call_node(); |
298 Compile* C = Compile::current(); | 298 Compile* C = Compile::current(); |
387 entry_nn->set_jvms(jvms); | 387 entry_nn->set_jvms(jvms); |
388 C->set_default_node_notes(entry_nn); | 388 C->set_default_node_notes(entry_nn); |
389 } | 389 } |
390 | 390 |
391 // Now perform the inling using the synthesized JVMState | 391 // Now perform the inling using the synthesized JVMState |
392 JVMState* new_jvms = _inline_cg->generate(jvms, NULL); | 392 JVMState* new_jvms = _inline_cg->generate(jvms); |
393 if (new_jvms == NULL) return; // no change | 393 if (new_jvms == NULL) return; // no change |
394 if (C->failing()) return; | 394 if (C->failing()) return; |
395 | 395 |
396 // Capture any exceptional control flow | 396 // Capture any exceptional control flow |
397 GraphKit kit(new_jvms); | 397 GraphKit kit(new_jvms); |
405 | 405 |
406 C->set_has_loops(C->has_loops() || _inline_cg->method()->has_loops()); | 406 C->set_has_loops(C->has_loops() || _inline_cg->method()->has_loops()); |
407 C->env()->notice_inlined_method(_inline_cg->method()); | 407 C->env()->notice_inlined_method(_inline_cg->method()); |
408 C->set_inlining_progress(true); | 408 C->set_inlining_progress(true); |
409 | 409 |
410 kit.replace_call(call, result); | 410 kit.replace_call(call, result, true); |
411 } | 411 } |
412 | 412 |
413 | 413 |
414 CallGenerator* CallGenerator::for_late_inline(ciMethod* method, CallGenerator* inline_cg) { | 414 CallGenerator* CallGenerator::for_late_inline(ciMethod* method, CallGenerator* inline_cg) { |
415 return new LateInlineCallGenerator(method, inline_cg); | 415 return new LateInlineCallGenerator(method, inline_cg); |
427 LateInlineMHCallGenerator(ciMethod* caller, ciMethod* callee, bool input_not_const) : | 427 LateInlineMHCallGenerator(ciMethod* caller, ciMethod* callee, bool input_not_const) : |
428 LateInlineCallGenerator(callee, NULL), _caller(caller), _attempt(0), _input_not_const(input_not_const) {} | 428 LateInlineCallGenerator(callee, NULL), _caller(caller), _attempt(0), _input_not_const(input_not_const) {} |
429 | 429 |
430 virtual bool is_mh_late_inline() const { return true; } | 430 virtual bool is_mh_late_inline() const { return true; } |
431 | 431 |
432 virtual JVMState* generate(JVMState* jvms, Parse* parent_parser) { | 432 virtual JVMState* generate(JVMState* jvms) { |
433 JVMState* new_jvms = LateInlineCallGenerator::generate(jvms, parent_parser); | 433 JVMState* new_jvms = LateInlineCallGenerator::generate(jvms); |
434 if (_input_not_const) { | 434 if (_input_not_const) { |
435 // inlining won't be possible so no need to enqueue right now. | 435 // inlining won't be possible so no need to enqueue right now. |
436 call_node()->set_generator(this); | 436 call_node()->set_generator(this); |
437 } else { | 437 } else { |
438 Compile::current()->add_late_inline(this); | 438 Compile::current()->add_late_inline(this); |
475 | 475 |
476 public: | 476 public: |
477 LateInlineStringCallGenerator(ciMethod* method, CallGenerator* inline_cg) : | 477 LateInlineStringCallGenerator(ciMethod* method, CallGenerator* inline_cg) : |
478 LateInlineCallGenerator(method, inline_cg) {} | 478 LateInlineCallGenerator(method, inline_cg) {} |
479 | 479 |
480 virtual JVMState* generate(JVMState* jvms, Parse* parent_parser) { | 480 virtual JVMState* generate(JVMState* jvms) { |
481 Compile *C = Compile::current(); | 481 Compile *C = Compile::current(); |
482 C->print_inlining_skip(this); | 482 C->print_inlining_skip(this); |
483 | 483 |
484 C->add_string_late_inline(this); | 484 C->add_string_late_inline(this); |
485 | 485 |
486 JVMState* new_jvms = DirectCallGenerator::generate(jvms, parent_parser); | 486 JVMState* new_jvms = DirectCallGenerator::generate(jvms); |
487 return new_jvms; | 487 return new_jvms; |
488 } | 488 } |
489 | 489 |
490 virtual bool is_string_late_inline() const { return true; } | 490 virtual bool is_string_late_inline() const { return true; } |
491 }; | 491 }; |
498 | 498 |
499 public: | 499 public: |
500 LateInlineBoxingCallGenerator(ciMethod* method, CallGenerator* inline_cg) : | 500 LateInlineBoxingCallGenerator(ciMethod* method, CallGenerator* inline_cg) : |
501 LateInlineCallGenerator(method, inline_cg) {} | 501 LateInlineCallGenerator(method, inline_cg) {} |
502 | 502 |
503 virtual JVMState* generate(JVMState* jvms, Parse* parent_parser) { | 503 virtual JVMState* generate(JVMState* jvms) { |
504 Compile *C = Compile::current(); | 504 Compile *C = Compile::current(); |
505 C->print_inlining_skip(this); | 505 C->print_inlining_skip(this); |
506 | 506 |
507 C->add_boxing_late_inline(this); | 507 C->add_boxing_late_inline(this); |
508 | 508 |
509 JVMState* new_jvms = DirectCallGenerator::generate(jvms, parent_parser); | 509 JVMState* new_jvms = DirectCallGenerator::generate(jvms); |
510 return new_jvms; | 510 return new_jvms; |
511 } | 511 } |
512 }; | 512 }; |
513 | 513 |
514 CallGenerator* CallGenerator::for_boxing_late_inline(ciMethod* method, CallGenerator* inline_cg) { | 514 CallGenerator* CallGenerator::for_boxing_late_inline(ciMethod* method, CallGenerator* inline_cg) { |
540 | 540 |
541 virtual bool is_inline() const { return _is_inline; } | 541 virtual bool is_inline() const { return _is_inline; } |
542 virtual bool is_virtual() const { return _is_virtual; } | 542 virtual bool is_virtual() const { return _is_virtual; } |
543 virtual bool is_deferred() const { return true; } | 543 virtual bool is_deferred() const { return true; } |
544 | 544 |
545 virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); | 545 virtual JVMState* generate(JVMState* jvms); |
546 }; | 546 }; |
547 | 547 |
548 | 548 |
549 CallGenerator* CallGenerator::for_warm_call(WarmCallInfo* ci, | 549 CallGenerator* CallGenerator::for_warm_call(WarmCallInfo* ci, |
550 CallGenerator* if_cold, | 550 CallGenerator* if_cold, |
551 CallGenerator* if_hot) { | 551 CallGenerator* if_hot) { |
552 return new WarmCallGenerator(ci, if_cold, if_hot); | 552 return new WarmCallGenerator(ci, if_cold, if_hot); |
553 } | 553 } |
554 | 554 |
555 JVMState* WarmCallGenerator::generate(JVMState* jvms, Parse* parent_parser) { | 555 JVMState* WarmCallGenerator::generate(JVMState* jvms) { |
556 Compile* C = Compile::current(); | 556 Compile* C = Compile::current(); |
557 if (C->log() != NULL) { | 557 if (C->log() != NULL) { |
558 C->log()->elem("warm_call bci='%d'", jvms->bci()); | 558 C->log()->elem("warm_call bci='%d'", jvms->bci()); |
559 } | 559 } |
560 jvms = _if_cold->generate(jvms, parent_parser); | 560 jvms = _if_cold->generate(jvms); |
561 if (jvms != NULL) { | 561 if (jvms != NULL) { |
562 Node* m = jvms->map()->control(); | 562 Node* m = jvms->map()->control(); |
563 if (m->is_CatchProj()) m = m->in(0); else m = C->top(); | 563 if (m->is_CatchProj()) m = m->in(0); else m = C->top(); |
564 if (m->is_Catch()) m = m->in(0); else m = C->top(); | 564 if (m->is_Catch()) m = m->in(0); else m = C->top(); |
565 if (m->is_Proj()) m = m->in(0); else m = C->top(); | 565 if (m->is_Proj()) m = m->in(0); else m = C->top(); |
616 | 616 |
617 virtual bool is_virtual() const { return true; } | 617 virtual bool is_virtual() const { return true; } |
618 virtual bool is_inline() const { return _if_hit->is_inline(); } | 618 virtual bool is_inline() const { return _if_hit->is_inline(); } |
619 virtual bool is_deferred() const { return _if_hit->is_deferred(); } | 619 virtual bool is_deferred() const { return _if_hit->is_deferred(); } |
620 | 620 |
621 virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); | 621 virtual JVMState* generate(JVMState* jvms); |
622 }; | 622 }; |
623 | 623 |
624 | 624 |
625 CallGenerator* CallGenerator::for_predicted_call(ciKlass* predicted_receiver, | 625 CallGenerator* CallGenerator::for_predicted_call(ciKlass* predicted_receiver, |
626 CallGenerator* if_missed, | 626 CallGenerator* if_missed, |
628 float hit_prob) { | 628 float hit_prob) { |
629 return new PredictedCallGenerator(predicted_receiver, if_missed, if_hit, hit_prob); | 629 return new PredictedCallGenerator(predicted_receiver, if_missed, if_hit, hit_prob); |
630 } | 630 } |
631 | 631 |
632 | 632 |
633 JVMState* PredictedCallGenerator::generate(JVMState* jvms, Parse* parent_parser) { | 633 JVMState* PredictedCallGenerator::generate(JVMState* jvms) { |
634 GraphKit kit(jvms); | 634 GraphKit kit(jvms); |
635 PhaseGVN& gvn = kit.gvn(); | 635 PhaseGVN& gvn = kit.gvn(); |
636 // We need an explicit receiver null_check before checking its type. | 636 // We need an explicit receiver null_check before checking its type. |
637 // We share a map with the caller, so his JVMS gets adjusted. | 637 // We share a map with the caller, so his JVMS gets adjusted. |
638 Node* receiver = kit.argument(0); | 638 Node* receiver = kit.argument(0); |
646 receiver = kit.null_check_receiver_before_call(method()); | 646 receiver = kit.null_check_receiver_before_call(method()); |
647 if (kit.stopped()) { | 647 if (kit.stopped()) { |
648 return kit.transfer_exceptions_into_jvms(); | 648 return kit.transfer_exceptions_into_jvms(); |
649 } | 649 } |
650 | 650 |
651 // Make a copy of the replaced nodes in case we need to restore them | |
652 ReplacedNodes replaced_nodes = kit.map()->replaced_nodes(); | |
653 replaced_nodes.clone(); | |
654 | |
651 Node* exact_receiver = receiver; // will get updated in place... | 655 Node* exact_receiver = receiver; // will get updated in place... |
652 Node* slow_ctl = kit.type_check_receiver(receiver, | 656 Node* slow_ctl = kit.type_check_receiver(receiver, |
653 _predicted_receiver, _hit_prob, | 657 _predicted_receiver, _hit_prob, |
654 &exact_receiver); | 658 &exact_receiver); |
655 | 659 |
656 SafePointNode* slow_map = NULL; | 660 SafePointNode* slow_map = NULL; |
657 JVMState* slow_jvms; | 661 JVMState* slow_jvms; |
658 { PreserveJVMState pjvms(&kit); | 662 { PreserveJVMState pjvms(&kit); |
659 kit.set_control(slow_ctl); | 663 kit.set_control(slow_ctl); |
660 if (!kit.stopped()) { | 664 if (!kit.stopped()) { |
661 slow_jvms = _if_missed->generate(kit.sync_jvms(), parent_parser); | 665 slow_jvms = _if_missed->generate(kit.sync_jvms()); |
662 if (kit.failing()) | 666 if (kit.failing()) |
663 return NULL; // might happen because of NodeCountInliningCutoff | 667 return NULL; // might happen because of NodeCountInliningCutoff |
664 assert(slow_jvms != NULL, "must be"); | 668 assert(slow_jvms != NULL, "must be"); |
665 kit.add_exception_states_from(slow_jvms); | 669 kit.add_exception_states_from(slow_jvms); |
666 kit.set_map(slow_jvms->map()); | 670 kit.set_map(slow_jvms->map()); |
677 | 681 |
678 // fall through if the instance exactly matches the desired type | 682 // fall through if the instance exactly matches the desired type |
679 kit.replace_in_map(receiver, exact_receiver); | 683 kit.replace_in_map(receiver, exact_receiver); |
680 | 684 |
681 // Make the hot call: | 685 // Make the hot call: |
682 JVMState* new_jvms = _if_hit->generate(kit.sync_jvms(), parent_parser); | 686 JVMState* new_jvms = _if_hit->generate(kit.sync_jvms()); |
683 if (new_jvms == NULL) { | 687 if (new_jvms == NULL) { |
684 // Inline failed, so make a direct call. | 688 // Inline failed, so make a direct call. |
685 assert(_if_hit->is_inline(), "must have been a failed inline"); | 689 assert(_if_hit->is_inline(), "must have been a failed inline"); |
686 CallGenerator* cg = CallGenerator::for_direct_call(_if_hit->method()); | 690 CallGenerator* cg = CallGenerator::for_direct_call(_if_hit->method()); |
687 new_jvms = cg->generate(kit.sync_jvms(), parent_parser); | 691 new_jvms = cg->generate(kit.sync_jvms()); |
688 } | 692 } |
689 kit.add_exception_states_from(new_jvms); | 693 kit.add_exception_states_from(new_jvms); |
690 kit.set_jvms(new_jvms); | 694 kit.set_jvms(new_jvms); |
691 | 695 |
692 // Need to merge slow and fast? | 696 // Need to merge slow and fast? |
698 if (kit.stopped()) { | 702 if (kit.stopped()) { |
699 // Inlined method threw an exception, so it's just the slow path after all. | 703 // Inlined method threw an exception, so it's just the slow path after all. |
700 kit.set_jvms(slow_jvms); | 704 kit.set_jvms(slow_jvms); |
701 return kit.transfer_exceptions_into_jvms(); | 705 return kit.transfer_exceptions_into_jvms(); |
702 } | 706 } |
707 | |
708 // There are 2 branches and the replaced nodes are only valid on | |
709 // one: restore the replaced nodes to what they were before the | |
710 // branch. | |
711 kit.map()->set_replaced_nodes(replaced_nodes); | |
703 | 712 |
704 // Finish the diamond. | 713 // Finish the diamond. |
705 kit.C->set_has_split_ifs(true); // Has chance for split-if optimization | 714 kit.C->set_has_split_ifs(true); // Has chance for split-if optimization |
706 RegionNode* region = new (kit.C) RegionNode(3); | 715 RegionNode* region = new (kit.C) RegionNode(3); |
707 region->init_req(1, kit.control()); | 716 region->init_req(1, kit.control()); |
889 | 898 |
890 virtual bool is_virtual() const { return true; } | 899 virtual bool is_virtual() const { return true; } |
891 virtual bool is_inlined() const { return true; } | 900 virtual bool is_inlined() const { return true; } |
892 virtual bool is_intrinsic() const { return true; } | 901 virtual bool is_intrinsic() const { return true; } |
893 | 902 |
894 virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); | 903 virtual JVMState* generate(JVMState* jvms); |
895 }; | 904 }; |
896 | 905 |
897 | 906 |
898 CallGenerator* CallGenerator::for_predicated_intrinsic(CallGenerator* intrinsic, | 907 CallGenerator* CallGenerator::for_predicated_intrinsic(CallGenerator* intrinsic, |
899 CallGenerator* cg) { | 908 CallGenerator* cg) { |
900 return new PredicatedIntrinsicGenerator(intrinsic, cg); | 909 return new PredicatedIntrinsicGenerator(intrinsic, cg); |
901 } | 910 } |
902 | 911 |
903 | 912 |
904 JVMState* PredicatedIntrinsicGenerator::generate(JVMState* jvms, Parse* parent_parser) { | 913 JVMState* PredicatedIntrinsicGenerator::generate(JVMState* jvms) { |
905 // The code we want to generate here is: | 914 // The code we want to generate here is: |
906 // if (receiver == NULL) | 915 // if (receiver == NULL) |
907 // uncommon_Trap | 916 // uncommon_Trap |
908 // if (predicate(0)) | 917 // if (predicate(0)) |
909 // do_intrinsic(0) | 918 // do_intrinsic(0) |
959 assert(old_exc == new_map->next_exception(), "generate_predicate should not add exceptions"); | 968 assert(old_exc == new_map->next_exception(), "generate_predicate should not add exceptions"); |
960 #endif | 969 #endif |
961 if (!kit.stopped()) { | 970 if (!kit.stopped()) { |
962 PreserveJVMState pjvms(&kit); | 971 PreserveJVMState pjvms(&kit); |
963 // Generate intrinsic code: | 972 // Generate intrinsic code: |
964 JVMState* new_jvms = _intrinsic->generate(kit.sync_jvms(), parent_parser); | 973 JVMState* new_jvms = _intrinsic->generate(kit.sync_jvms()); |
965 if (new_jvms == NULL) { | 974 if (new_jvms == NULL) { |
966 // Intrinsic failed, use normal compilation path for this predicate. | 975 // Intrinsic failed, use normal compilation path for this predicate. |
967 slow_region->add_req(kit.control()); | 976 slow_region->add_req(kit.control()); |
968 } else { | 977 } else { |
969 kit.add_exception_states_from(new_jvms); | 978 kit.add_exception_states_from(new_jvms); |
984 } | 993 } |
985 if (slow_region->req() > 1) { | 994 if (slow_region->req() > 1) { |
986 PreserveJVMState pjvms(&kit); | 995 PreserveJVMState pjvms(&kit); |
987 // Generate normal compilation code: | 996 // Generate normal compilation code: |
988 kit.set_control(gvn.transform(slow_region)); | 997 kit.set_control(gvn.transform(slow_region)); |
989 JVMState* new_jvms = _cg->generate(kit.sync_jvms(), parent_parser); | 998 JVMState* new_jvms = _cg->generate(kit.sync_jvms()); |
990 if (kit.failing()) | 999 if (kit.failing()) |
991 return NULL; // might happen because of NodeCountInliningCutoff | 1000 return NULL; // might happen because of NodeCountInliningCutoff |
992 assert(new_jvms != NULL, "must be"); | 1001 assert(new_jvms != NULL, "must be"); |
993 kit.add_exception_states_from(new_jvms); | 1002 kit.add_exception_states_from(new_jvms); |
994 kit.set_jvms(new_jvms); | 1003 kit.set_jvms(new_jvms); |
1091 } | 1100 } |
1092 | 1101 |
1093 virtual bool is_virtual() const { ShouldNotReachHere(); return false; } | 1102 virtual bool is_virtual() const { ShouldNotReachHere(); return false; } |
1094 virtual bool is_trap() const { return true; } | 1103 virtual bool is_trap() const { return true; } |
1095 | 1104 |
1096 virtual JVMState* generate(JVMState* jvms, Parse* parent_parser); | 1105 virtual JVMState* generate(JVMState* jvms); |
1097 }; | 1106 }; |
1098 | 1107 |
1099 | 1108 |
1100 CallGenerator* | 1109 CallGenerator* |
1101 CallGenerator::for_uncommon_trap(ciMethod* m, | 1110 CallGenerator::for_uncommon_trap(ciMethod* m, |
1103 Deoptimization::DeoptAction action) { | 1112 Deoptimization::DeoptAction action) { |
1104 return new UncommonTrapCallGenerator(m, reason, action); | 1113 return new UncommonTrapCallGenerator(m, reason, action); |
1105 } | 1114 } |
1106 | 1115 |
1107 | 1116 |
1108 JVMState* UncommonTrapCallGenerator::generate(JVMState* jvms, Parse* parent_parser) { | 1117 JVMState* UncommonTrapCallGenerator::generate(JVMState* jvms) { |
1109 GraphKit kit(jvms); | 1118 GraphKit kit(jvms); |
1110 // Take the trap with arguments pushed on the stack. (Cf. null_check_receiver). | 1119 // Take the trap with arguments pushed on the stack. (Cf. null_check_receiver). |
1111 int nargs = method()->arg_size(); | 1120 int nargs = method()->arg_size(); |
1112 kit.inc_sp(nargs); | 1121 kit.inc_sp(nargs); |
1113 assert(nargs <= kit.sp() && kit.sp() <= jvms->stk_size(), "sane sp w/ args pushed"); | 1122 assert(nargs <= kit.sp() && kit.sp() <= jvms->stk_size(), "sane sp w/ args pushed"); |