comparison src/cpu/sparc/vm/sharedRuntime_sparc.cpp @ 21559:be896a1983c0

recast all Graal native code as JVMCI code (JBS:GRAAL-53)
author Doug Simon <doug.simon@oracle.com>
date Thu, 28 May 2015 15:36:48 +0200
parents 178a4927b95c
children c28cb37b2e1d
comparison
equal deleted inserted replaced
21558:d563baeca9df 21559:be896a1983c0
41 #endif 41 #endif
42 #ifdef SHARK 42 #ifdef SHARK
43 #include "compiler/compileBroker.hpp" 43 #include "compiler/compileBroker.hpp"
44 #include "shark/sharkCompiler.hpp" 44 #include "shark/sharkCompiler.hpp"
45 #endif 45 #endif
46 #ifdef GRAAL 46 #ifdef JVMCI
47 #include "graal/graalJavaAccess.hpp" 47 #include "jvmci/jvmciJavaAccess.hpp"
48 #endif 48 #endif
49 49
50 #define __ masm-> 50 #define __ masm->
51 51
52 52
993 } 993 }
994 } 994 }
995 995
996 // Jump to the compiled code just as if compiled code was doing it. 996 // Jump to the compiled code just as if compiled code was doing it.
997 __ ld_ptr(G5_method, in_bytes(Method::from_compiled_offset()), G3); 997 __ ld_ptr(G5_method, in_bytes(Method::from_compiled_offset()), G3);
998 #ifdef GRAAL 998 #ifdef JVMCI
999 // check if this call should be routed towards a specific entry point 999 // check if this call should be routed towards a specific entry point
1000 __ ld(Address(G2_thread, in_bytes(JavaThread::graal_alternate_call_target_offset())), G1); 1000 __ ld(Address(G2_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())), G1);
1001 __ cmp(G0, G1); 1001 __ cmp(G0, G1);
1002 Label no_alternative_target; 1002 Label no_alternative_target;
1003 __ br(Assembler::equal, false, Assembler::pn, no_alternative_target); 1003 __ br(Assembler::equal, false, Assembler::pn, no_alternative_target);
1004 __ delayed()->nop(); 1004 __ delayed()->nop();
1005 1005
1006 __ ld_ptr(G2_thread, in_bytes(JavaThread::graal_alternate_call_target_offset()), G3); 1006 __ ld_ptr(G2_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset()), G3);
1007 __ st(G0, Address(G2_thread, in_bytes(JavaThread::graal_alternate_call_target_offset()))); 1007 __ st(G0, Address(G2_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())));
1008 1008
1009 __ bind(no_alternative_target); 1009 __ bind(no_alternative_target);
1010 #endif 1010 #endif
1011 1011
1012 // 6243940 We might end up in handle_wrong_method if 1012 // 6243940 We might end up in handle_wrong_method if
3471 #ifdef ASSERT 3471 #ifdef ASSERT
3472 if (UseStackBanging) { 3472 if (UseStackBanging) {
3473 pad += StackShadowPages*16 + 32; 3473 pad += StackShadowPages*16 + 32;
3474 } 3474 }
3475 #endif 3475 #endif
3476 #ifdef GRAAL 3476 #ifdef JVMCI
3477 pad += 1000; // Increase the buffer size when compiling for GRAAL 3477 pad += 1000; // Increase the buffer size when compiling for JVMCI
3478 #endif 3478 #endif
3479 #ifdef _LP64 3479 #ifdef _LP64
3480 CodeBuffer buffer("deopt_blob", 2100+pad+1000, 512); 3480 CodeBuffer buffer("deopt_blob", 2100+pad+1000, 512);
3481 #else 3481 #else
3482 // Measured 8/7/03 at 1212 in 32bit debug build (no VerifyThread) 3482 // Measured 8/7/03 at 1212 in 32bit debug build (no VerifyThread)
3541 map = RegisterSaver::save_live_registers(masm, 0, &frame_size_words); 3541 map = RegisterSaver::save_live_registers(masm, 0, &frame_size_words);
3542 __ ba(cont); 3542 __ ba(cont);
3543 __ delayed()->mov(Deoptimization::Unpack_deopt, L0deopt_mode); 3543 __ delayed()->mov(Deoptimization::Unpack_deopt, L0deopt_mode);
3544 3544
3545 3545
3546 #ifdef GRAAL 3546 #ifdef JVMCI
3547 masm->block_comment("BEGIN GRAAL"); 3547 masm->block_comment("BEGIN JVMCI");
3548 int implicit_exception_uncommon_trap_offset = __ offset() - start; 3548 int implicit_exception_uncommon_trap_offset = __ offset() - start;
3549 __ ld_ptr(G2_thread, in_bytes(JavaThread::graal_implicit_exception_pc_offset()), O7); 3549 __ ld_ptr(G2_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset()), O7);
3550 __ add(O7, -8, O7); 3550 __ add(O7, -8, O7);
3551 3551
3552 int uncommon_trap_offset = __ offset() - start; 3552 int uncommon_trap_offset = __ offset() - start;
3553 3553
3554 // Save everything in sight. 3554 // Save everything in sight.
3573 __ reset_last_Java_frame(); 3573 __ reset_last_Java_frame();
3574 3574
3575 Label after_fetch_unroll_info_call; 3575 Label after_fetch_unroll_info_call;
3576 __ ba(after_fetch_unroll_info_call); 3576 __ ba(after_fetch_unroll_info_call);
3577 __ delayed()->nop(); // Delay slot 3577 __ delayed()->nop(); // Delay slot
3578 masm->block_comment("END GRAAL"); 3578 masm->block_comment("END JVMCI");
3579 #endif // GRAAL 3579 #endif // JVMCI
3580 3580
3581 int exception_offset = __ offset() - start; 3581 int exception_offset = __ offset() - start;
3582 3582
3583 // restore G2, the trampoline destroyed it 3583 // restore G2, the trampoline destroyed it
3584 __ get_thread(); 3584 __ get_thread();
3630 3630
3631 // 3631 //
3632 // Reexecute entry, similar to c2 uncommon trap 3632 // Reexecute entry, similar to c2 uncommon trap
3633 // 3633 //
3634 int reexecute_offset = __ offset() - start; 3634 int reexecute_offset = __ offset() - start;
3635 #if defined(COMPILERGRAAL) && !defined(COMPILER1) 3635 #if defined(COMPILERJVMCI) && !defined(COMPILER1)
3636 // Graal does not use this kind of deoptimization 3636 // JVMCI does not use this kind of deoptimization
3637 __ should_not_reach_here(); 3637 __ should_not_reach_here();
3638 #endif 3638 #endif
3639 // No need to update oop_map as each call to save_live_registers will produce identical oopmap 3639 // No need to update oop_map as each call to save_live_registers will produce identical oopmap
3640 (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_words); 3640 (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_words);
3641 3641
3657 3657
3658 __ mov(L7_thread_cache, G2_thread); 3658 __ mov(L7_thread_cache, G2_thread);
3659 3659
3660 __ reset_last_Java_frame(); 3660 __ reset_last_Java_frame();
3661 3661
3662 #ifdef GRAAL 3662 #ifdef JVMCI
3663 __ bind(after_fetch_unroll_info_call); 3663 __ bind(after_fetch_unroll_info_call);
3664 #endif 3664 #endif
3665 // NOTE: we know that only O0/O1 will be reloaded by restore_result_registers 3665 // NOTE: we know that only O0/O1 will be reloaded by restore_result_registers
3666 // so this move will survive 3666 // so this move will survive
3667 3667
3725 __ delayed()->restore(); 3725 __ delayed()->restore();
3726 3726
3727 masm->flush(); 3727 masm->flush();
3728 _deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_words); 3728 _deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_words);
3729 _deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset); 3729 _deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset);
3730 #ifdef GRAAL 3730 #ifdef JVMCI
3731 _deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset); 3731 _deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset);
3732 _deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset); 3732 _deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset);
3733 #endif 3733 #endif
3734 } 3734 }
3735 3735