hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
changeset 9976 6fef34e63df1
parent 8872 36680c58660e
child 10252 0981ce1c3eef
equal deleted inserted replaced
9975:82190b49ce14 9976:6fef34e63df1
    45 #include "shark/sharkCompiler.hpp"
    45 #include "shark/sharkCompiler.hpp"
    46 #endif
    46 #endif
    47 
    47 
    48 #define __ masm->
    48 #define __ masm->
    49 
    49 
    50 #ifdef COMPILER2
       
    51 UncommonTrapBlob*   SharedRuntime::_uncommon_trap_blob;
       
    52 #endif // COMPILER2
       
    53 
       
    54 DeoptimizationBlob* SharedRuntime::_deopt_blob;
       
    55 SafepointBlob*      SharedRuntime::_polling_page_safepoint_handler_blob;
       
    56 SafepointBlob*      SharedRuntime::_polling_page_return_handler_blob;
       
    57 RuntimeStub*        SharedRuntime::_wrong_method_blob;
       
    58 RuntimeStub*        SharedRuntime::_ic_miss_blob;
       
    59 RuntimeStub*        SharedRuntime::_resolve_opt_virtual_call_blob;
       
    60 RuntimeStub*        SharedRuntime::_resolve_virtual_call_blob;
       
    61 RuntimeStub*        SharedRuntime::_resolve_static_call_blob;
       
    62 
    50 
    63 class RegisterSaver {
    51 class RegisterSaver {
    64 
    52 
    65   // Used for saving volatile registers. This is Gregs, Fregs, I/L/O.
    53   // Used for saving volatile registers. This is Gregs, Fregs, I/L/O.
    66   // The Oregs are problematic. In the 32bit build the compiler can
    54   // The Oregs are problematic. In the 32bit build the compiler can
  3490 // the adjusted FP off to the GC stack-crawler: this will modify the caller's
  3478 // the adjusted FP off to the GC stack-crawler: this will modify the caller's
  3491 // SP and mess up HIS OopMaps.  So we first adjust the caller's SP, then save
  3479 // SP and mess up HIS OopMaps.  So we first adjust the caller's SP, then save
  3492 // the 64-bit %o's, then do a save, then fixup the caller's SP (our FP).
  3480 // the 64-bit %o's, then do a save, then fixup the caller's SP (our FP).
  3493 // Tricky, tricky, tricky...
  3481 // Tricky, tricky, tricky...
  3494 
  3482 
  3495 static SafepointBlob* generate_handler_blob(address call_ptr, bool cause_return) {
  3483 SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, bool cause_return) {
  3496   assert (StubRoutines::forward_exception_entry() != NULL, "must be generated before");
  3484   assert (StubRoutines::forward_exception_entry() != NULL, "must be generated before");
  3497 
  3485 
  3498   // allocate space for the code
  3486   // allocate space for the code
  3499   ResourceMark rm;
  3487   ResourceMark rm;
  3500   // setup code generation tools
  3488   // setup code generation tools
  3585 // Generate a stub that calls into vm to find out the proper destination
  3573 // Generate a stub that calls into vm to find out the proper destination
  3586 // of a java call. All the argument registers are live at this point
  3574 // of a java call. All the argument registers are live at this point
  3587 // but since this is generic code we don't know what they are and the caller
  3575 // but since this is generic code we don't know what they are and the caller
  3588 // must do any gc of the args.
  3576 // must do any gc of the args.
  3589 //
  3577 //
  3590 static RuntimeStub* generate_resolve_blob(address destination, const char* name) {
  3578 RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const char* name) {
  3591   assert (StubRoutines::forward_exception_entry() != NULL, "must be generated before");
  3579   assert (StubRoutines::forward_exception_entry() != NULL, "must be generated before");
  3592 
  3580 
  3593   // allocate space for the code
  3581   // allocate space for the code
  3594   ResourceMark rm;
  3582   ResourceMark rm;
  3595   // setup code generation tools
  3583   // setup code generation tools
  3675 
  3663 
  3676   // return the  blob
  3664   // return the  blob
  3677   // frame_size_words or bytes??
  3665   // frame_size_words or bytes??
  3678   return RuntimeStub::new_runtime_stub(name, &buffer, frame_complete, frame_size_words, oop_maps, true);
  3666   return RuntimeStub::new_runtime_stub(name, &buffer, frame_complete, frame_size_words, oop_maps, true);
  3679 }
  3667 }
  3680 
       
  3681 void SharedRuntime::generate_stubs() {
       
  3682 
       
  3683   _wrong_method_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method),
       
  3684                                              "wrong_method_stub");
       
  3685 
       
  3686   _ic_miss_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method_ic_miss),
       
  3687                                         "ic_miss_stub");
       
  3688 
       
  3689   _resolve_opt_virtual_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_opt_virtual_call_C),
       
  3690                                         "resolve_opt_virtual_call");
       
  3691 
       
  3692   _resolve_virtual_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_virtual_call_C),
       
  3693                                         "resolve_virtual_call");
       
  3694 
       
  3695   _resolve_static_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_static_call_C),
       
  3696                                         "resolve_static_call");
       
  3697 
       
  3698   _polling_page_safepoint_handler_blob =
       
  3699     generate_handler_blob(CAST_FROM_FN_PTR(address,
       
  3700                    SafepointSynchronize::handle_polling_page_exception), false);
       
  3701 
       
  3702   _polling_page_return_handler_blob =
       
  3703     generate_handler_blob(CAST_FROM_FN_PTR(address,
       
  3704                    SafepointSynchronize::handle_polling_page_exception), true);
       
  3705 
       
  3706   generate_deopt_blob();
       
  3707 
       
  3708 #ifdef COMPILER2
       
  3709   generate_uncommon_trap_blob();
       
  3710 #endif // COMPILER2
       
  3711 }