hotspot/src/share/vm/opto/runtime.cpp
changeset 31856 614d6786ba55
parent 31590 427d073af867
child 32581 632402f18fe6
equal deleted inserted replaced
31855:1550546a6e8e 31856:614d6786ba55
    94 address OptoRuntime::_multianewarrayN_Java                        = NULL;
    94 address OptoRuntime::_multianewarrayN_Java                        = NULL;
    95 address OptoRuntime::_g1_wb_pre_Java                              = NULL;
    95 address OptoRuntime::_g1_wb_pre_Java                              = NULL;
    96 address OptoRuntime::_g1_wb_post_Java                             = NULL;
    96 address OptoRuntime::_g1_wb_post_Java                             = NULL;
    97 address OptoRuntime::_vtable_must_compile_Java                    = NULL;
    97 address OptoRuntime::_vtable_must_compile_Java                    = NULL;
    98 address OptoRuntime::_complete_monitor_locking_Java               = NULL;
    98 address OptoRuntime::_complete_monitor_locking_Java               = NULL;
       
    99 address OptoRuntime::_monitor_notify_Java                         = NULL;
       
   100 address OptoRuntime::_monitor_notifyAll_Java                      = NULL;
    99 address OptoRuntime::_rethrow_Java                                = NULL;
   101 address OptoRuntime::_rethrow_Java                                = NULL;
   100 
   102 
   101 address OptoRuntime::_slow_arraycopy_Java                         = NULL;
   103 address OptoRuntime::_slow_arraycopy_Java                         = NULL;
   102 address OptoRuntime::_register_finalizer_Java                     = NULL;
   104 address OptoRuntime::_register_finalizer_Java                     = NULL;
   103 
   105 
   142   gen(env, _multianewarray5_Java           , multianewarray5_Type         , multianewarray5_C               ,    0 , true , false, false);
   144   gen(env, _multianewarray5_Java           , multianewarray5_Type         , multianewarray5_C               ,    0 , true , false, false);
   143   gen(env, _multianewarrayN_Java           , multianewarrayN_Type         , multianewarrayN_C               ,    0 , true , false, false);
   145   gen(env, _multianewarrayN_Java           , multianewarrayN_Type         , multianewarrayN_C               ,    0 , true , false, false);
   144   gen(env, _g1_wb_pre_Java                 , g1_wb_pre_Type               , SharedRuntime::g1_wb_pre        ,    0 , false, false, false);
   146   gen(env, _g1_wb_pre_Java                 , g1_wb_pre_Type               , SharedRuntime::g1_wb_pre        ,    0 , false, false, false);
   145   gen(env, _g1_wb_post_Java                , g1_wb_post_Type              , SharedRuntime::g1_wb_post       ,    0 , false, false, false);
   147   gen(env, _g1_wb_post_Java                , g1_wb_post_Type              , SharedRuntime::g1_wb_post       ,    0 , false, false, false);
   146   gen(env, _complete_monitor_locking_Java  , complete_monitor_enter_Type  , SharedRuntime::complete_monitor_locking_C, 0, false, false, false);
   148   gen(env, _complete_monitor_locking_Java  , complete_monitor_enter_Type  , SharedRuntime::complete_monitor_locking_C, 0, false, false, false);
       
   149   gen(env, _monitor_notify_Java            , monitor_notify_Type          , monitor_notify_C                ,    0 , false, false, false);
       
   150   gen(env, _monitor_notifyAll_Java         , monitor_notify_Type          , monitor_notifyAll_C             ,    0 , false, false, false);
   147   gen(env, _rethrow_Java                   , rethrow_Type                 , rethrow_C                       ,    2 , true , false, true );
   151   gen(env, _rethrow_Java                   , rethrow_Type                 , rethrow_C                       ,    2 , true , false, true );
   148 
   152 
   149   gen(env, _slow_arraycopy_Java            , slow_arraycopy_Type          , SharedRuntime::slow_arraycopy_C ,    0 , false, false, false);
   153   gen(env, _slow_arraycopy_Java            , slow_arraycopy_Type          , SharedRuntime::slow_arraycopy_C ,    0 , false, false, false);
   150   gen(env, _register_finalizer_Java        , register_finalizer_Type      , register_finalizer              ,    0 , false, false, false);
   154   gen(env, _register_finalizer_Java        , register_finalizer_Type      , register_finalizer              ,    0 , false, false, false);
   151 
   155 
   424   oop obj = ArrayKlass::cast(elem_type)->multi_allocate(len, c_dims, THREAD);
   428   oop obj = ArrayKlass::cast(elem_type)->multi_allocate(len, c_dims, THREAD);
   425   deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
   429   deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
   426   thread->set_vm_result(obj);
   430   thread->set_vm_result(obj);
   427 JRT_END
   431 JRT_END
   428 
   432 
       
   433 JRT_BLOCK_ENTRY(void, OptoRuntime::monitor_notify_C(oopDesc* obj, JavaThread *thread))
       
   434 
       
   435   // Very few notify/notifyAll operations find any threads on the waitset, so
       
   436   // the dominant fast-path is to simply return.
       
   437   // Relatedly, it's critical that notify/notifyAll be fast in order to
       
   438   // reduce lock hold times.
       
   439   if (!SafepointSynchronize::is_synchronizing()) {
       
   440     if (ObjectSynchronizer::quick_notify(obj, thread, false)) {
       
   441       return;
       
   442     }
       
   443   }
       
   444 
       
   445   // This is the case the fast-path above isn't provisioned to handle.
       
   446   // The fast-path is designed to handle frequently arising cases in an efficient manner.
       
   447   // (The fast-path is just a degenerate variant of the slow-path).
       
   448   // Perform the dreaded state transition and pass control into the slow-path.
       
   449   JRT_BLOCK;
       
   450   Handle h_obj(THREAD, obj);
       
   451   ObjectSynchronizer::notify(h_obj, CHECK);
       
   452   JRT_BLOCK_END;
       
   453 JRT_END
       
   454 
       
   455 JRT_BLOCK_ENTRY(void, OptoRuntime::monitor_notifyAll_C(oopDesc* obj, JavaThread *thread))
       
   456 
       
   457   if (!SafepointSynchronize::is_synchronizing() ) {
       
   458     if (ObjectSynchronizer::quick_notify(obj, thread, true)) {
       
   459       return;
       
   460     }
       
   461   }
       
   462 
       
   463   // This is the case the fast-path above isn't provisioned to handle.
       
   464   // The fast-path is designed to handle frequently arising cases in an efficient manner.
       
   465   // (The fast-path is just a degenerate variant of the slow-path).
       
   466   // Perform the dreaded state transition and pass control into the slow-path.
       
   467   JRT_BLOCK;
       
   468   Handle h_obj(THREAD, obj);
       
   469   ObjectSynchronizer::notifyall(h_obj, CHECK);
       
   470   JRT_BLOCK_END;
       
   471 JRT_END
   429 
   472 
   430 const TypeFunc *OptoRuntime::new_instance_Type() {
   473 const TypeFunc *OptoRuntime::new_instance_Type() {
   431   // create input type (domain)
   474   // create input type (domain)
   432   const Type **fields = TypeTuple::fields(1);
   475   const Type **fields = TypeTuple::fields(1);
   433   fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Klass to be allocated
   476   fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Klass to be allocated
   602   // create input type (domain)
   645   // create input type (domain)
   603   const Type **fields = TypeTuple::fields(3);
   646   const Type **fields = TypeTuple::fields(3);
   604   fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL;  // Object to be Locked
   647   fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL;  // Object to be Locked
   605   fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM;    // Address of stack location for lock - BasicLock
   648   fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM;    // Address of stack location for lock - BasicLock
   606   fields[TypeFunc::Parms+2] = TypeRawPtr::BOTTOM;    // Thread pointer (Self)
   649   fields[TypeFunc::Parms+2] = TypeRawPtr::BOTTOM;    // Thread pointer (Self)
   607   const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+3,fields);
   650   const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+3, fields);
   608 
   651 
   609   // create result type (range)
   652   // create result type (range)
   610   fields = TypeTuple::fields(0);
   653   fields = TypeTuple::fields(0);
   611 
   654 
   612   const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0,fields);
   655   const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
   613 
   656 
   614   return TypeFunc::make(domain,range);
   657   return TypeFunc::make(domain, range);
       
   658 }
       
   659 
       
   660 const TypeFunc *OptoRuntime::monitor_notify_Type() {
       
   661   // create input type (domain)
       
   662   const Type **fields = TypeTuple::fields(1);
       
   663   fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL;  // Object to be Locked
       
   664   const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+1, fields);
       
   665 
       
   666   // create result type (range)
       
   667   fields = TypeTuple::fields(0);
       
   668   const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
       
   669   return TypeFunc::make(domain, range);
   615 }
   670 }
   616 
   671 
   617 const TypeFunc* OptoRuntime::flush_windows_Type() {
   672 const TypeFunc* OptoRuntime::flush_windows_Type() {
   618   // create input type (domain)
   673   // create input type (domain)
   619   const Type** fields = TypeTuple::fields(1);
   674   const Type** fields = TypeTuple::fields(1);