# HG changeset patch # User Lukas Stadler # Date 1312995167 -7200 # Node ID 6e806c37340561d80a38889bc33457294859eaed # Parent e4616e3d207bae00e4b2a1448e085cb428ab39d6# Parent e54641d0d012ac88ea93c1ee2649f689a88fdd61 merge diff -r e54641d0d012 -r 6e806c373405 src/cpu/x86/vm/c1_Runtime1_x86.cpp --- a/src/cpu/x86/vm/c1_Runtime1_x86.cpp Wed Aug 10 16:30:51 2011 +0200 +++ b/src/cpu/x86/vm/c1_Runtime1_x86.cpp Wed Aug 10 18:52:47 2011 +0200 @@ -1052,6 +1052,12 @@ thread->set_vm_result(Exceptions::new_exception(thread, vmSymbols::java_lang_NullPointerException(), NULL)()); JRT_END +JRT_ENTRY(void, graal_create_out_of_bounds_exception(JavaThread* thread, jint index)) + char message[jintAsStringSize]; + sprintf(message, "%d", index); + thread->set_vm_result(Exceptions::new_exception(thread, vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), message)()); +JRT_END + @@ -1915,6 +1921,28 @@ break; } + case graal_create_null_pointer_exception_id: { + __ enter(); + oop_maps = new OopMapSet(); + OopMap* oop_map = save_live_registers(sasm, 0); + int call_offset = __ call_RT(rax, noreg, (address)graal_create_null_exception, 0); + oop_maps->add_gc_map(call_offset, oop_map); + __ leave(); + __ ret(0); + break; + } + + case graal_create_out_of_bounds_exception_id: { + __ enter(); + oop_maps = new OopMapSet(); + OopMap* oop_map = save_live_registers(sasm, 0); + int call_offset = __ call_RT(rax, noreg, (address)graal_create_out_of_bounds_exception, c_rarg0); + oop_maps->add_gc_map(call_offset, oop_map); + __ leave(); + __ ret(0); + break; + } + case graal_handle_exception_id: { StubFrame f(sasm, "graal_handle_exception", dont_gc_arguments); oop_maps = new OopMapSet(); diff -r e54641d0d012 -r 6e806c373405 src/share/vm/c1/c1_Runtime1.hpp --- a/src/share/vm/c1/c1_Runtime1.hpp Wed Aug 10 16:30:51 2011 +0200 +++ b/src/share/vm/c1/c1_Runtime1.hpp Wed Aug 10 18:52:47 2011 +0200 @@ -70,14 +70,16 @@ stub(g1_post_barrier_slow) \ stub(fpu2long_stub) \ stub(counter_overflow) \ - stub(graal_unwind_exception_call) \ - stub(graal_handle_exception) \ - stub(graal_slow_subtype_check) \ - stub(graal_arithmetic_frem) \ - stub(graal_arithmetic_drem) \ - stub(graal_monitorenter) \ - stub(graal_monitorexit) \ - stub(graal_verify_pointer) \ + stub(graal_unwind_exception_call) \ + stub(graal_handle_exception) \ + stub(graal_slow_subtype_check) \ + stub(graal_arithmetic_frem) \ + stub(graal_arithmetic_drem) \ + stub(graal_monitorenter) \ + stub(graal_monitorexit) \ + stub(graal_verify_pointer) \ + stub(graal_create_null_pointer_exception) \ + stub(graal_create_out_of_bounds_exception) \ last_entry(number_of_ids) #define DECLARE_STUB_ID(x) x ## _id , diff -r e54641d0d012 -r 6e806c373405 src/share/vm/graal/graalCodeInstaller.cpp --- a/src/share/vm/graal/graalCodeInstaller.cpp Wed Aug 10 16:30:51 2011 +0200 +++ b/src/share/vm/graal/graalCodeInstaller.cpp Wed Aug 10 18:52:47 2011 +0200 @@ -594,6 +594,14 @@ call->set_destination(Runtime1::entry_for(Runtime1::graal_handle_exception_id)); _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand); TRACE_graal_3("CiRuntimeCall::HandleException()"); + } else if (runtime_call == CiRuntimeCall::CreateNullPointerException()) { + call->set_destination(Runtime1::entry_for(Runtime1::graal_create_null_pointer_exception_id)); + _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand); + TRACE_graal_3("CiRuntimeCall::CreateNullPointerException()"); + } else if (runtime_call == CiRuntimeCall::CreateOutOfBoundsException()) { + call->set_destination(Runtime1::entry_for(Runtime1::graal_create_out_of_bounds_exception_id)); + _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand); + TRACE_graal_3("CiRuntimeCall::CreateOutOfBoundsException()"); } else if (runtime_call == CiRuntimeCall::JavaTimeMillis()) { call->set_destination((address)os::javaTimeMillis); _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand); @@ -658,6 +666,7 @@ } case MARK_INVOKESTATIC: { assert(method == NULL || method->is_static(), "cannot call non-static method with invokestatic"); + call->set_destination(SharedRuntime::get_resolve_static_call_stub()); _instructions->relocate(call->instruction_address(), relocInfo::static_call_type, Assembler::call32_operand); break; diff -r e54641d0d012 -r 6e806c373405 src/share/vm/graal/graalJavaAccess.hpp --- a/src/share/vm/graal/graalJavaAccess.hpp Wed Aug 10 16:30:51 2011 +0200 +++ b/src/share/vm/graal/graalJavaAccess.hpp Wed Aug 10 18:52:47 2011 +0200 @@ -177,6 +177,8 @@ static_oop_field(CiRuntimeCall, UnwindException, "Lcom/sun/cri/ci/CiRuntimeCall;"); \ static_oop_field(CiRuntimeCall, RegisterFinalizer, "Lcom/sun/cri/ci/CiRuntimeCall;"); \ static_oop_field(CiRuntimeCall, HandleException, "Lcom/sun/cri/ci/CiRuntimeCall;"); \ + static_oop_field(CiRuntimeCall, CreateNullPointerException, "Lcom/sun/cri/ci/CiRuntimeCall;"); \ + static_oop_field(CiRuntimeCall, CreateOutOfBoundsException, "Lcom/sun/cri/ci/CiRuntimeCall;"); \ static_oop_field(CiRuntimeCall, OSRMigrationEnd, "Lcom/sun/cri/ci/CiRuntimeCall;"); \ static_oop_field(CiRuntimeCall, JavaTimeMillis, "Lcom/sun/cri/ci/CiRuntimeCall;"); \ static_oop_field(CiRuntimeCall, JavaTimeNanos, "Lcom/sun/cri/ci/CiRuntimeCall;"); \