Mercurial > hg > graal-compiler
comparison src/cpu/sparc/vm/stubGenerator_sparc.cpp @ 3937:c565834fb592
7088020: SEGV in JNIHandleBlock::release_block
Reviewed-by: kvn, twisti
author | never |
---|---|
date | Sat, 10 Sep 2011 00:11:04 -0700 |
parents | 2f9b79ddb05c |
children | a92cdbac8b9e |
comparison
equal
deleted
inserted
replaced
3936:2c24ef16533d | 3937:c565834fb592 |
---|---|
434 // properly traversed and ignored during GC, so we change the meaning of the "__" | 434 // properly traversed and ignored during GC, so we change the meaning of the "__" |
435 // macro within this method. | 435 // macro within this method. |
436 #undef __ | 436 #undef __ |
437 #define __ masm-> | 437 #define __ masm-> |
438 | 438 |
439 address generate_throw_exception(const char* name, address runtime_entry, bool restore_saved_exception_pc, | 439 address generate_throw_exception(const char* name, address runtime_entry, |
440 Register arg1 = noreg, Register arg2 = noreg) { | 440 Register arg1 = noreg, Register arg2 = noreg) { |
441 #ifdef ASSERT | 441 #ifdef ASSERT |
442 int insts_size = VerifyThread ? 1 * K : 600; | 442 int insts_size = VerifyThread ? 1 * K : 600; |
443 #else | 443 #else |
444 int insts_size = VerifyThread ? 1 * K : 256; | 444 int insts_size = VerifyThread ? 1 * K : 256; |
459 // sites, the implicit exception is taken before the callee frame | 459 // sites, the implicit exception is taken before the callee frame |
460 // is pushed. | 460 // is pushed. |
461 __ save_frame(0); | 461 __ save_frame(0); |
462 | 462 |
463 int frame_complete = __ offset(); | 463 int frame_complete = __ offset(); |
464 | |
465 if (restore_saved_exception_pc) { | |
466 __ ld_ptr(G2_thread, JavaThread::saved_exception_pc_offset(), I7); | |
467 __ sub(I7, frame::pc_return_offset, I7); | |
468 } | |
469 | 464 |
470 // Note that we always have a runtime stub frame on the top of stack by this point | 465 // Note that we always have a runtime stub frame on the top of stack by this point |
471 Register last_java_sp = SP; | 466 Register last_java_sp = SP; |
472 // 64-bit last_java_sp is biased! | 467 // 64-bit last_java_sp is biased! |
473 __ set_last_Java_frame(last_java_sp, G0); | 468 __ set_last_Java_frame(last_java_sp, G0); |
3416 // stub expects the required and actual type to already be in O1 | 3411 // stub expects the required and actual type to already be in O1 |
3417 // and O2 respectively. | 3412 // and O2 respectively. |
3418 StubRoutines::_throw_WrongMethodTypeException_entry = | 3413 StubRoutines::_throw_WrongMethodTypeException_entry = |
3419 generate_throw_exception("WrongMethodTypeException throw_exception", | 3414 generate_throw_exception("WrongMethodTypeException throw_exception", |
3420 CAST_FROM_FN_PTR(address, SharedRuntime::throw_WrongMethodTypeException), | 3415 CAST_FROM_FN_PTR(address, SharedRuntime::throw_WrongMethodTypeException), |
3421 false, G5_method_type, G3_method_handle); | 3416 G5_method_type, G3_method_handle); |
3422 } | 3417 } |
3423 | 3418 |
3424 | 3419 |
3425 void generate_all() { | 3420 void generate_all() { |
3426 // Generates all stubs and initializes the entry points | 3421 // Generates all stubs and initializes the entry points |
3427 | 3422 |
3428 // Generate partial_subtype_check first here since its code depends on | 3423 // Generate partial_subtype_check first here since its code depends on |
3429 // UseZeroBaseCompressedOops which is defined after heap initialization. | 3424 // UseZeroBaseCompressedOops which is defined after heap initialization. |
3430 StubRoutines::Sparc::_partial_subtype_check = generate_partial_subtype_check(); | 3425 StubRoutines::Sparc::_partial_subtype_check = generate_partial_subtype_check(); |
3431 // These entry points require SharedInfo::stack0 to be set up in non-core builds | 3426 // These entry points require SharedInfo::stack0 to be set up in non-core builds |
3432 StubRoutines::_throw_AbstractMethodError_entry = generate_throw_exception("AbstractMethodError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_AbstractMethodError), false); | 3427 StubRoutines::_throw_AbstractMethodError_entry = generate_throw_exception("AbstractMethodError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_AbstractMethodError)); |
3433 StubRoutines::_throw_IncompatibleClassChangeError_entry= generate_throw_exception("IncompatibleClassChangeError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_IncompatibleClassChangeError), false); | 3428 StubRoutines::_throw_IncompatibleClassChangeError_entry= generate_throw_exception("IncompatibleClassChangeError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_IncompatibleClassChangeError)); |
3434 StubRoutines::_throw_ArithmeticException_entry = generate_throw_exception("ArithmeticException throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_ArithmeticException), true); | 3429 StubRoutines::_throw_NullPointerException_at_call_entry= generate_throw_exception("NullPointerException at call throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_NullPointerException_at_call)); |
3435 StubRoutines::_throw_NullPointerException_entry = generate_throw_exception("NullPointerException throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_NullPointerException), true); | 3430 StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError)); |
3436 StubRoutines::_throw_NullPointerException_at_call_entry= generate_throw_exception("NullPointerException at call throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_NullPointerException_at_call), false); | |
3437 StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError), false); | |
3438 | 3431 |
3439 StubRoutines::_handler_for_unsafe_access_entry = | 3432 StubRoutines::_handler_for_unsafe_access_entry = |
3440 generate_handler_for_unsafe_access(); | 3433 generate_handler_for_unsafe_access(); |
3441 | 3434 |
3442 // support for verify_oop (must happen after universe_init) | 3435 // support for verify_oop (must happen after universe_init) |