# HG changeset patch # User Thomas Wuerthinger # Date 1305123915 -7200 # Node ID 40248577d587171d5841c188d8bfcf0c8859700e # Parent 63633fb059146daea6862e1f6a97359840b94060 Deoptimize on array store and array bounds exception. diff -r 63633fb05914 -r 40248577d587 graal/GraalRuntime/src/com/oracle/graal/runtime/HotSpotVMConfig.java --- 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; diff -r 63633fb05914 -r 40248577d587 graal/GraalRuntime/src/com/oracle/graal/runtime/HotSpotXirGenerator.java --- 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 + ">"); } diff -r 63633fb05914 -r 40248577d587 src/share/vm/c1x/c1x_VMEntries.cpp --- 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)));