comparison src/share/vm/opto/doCall.cpp @ 13522:ad3c9d35ee12

8185736: missing default exception handler in calls to rethrow_Stub Reviewed-by: kvn
author never
date Tue, 15 Aug 2017 17:18:00 +0000
parents b4438b96a1db
children 958228979fe8
comparison
equal deleted inserted replaced
81:4038cf7f22eb 83:5418eb07c91b
717 // Add a CatchNode. 717 // Add a CatchNode.
718 GrowableArray<int>* bcis = new (C->node_arena()) GrowableArray<int>(C->node_arena(), 8, 0, -1); 718 GrowableArray<int>* bcis = new (C->node_arena()) GrowableArray<int>(C->node_arena(), 8, 0, -1);
719 GrowableArray<const Type*>* extypes = new (C->node_arena()) GrowableArray<const Type*>(C->node_arena(), 8, 0, NULL); 719 GrowableArray<const Type*>* extypes = new (C->node_arena()) GrowableArray<const Type*>(C->node_arena(), 8, 0, NULL);
720 GrowableArray<int>* saw_unloaded = new (C->node_arena()) GrowableArray<int>(C->node_arena(), 8, 0, 0); 720 GrowableArray<int>* saw_unloaded = new (C->node_arena()) GrowableArray<int>(C->node_arena(), 8, 0, 0);
721 721
722 bool default_handler = false;
722 for (; !handlers.is_done(); handlers.next()) { 723 for (; !handlers.is_done(); handlers.next()) {
723 ciExceptionHandler* h = handlers.handler(); 724 ciExceptionHandler* h = handlers.handler();
724 int h_bci = h->handler_bci(); 725 int h_bci = h->handler_bci();
725 ciInstanceKlass* h_klass = h->is_catch_all() ? env()->Throwable_klass() : h->catch_klass(); 726 ciInstanceKlass* h_klass = h->is_catch_all() ? env()->Throwable_klass() : h->catch_klass();
726 // Do not introduce unloaded exception types into the graph: 727 // Do not introduce unloaded exception types into the graph:
739 h_extype = h_extype->join(TypeInstPtr::NOTNULL); 740 h_extype = h_extype->join(TypeInstPtr::NOTNULL);
740 assert(!h_extype->empty(), "sanity"); 741 assert(!h_extype->empty(), "sanity");
741 // Note: It's OK if the BCIs repeat themselves. 742 // Note: It's OK if the BCIs repeat themselves.
742 bcis->append(h_bci); 743 bcis->append(h_bci);
743 extypes->append(h_extype); 744 extypes->append(h_extype);
745 if (h_bci == -1) {
746 default_handler = true;
747 }
748 }
749
750 if (!default_handler) {
751 bcis->append(-1);
752 extypes->append(TypeOopPtr::make_from_klass(env()->Throwable_klass())->is_instptr());
744 } 753 }
745 754
746 int len = bcis->length(); 755 int len = bcis->length();
747 CatchNode *cn = new CatchNode(control(), i_o, len+1); 756 CatchNode *cn = new CatchNode(control(), i_o, len+1);
748 Node *catch_ = _gvn.transform(cn); 757 Node *catch_ = _gvn.transform(cn);