src/share/vm/opto/graphKit.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/opto/graphKit.cpp

src/share/vm/opto/graphKit.cpp

Print this page
rev 6553 : 8033626: assert(ex_map->jvms()->same_calls_as(_exceptions->jvms())) failed: all collected exceptions must come from the same place
Reviewed-by: ?

*** 2511,2521 **** } } //------------------------------make_slow_call_ex------------------------------ // Make the exception handler hookups for the slow call ! void GraphKit::make_slow_call_ex(Node* call, ciInstanceKlass* ex_klass, bool separate_io_proj) { if (stopped()) return; // Make a catch node with just two handlers: fall-through and catch-all Node* i_o = _gvn.transform( new ProjNode(call, TypeFunc::I_O, separate_io_proj) ); Node* catc = _gvn.transform( new CatchNode(control(), i_o, 2) ); --- 2511,2521 ---- } } //------------------------------make_slow_call_ex------------------------------ // Make the exception handler hookups for the slow call ! void GraphKit::make_slow_call_ex(Node* call, ciInstanceKlass* ex_klass, bool separate_io_proj, bool deoptimize) { if (stopped()) return; // Make a catch node with just two handlers: fall-through and catch-all Node* i_o = _gvn.transform( new ProjNode(call, TypeFunc::I_O, separate_io_proj) ); Node* catc = _gvn.transform( new CatchNode(control(), i_o, 2) );
*** 2525,2541 **** --- 2525,2547 ---- { PreserveJVMState pjvms(this); set_control(excp); set_i_o(i_o); if (excp != top()) { + if (deoptimize) { + // Deoptimize if an exception is caught. Don't construct exception state in this case. + uncommon_trap(Deoptimization::Reason_unhandled, + Deoptimization::Action_none); + } else { // Create an exception state also. // Use an exact type if the caller has specified a specific exception. const Type* ex_type = TypeOopPtr::make_from_klass_unique(ex_klass)->cast_to_ptr_type(TypePtr::NotNull); Node* ex_oop = new CreateExNode(ex_type, control(), i_o); add_exception_state(make_exception_state(_gvn.transform(ex_oop))); } } + } // Get the no-exception control from the CatchNode. set_control(norm); }
*** 3350,3368 **** kit.set_memory(init_out_raw, alias_idx); } //---------------------------set_output_for_allocation------------------------- Node* GraphKit::set_output_for_allocation(AllocateNode* alloc, ! const TypeOopPtr* oop_type) { int rawidx = Compile::AliasIdxRaw; alloc->set_req( TypeFunc::FramePtr, frameptr() ); add_safepoint_edges(alloc); Node* allocx = _gvn.transform(alloc); set_control( _gvn.transform(new ProjNode(allocx, TypeFunc::Control) ) ); // create memory projection for i_o set_memory ( _gvn.transform( new ProjNode(allocx, TypeFunc::Memory, true) ), rawidx ); ! make_slow_call_ex(allocx, env()->Throwable_klass(), true); // create a memory projection as for the normal control path Node* malloc = _gvn.transform(new ProjNode(allocx, TypeFunc::Memory)); set_memory(malloc, rawidx); --- 3356,3375 ---- kit.set_memory(init_out_raw, alias_idx); } //---------------------------set_output_for_allocation------------------------- Node* GraphKit::set_output_for_allocation(AllocateNode* alloc, ! const TypeOopPtr* oop_type, ! bool deoptimize_on_exception) { int rawidx = Compile::AliasIdxRaw; alloc->set_req( TypeFunc::FramePtr, frameptr() ); add_safepoint_edges(alloc); Node* allocx = _gvn.transform(alloc); set_control( _gvn.transform(new ProjNode(allocx, TypeFunc::Control) ) ); // create memory projection for i_o set_memory ( _gvn.transform( new ProjNode(allocx, TypeFunc::Memory, true) ), rawidx ); ! make_slow_call_ex(allocx, env()->Throwable_klass(), true, deoptimize_on_exception); // create a memory projection as for the normal control path Node* malloc = _gvn.transform(new ProjNode(allocx, TypeFunc::Memory)); set_memory(malloc, rawidx);
*** 3436,3448 **** // for either, and the graph will fold nicely if the optimizer later reduces // the type to a constant. // The optional arguments are for specialized use by intrinsics: // - If 'extra_slow_test' if not null is an extra condition for the slow-path. // - If 'return_size_val', report the the total object size to the caller. Node* GraphKit::new_instance(Node* klass_node, Node* extra_slow_test, ! Node* *return_size_val) { // Compute size in doublewords // The size is always an integral number of doublewords, represented // as a positive bytewise size stored in the klass's layout_helper. // The layout_helper also encodes (in a low bit) the need for a slow path. jint layout_con = Klass::_lh_neutral_value; --- 3443,3457 ---- // for either, and the graph will fold nicely if the optimizer later reduces // the type to a constant. // The optional arguments are for specialized use by intrinsics: // - If 'extra_slow_test' if not null is an extra condition for the slow-path. // - If 'return_size_val', report the the total object size to the caller. + // - deoptimize_on_exception controls how Java exceptions are handled (rethrow vs deoptimize) Node* GraphKit::new_instance(Node* klass_node, Node* extra_slow_test, ! Node* *return_size_val, ! bool deoptimize_on_exception) { // Compute size in doublewords // The size is always an integral number of doublewords, represented // as a positive bytewise size stored in the klass's layout_helper. // The layout_helper also encodes (in a low bit) the need for a slow path. jint layout_con = Klass::_lh_neutral_value;
*** 3506,3526 **** AllocateNode* alloc = new AllocateNode(C, AllocateNode::alloc_type(Type::TOP), control(), mem, i_o(), size, klass_node, initial_slow_test); ! return set_output_for_allocation(alloc, oop_type); } //-------------------------------new_array------------------------------------- // helper for both newarray and anewarray // The 'length' parameter is (obviously) the length of the array. // See comments on new_instance for the meaning of the other arguments. Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable) Node* length, // number of array elements int nargs, // number of arguments to push back for uncommon trap ! Node* *return_size_val) { jint layout_con = Klass::_lh_neutral_value; Node* layout_val = get_layout_helper(klass_node, layout_con); int layout_is_con = (layout_val == NULL); if (!layout_is_con && !StressReflectiveCode && --- 3515,3536 ---- AllocateNode* alloc = new AllocateNode(C, AllocateNode::alloc_type(Type::TOP), control(), mem, i_o(), size, klass_node, initial_slow_test); ! return set_output_for_allocation(alloc, oop_type, deoptimize_on_exception); } //-------------------------------new_array------------------------------------- // helper for both newarray and anewarray // The 'length' parameter is (obviously) the length of the array. // See comments on new_instance for the meaning of the other arguments. Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable) Node* length, // number of array elements int nargs, // number of arguments to push back for uncommon trap ! Node* *return_size_val, ! bool deoptimize_on_exception) { jint layout_con = Klass::_lh_neutral_value; Node* layout_val = get_layout_helper(klass_node, layout_con); int layout_is_con = (layout_val == NULL); if (!layout_is_con && !StressReflectiveCode &&
*** 3659,3669 **** if (ary_type->isa_aryptr() && length_type != NULL) { // Try to get a better type than POS for the size ary_type = ary_type->is_aryptr()->cast_to_size(length_type); } ! Node* javaoop = set_output_for_allocation(alloc, ary_type); // Cast length on remaining path to be as narrow as possible if (map()->find_edge(length) >= 0) { Node* ccast = alloc->make_ideal_length(ary_type, &_gvn); if (ccast != length) { --- 3669,3679 ---- if (ary_type->isa_aryptr() && length_type != NULL) { // Try to get a better type than POS for the size ary_type = ary_type->is_aryptr()->cast_to_size(length_type); } ! Node* javaoop = set_output_for_allocation(alloc, ary_type, deoptimize_on_exception); // Cast length on remaining path to be as narrow as possible if (map()->find_edge(length) >= 0) { Node* ccast = alloc->make_ideal_length(ary_type, &_gvn); if (ccast != length) {
src/share/vm/opto/graphKit.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File