diff src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @ 24170:0b85ccd62409 jdk8u131-b01

8168699: Validate special case invocations Reviewed-by: kevinw, vlivanov
author coleenp
date Tue, 13 Dec 2016 14:37:04 -0500
parents d109bda16490
children 719853999215
line wrap: on
line diff
--- a/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Tue Dec 13 10:07:12 2016 -0800
+++ b/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Tue Dec 13 14:37:04 2016 -0500
@@ -1228,12 +1228,17 @@
   obj.load_item();
 
   // info for exceptions
-  CodeEmitInfo* info_for_exception = state_for(x);
+  CodeEmitInfo* info_for_exception =
+      (x->needs_exception_state() ? state_for(x) :
+                                    state_for(x, x->state_before(), true /*ignore_xhandler*/));
 
   CodeStub* stub;
   if (x->is_incompatible_class_change_check()) {
     assert(patching_info == NULL, "can't patch this");
     stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception);
+  } else if (x->is_invokespecial_receiver_check()) {
+    assert(patching_info == NULL, "can't patch this");
+    stub = new DeoptimizeStub(info_for_exception);
   } else {
     stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception);
   }