Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/opto/runtime.cpp
          +++ new/src/share/vm/opto/runtime.cpp
↓ open down ↓ 98 lines elided ↑ open up ↑
  99   99  
 100  100  
 101  101  
 102  102  // Compiled code entry points
 103  103  address OptoRuntime::_new_instance_Java                           = NULL;
 104  104  address OptoRuntime::_new_array_Java                              = NULL;
 105  105  address OptoRuntime::_multianewarray2_Java                        = NULL;
 106  106  address OptoRuntime::_multianewarray3_Java                        = NULL;
 107  107  address OptoRuntime::_multianewarray4_Java                        = NULL;
 108  108  address OptoRuntime::_multianewarray5_Java                        = NULL;
      109 +address OptoRuntime::_multianewarrayN_Java                        = NULL;
 109  110  address OptoRuntime::_g1_wb_pre_Java                              = NULL;
 110  111  address OptoRuntime::_g1_wb_post_Java                             = NULL;
 111  112  address OptoRuntime::_vtable_must_compile_Java                    = NULL;
 112  113  address OptoRuntime::_complete_monitor_locking_Java               = NULL;
 113  114  address OptoRuntime::_rethrow_Java                                = NULL;
 114  115  
 115  116  address OptoRuntime::_slow_arraycopy_Java                         = NULL;
 116  117  address OptoRuntime::_register_finalizer_Java                     = NULL;
 117  118  
 118  119  # ifdef ENABLE_ZAP_DEAD_LOCALS
↓ open down ↓ 28 lines elided ↑ open up ↑
 147  148    // Note: tls: Means fetching the return oop out of the thread-local storage
 148  149    //
 149  150    //   variable/name                       type-function-gen              , runtime method                  ,fncy_jp, tls,save_args,retpc
 150  151    // -------------------------------------------------------------------------------------------------------------------------------
 151  152    gen(env, _new_instance_Java              , new_instance_Type            , new_instance_C                  ,    0 , true , false, false);
 152  153    gen(env, _new_array_Java                 , new_array_Type               , new_array_C                     ,    0 , true , false, false);
 153  154    gen(env, _multianewarray2_Java           , multianewarray2_Type         , multianewarray2_C               ,    0 , true , false, false);
 154  155    gen(env, _multianewarray3_Java           , multianewarray3_Type         , multianewarray3_C               ,    0 , true , false, false);
 155  156    gen(env, _multianewarray4_Java           , multianewarray4_Type         , multianewarray4_C               ,    0 , true , false, false);
 156  157    gen(env, _multianewarray5_Java           , multianewarray5_Type         , multianewarray5_C               ,    0 , true , false, false);
      158 +  gen(env, _multianewarrayN_Java           , multianewarrayN_Type         , multianewarrayN_C               ,    0 , true , false, false);
 157  159    gen(env, _g1_wb_pre_Java                 , g1_wb_pre_Type               , SharedRuntime::g1_wb_pre        ,    0 , false, false, false);
 158  160    gen(env, _g1_wb_post_Java                , g1_wb_post_Type              , SharedRuntime::g1_wb_post       ,    0 , false, false, false);
 159  161    gen(env, _complete_monitor_locking_Java  , complete_monitor_enter_Type  , SharedRuntime::complete_monitor_locking_C      ,    0 , false, false, false);
 160  162    gen(env, _rethrow_Java                   , rethrow_Type                 , rethrow_C                       ,    2 , true , false, true );
 161  163  
 162  164    gen(env, _slow_arraycopy_Java            , slow_arraycopy_Type          , SharedRuntime::slow_arraycopy_C ,    0 , false, false, false);
 163  165    gen(env, _register_finalizer_Java        , register_finalizer_Type      , register_finalizer              ,    0 , false, false, false);
 164  166  
 165  167  # ifdef ENABLE_ZAP_DEAD_LOCALS
 166  168    gen(env, _zap_dead_Java_locals_Java      , zap_dead_locals_Type         , zap_dead_Java_locals_C          ,    0 , false, true , false );
↓ open down ↓ 200 lines elided ↑ open up ↑
 367  369    dims[0] = len1;
 368  370    dims[1] = len2;
 369  371    dims[2] = len3;
 370  372    dims[3] = len4;
 371  373    dims[4] = len5;
 372  374    oop obj = arrayKlass::cast(elem_type)->multi_allocate(5, dims, THREAD);
 373  375    deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
 374  376    thread->set_vm_result(obj);
 375  377  JRT_END
 376  378  
      379 +JRT_ENTRY(void, OptoRuntime::multianewarrayN_C(klassOopDesc* elem_type, arrayOopDesc* dims, JavaThread *thread))
      380 +  assert(check_compiled_frame(thread), "incorrect caller");
      381 +  assert(oop(elem_type)->is_klass(), "not a class");
      382 +  assert(oop(dims)->is_typeArray(), "not an array");
      383 +  
      384 +  ResourceMark rm;
      385 +  jint len = dims->length();
      386 +  assert(len > 0, "Dimensions array should contain data");
      387 +  jint *j_dims = typeArrayOop(dims)->int_at_addr(0);
      388 +  jint *c_dims = NEW_RESOURCE_ARRAY(jint, len);
      389 +  Copy::conjoint_jints_atomic(j_dims, c_dims, len);
      390 +
      391 +  oop obj = arrayKlass::cast(elem_type)->multi_allocate(len, c_dims, THREAD);
      392 +  deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
      393 +  thread->set_vm_result(obj);
      394 +JRT_END
      395 +
      396 +
 377  397  const TypeFunc *OptoRuntime::new_instance_Type() {
 378  398    // create input type (domain)
 379  399    const Type **fields = TypeTuple::fields(1);
 380  400    fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Klass to be allocated
 381  401    const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+1, fields);
 382  402  
 383  403    // create result type (range)
 384  404    fields = TypeTuple::fields(1);
 385  405    fields[TypeFunc::Parms+0] = TypeRawPtr::NOTNULL; // Returned oop
 386  406  
↓ open down ↓ 60 lines elided ↑ open up ↑
 447  467  }
 448  468  
 449  469  const TypeFunc *OptoRuntime::multianewarray4_Type() {
 450  470    return multianewarray_Type(4);
 451  471  }
 452  472  
 453  473  const TypeFunc *OptoRuntime::multianewarray5_Type() {
 454  474    return multianewarray_Type(5);
 455  475  }
 456  476  
      477 +const TypeFunc *OptoRuntime::multianewarrayN_Type() {
      478 +  // create input type (domain)
      479 +  const Type **fields = TypeTuple::fields(2);
      480 +  fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL;   // element klass
      481 +  fields[TypeFunc::Parms+1] = TypeInstPtr::NOTNULL;   // array of dim sizes
      482 +  const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2, fields);
      483 +
      484 +  // create result type (range)
      485 +  fields = TypeTuple::fields(1);
      486 +  fields[TypeFunc::Parms+0] = TypeRawPtr::NOTNULL; // Returned oop
      487 +  const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+1, fields);
      488 +
      489 +  return TypeFunc::make(domain, range);
      490 +}
      491 +
 457  492  const TypeFunc *OptoRuntime::g1_wb_pre_Type() {
 458  493    const Type **fields = TypeTuple::fields(2);
 459  494    fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // original field value
 460  495    fields[TypeFunc::Parms+1] = TypeRawPtr::NOTNULL; // thread
 461  496    const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2, fields);
 462  497  
 463  498    // create result type (range)
 464  499    fields = TypeTuple::fields(0);
 465  500    const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
 466  501  
↓ open down ↓ 833 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX