Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/runtime/stubRoutines.cpp
          +++ new/src/share/vm/runtime/stubRoutines.cpp
   1    1  /*
   2      - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
        2 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
   3    3   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4    4   *
   5    5   * This code is free software; you can redistribute it and/or modify it
   6    6   * under the terms of the GNU General Public License version 2 only, as
   7    7   * published by the Free Software Foundation.
   8    8   *
   9    9   * This code is distributed in the hope that it will be useful, but WITHOUT
  10   10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11   11   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12   12   * version 2 for more details (a copy is included in the LICENSE file that
↓ open down ↓ 60 lines elided ↑ open up ↑
  73   73  
  74   74  jint    StubRoutines::_fpu_cntrl_wrd_std                        = 0;
  75   75  jint    StubRoutines::_fpu_cntrl_wrd_24                         = 0;
  76   76  jint    StubRoutines::_fpu_cntrl_wrd_64                         = 0;
  77   77  jint    StubRoutines::_fpu_cntrl_wrd_trunc                      = 0;
  78   78  jint    StubRoutines::_mxcsr_std                                = 0;
  79   79  jint    StubRoutines::_fpu_subnormal_bias1[3]                   = { 0, 0, 0 };
  80   80  jint    StubRoutines::_fpu_subnormal_bias2[3]                   = { 0, 0, 0 };
  81   81  
  82   82  // Compiled code entry points default values
  83      -// The dafault functions don't have separate disjoint versions.
       83 +// The default functions don't have separate disjoint versions.
  84   84  address StubRoutines::_jbyte_arraycopy          = CAST_FROM_FN_PTR(address, StubRoutines::jbyte_copy);
  85   85  address StubRoutines::_jshort_arraycopy         = CAST_FROM_FN_PTR(address, StubRoutines::jshort_copy);
  86   86  address StubRoutines::_jint_arraycopy           = CAST_FROM_FN_PTR(address, StubRoutines::jint_copy);
  87   87  address StubRoutines::_jlong_arraycopy          = CAST_FROM_FN_PTR(address, StubRoutines::jlong_copy);
  88   88  address StubRoutines::_oop_arraycopy            = CAST_FROM_FN_PTR(address, StubRoutines::oop_copy);
       89 +address StubRoutines::_oop_arraycopy_uninit     = CAST_FROM_FN_PTR(address, StubRoutines::oop_copy_uninit);
  89   90  address StubRoutines::_jbyte_disjoint_arraycopy          = CAST_FROM_FN_PTR(address, StubRoutines::jbyte_copy);
  90   91  address StubRoutines::_jshort_disjoint_arraycopy         = CAST_FROM_FN_PTR(address, StubRoutines::jshort_copy);
  91   92  address StubRoutines::_jint_disjoint_arraycopy           = CAST_FROM_FN_PTR(address, StubRoutines::jint_copy);
  92   93  address StubRoutines::_jlong_disjoint_arraycopy          = CAST_FROM_FN_PTR(address, StubRoutines::jlong_copy);
  93   94  address StubRoutines::_oop_disjoint_arraycopy            = CAST_FROM_FN_PTR(address, StubRoutines::oop_copy);
       95 +address StubRoutines::_oop_disjoint_arraycopy_uninit     = CAST_FROM_FN_PTR(address, StubRoutines::oop_copy_uninit);
  94   96  
  95   97  address StubRoutines::_arrayof_jbyte_arraycopy  = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jbyte_copy);
  96   98  address StubRoutines::_arrayof_jshort_arraycopy = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jshort_copy);
  97   99  address StubRoutines::_arrayof_jint_arraycopy   = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jint_copy);
  98  100  address StubRoutines::_arrayof_jlong_arraycopy  = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jlong_copy);
  99  101  address StubRoutines::_arrayof_oop_arraycopy    = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_oop_copy);
      102 +address StubRoutines::_arrayof_oop_arraycopy_uninit      = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_oop_copy_uninit);
 100  103  address StubRoutines::_arrayof_jbyte_disjoint_arraycopy  = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jbyte_copy);
 101  104  address StubRoutines::_arrayof_jshort_disjoint_arraycopy = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jshort_copy);
 102  105  address StubRoutines::_arrayof_jint_disjoint_arraycopy   = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jint_copy);
 103  106  address StubRoutines::_arrayof_jlong_disjoint_arraycopy  = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jlong_copy);
 104      -address StubRoutines::_arrayof_oop_disjoint_arraycopy  = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_oop_copy);
      107 +address StubRoutines::_arrayof_oop_disjoint_arraycopy    = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_oop_copy);
      108 +address StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit  = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_oop_copy_uninit);
      109 +
 105  110  
 106  111  address StubRoutines::_checkcast_arraycopy               = NULL;
      112 +address StubRoutines::_checkcast_arraycopy_uninit        = NULL;
 107  113  address StubRoutines::_unsafe_arraycopy                  = NULL;
 108  114  address StubRoutines::_generic_arraycopy                 = NULL;
 109  115  
 110  116  
 111  117  address StubRoutines::_jbyte_fill;
 112  118  address StubRoutines::_jshort_fill;
 113  119  address StubRoutines::_jint_fill;
 114  120  address StubRoutines::_arrayof_jbyte_fill;
 115  121  address StubRoutines::_arrayof_jshort_fill;
 116  122  address StubRoutines::_arrayof_jint_fill;
↓ open down ↓ 158 lines elided ↑ open up ↑
 275  281  }
 276  282  
 277  283  
 278  284  void stubRoutines_init1() { StubRoutines::initialize1(); }
 279  285  void stubRoutines_init2() { StubRoutines::initialize2(); }
 280  286  
 281  287  //
 282  288  // Default versions of arraycopy functions
 283  289  //
 284  290  
 285      -static void gen_arraycopy_barrier_pre(oop* dest, size_t count) {
      291 +static void gen_arraycopy_barrier_pre(oop* dest, size_t count, bool dest_uninitialized) {
 286  292      assert(count != 0, "count should be non-zero");
 287  293      assert(count <= (size_t)max_intx, "count too large");
 288  294      BarrierSet* bs = Universe::heap()->barrier_set();
 289  295      assert(bs->has_write_ref_array_pre_opt(), "Must have pre-barrier opt");
 290      -    bs->write_ref_array_pre(dest, (int)count);
      296 +    bs->write_ref_array_pre(dest, (int)count, dest_uninitialized);
 291  297  }
 292  298  
 293  299  static void gen_arraycopy_barrier(oop* dest, size_t count) {
 294  300      assert(count != 0, "count should be non-zero");
 295  301      BarrierSet* bs = Universe::heap()->barrier_set();
 296  302      assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt");
 297  303      bs->write_ref_array((HeapWord*)dest, count);
 298  304  }
 299  305  
 300  306  JRT_LEAF(void, StubRoutines::jbyte_copy(jbyte* src, jbyte* dest, size_t count))
↓ open down ↓ 22 lines elided ↑ open up ↑
 323  329    SharedRuntime::_jlong_array_copy_ctr++;      // Slow-path long/double array copy
 324  330  #endif // !PRODUCT
 325  331    Copy::conjoint_jlongs_atomic(src, dest, count);
 326  332  JRT_END
 327  333  
 328  334  JRT_LEAF(void, StubRoutines::oop_copy(oop* src, oop* dest, size_t count))
 329  335  #ifndef PRODUCT
 330  336    SharedRuntime::_oop_array_copy_ctr++;        // Slow-path oop array copy
 331  337  #endif // !PRODUCT
 332  338    assert(count != 0, "count should be non-zero");
 333      -  gen_arraycopy_barrier_pre(dest, count);
      339 +  gen_arraycopy_barrier_pre(dest, count, /*dest_uninitialized*/false);
      340 +  Copy::conjoint_oops_atomic(src, dest, count);
      341 +  gen_arraycopy_barrier(dest, count);
      342 +JRT_END
      343 +
      344 +JRT_LEAF(void, StubRoutines::oop_copy_uninit(oop* src, oop* dest, size_t count))
      345 +#ifndef PRODUCT
      346 +  SharedRuntime::_oop_array_copy_ctr++;        // Slow-path oop array copy
      347 +#endif // !PRODUCT
      348 +  assert(count != 0, "count should be non-zero");
      349 +  gen_arraycopy_barrier_pre(dest, count, /*dest_uninitialized*/true);
 334  350    Copy::conjoint_oops_atomic(src, dest, count);
 335  351    gen_arraycopy_barrier(dest, count);
 336  352  JRT_END
 337  353  
 338  354  JRT_LEAF(void, StubRoutines::arrayof_jbyte_copy(HeapWord* src, HeapWord* dest, size_t count))
 339  355  #ifndef PRODUCT
 340  356    SharedRuntime::_jbyte_array_copy_ctr++;      // Slow-path byte array copy
 341  357  #endif // !PRODUCT
 342  358    Copy::arrayof_conjoint_jbytes(src, dest, count);
 343  359  JRT_END
