changeset 2659:40248577d587

Deoptimize on array store and array bounds exception.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 11 May 2011 16:25:15 +0200
parents 63633fb05914
children 9f557e940180
files graal/GraalRuntime/src/com/oracle/graal/runtime/HotSpotVMConfig.java graal/GraalRuntime/src/com/oracle/graal/runtime/HotSpotXirGenerator.java src/share/vm/c1x/c1x_VMEntries.cpp
diffstat 3 files changed, 5 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/graal/GraalRuntime/src/com/oracle/graal/runtime/HotSpotVMConfig.java	Wed May 11 16:12:01 2011 +0200
+++ b/graal/GraalRuntime/src/com/oracle/graal/runtime/HotSpotVMConfig.java	Wed May 11 16:25:15 2011 +0200
@@ -77,9 +77,6 @@
     public long unwindExceptionStub;
     public long handleExceptionStub;
     public long handleDeoptStub;
-    public long throwClassCastException;
-    public long throwArrayStoreException;
-    public long throwArrayIndexException;
     public long monitorEnterStub;
     public long monitorExitStub;
     public long fastMonitorEnterStub;
--- a/graal/GraalRuntime/src/com/oracle/graal/runtime/HotSpotXirGenerator.java	Wed May 11 16:12:01 2011 +0200
+++ b/graal/GraalRuntime/src/com/oracle/graal/runtime/HotSpotXirGenerator.java	Wed May 11 16:25:15 2011 +0200
@@ -815,7 +815,7 @@
             asm.pload(kind, result, array, index, config.getArrayOffset(kind), Scale.fromInt(elemSize), implicitNullException);
             if (is(BOUNDS_CHECK, flags)) {
                 asm.bindOutOfLine(failBoundsCheck);
-                asm.callRuntime(config.throwArrayIndexException, null);
+                asm.callRuntime(CiRuntimeCall.Deoptimize, null);
                 asm.shouldNotReachHere();
             }
             return asm.finishTemplate("arrayload<" + kind + ">");
@@ -1008,7 +1008,7 @@
                 asm.jneq(store, temp, asm.w(0));
                 XirOperand scratch = asm.createRegisterTemp("scratch", CiKind.Object, AMD64.r10);
                 asm.mov(scratch, valueHub);
-                asm.callRuntime(config.throwArrayStoreException, null);
+                asm.callRuntime(CiRuntimeCall.Deoptimize, null);
                 asm.jmp(store);
             }
 
@@ -1090,7 +1090,7 @@
             // -- out of line -------------------------------------------------------
             if (is(BOUNDS_CHECK, flags)) {
                 asm.bindOutOfLine(failBoundsCheck);
-                asm.callRuntime(config.throwArrayIndexException, null);
+                asm.callRuntime(CiRuntimeCall.Deoptimize, null);
                 asm.shouldNotReachHere();
             }
             if (is(STORE_CHECK, flags) && kind == CiKind.Object) {
@@ -1100,8 +1100,8 @@
                 asm.jneq(store, temp, asm.w(0));
                 XirOperand scratch = asm.createRegisterTemp("scratch", CiKind.Object, AMD64.r10);
                 asm.mov(scratch, valueHub);
-                asm.callRuntime(config.throwArrayStoreException, null);
-                asm.jmp(store);
+                asm.callRuntime(CiRuntimeCall.Deoptimize, null);
+                asm.shouldNotReachHere();
             }
             return asm.finishTemplate("arraystore<" + kind + ">");
         }
--- a/src/share/vm/c1x/c1x_VMEntries.cpp	Wed May 11 16:12:01 2011 +0200
+++ b/src/share/vm/c1x/c1x_VMEntries.cpp	Wed May 11 16:25:15 2011 +0200
@@ -586,9 +586,6 @@
   set_long(env, config, "unwindExceptionStub", VmIds::addStub(Runtime1::entry_for(Runtime1::c1x_unwind_exception_call_id)));
   set_long(env, config, "handleExceptionStub", VmIds::addStub(Runtime1::entry_for(Runtime1::handle_exception_nofpu_id)));
   set_long(env, config, "handleDeoptStub", VmIds::addStub(SharedRuntime::deopt_blob()->unpack()));
-  set_long(env, config, "throwClassCastException", VmIds::addStub(Runtime1::entry_for(Runtime1::throw_class_cast_exception_id)));
-  set_long(env, config, "throwArrayStoreException", VmIds::addStub(Runtime1::entry_for(Runtime1::throw_array_store_exception_id)));
-  set_long(env, config, "throwArrayIndexException", VmIds::addStub(Runtime1::entry_for(Runtime1::throw_range_check_failed_id)));
   set_long(env, config, "monitorEnterStub", VmIds::addStub(Runtime1::entry_for(Runtime1::monitorenter_id)));
   set_long(env, config, "monitorExitStub", VmIds::addStub(Runtime1::entry_for(Runtime1::monitorexit_id)));
   set_long(env, config, "fastMonitorEnterStub", VmIds::addStub(Runtime1::entry_for(Runtime1::c1x_monitorenter_id)));