↓ open down ↓ 17 lines elided ↑ open up ↑
 361  377    SharedRuntime::_jlong_array_copy_ctr++;       // Slow-path int/float array copy
 362  378  #endif // !PRODUCT
 363  379    Copy::arrayof_conjoint_jlongs(src, dest, count);
 364  380  JRT_END
 365  381  
 366  382  JRT_LEAF(void, StubRoutines::arrayof_oop_copy(HeapWord* src, HeapWord* dest, size_t count))
 367  383  #ifndef PRODUCT
 368  384    SharedRuntime::_oop_array_copy_ctr++;        // Slow-path oop array copy
 369  385  #endif // !PRODUCT
 370  386    assert(count != 0, "count should be non-zero");
 371      -  gen_arraycopy_barrier_pre((oop *) dest, count);
      387 +  gen_arraycopy_barrier_pre((oop *) dest, count, /*dest_uninitialized*/false);
 372  388    Copy::arrayof_conjoint_oops(src, dest, count);
 373  389    gen_arraycopy_barrier((oop *) dest, count);
 374  390  JRT_END
 375  391  
      392 +JRT_LEAF(void, StubRoutines::arrayof_oop_copy_uninit(HeapWord* src, HeapWord* dest, size_t count))
      393 +#ifndef PRODUCT
      394 +  SharedRuntime::_oop_array_copy_ctr++;        // Slow-path oop array copy
      395 +#endif // !PRODUCT
      396 +  assert(count != 0, "count should be non-zero");
      397 +  gen_arraycopy_barrier_pre((oop *) dest, count, /*dest_uninitialized*/true);
      398 +  Copy::arrayof_conjoint_oops(src, dest, count);
      399 +  gen_arraycopy_barrier((oop *) dest, count);
      400 +JRT_END
 376  401  
 377  402  address StubRoutines::select_fill_function(BasicType t, bool aligned, const char* &name) {
 378  403  #define RETURN_STUB(xxx_fill) { \
 379  404    name = #xxx_fill; \
 380  405    return StubRoutines::xxx_fill(); }
 381  406  
 382  407    switch (t) {
 383  408    case T_BYTE:
 384  409    case T_BOOLEAN:
 385  410      if (!aligned) RETURN_STUB(jbyte_fill);
↓ open down ↓ 25 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX