hotspot/src/share/vm/oops/objArrayKlass.cpp
author bpittore
Wed, 24 Jun 2015 12:12:25 -0400
changeset 31592 43f48e165466
parent 30764 fec48bf5a827
child 33611 9abd65805e19
permissions -rw-r--r--
8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier" Summary: Need to add a space between macro identifier and string literal Reviewed-by: stefank, dholmes, kbarrett
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
29081
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents: 27680
diff changeset
     2
 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5076
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5076
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5076
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    25
#include "precompiled.hpp"
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    26
#include "classfile/symbolTable.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    27
#include "classfile/systemDictionary.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    28
#include "classfile/vmSymbols.hpp"
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30150
diff changeset
    29
#include "gc/shared/collectedHeap.inline.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30150
diff changeset
    30
#include "gc/shared/specialized_oop_closures.hpp"
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 24351
diff changeset
    31
#include "memory/iterator.inline.hpp"
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    32
#include "memory/metadataFactory.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    33
#include "memory/resourceArea.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    34
#include "memory/universe.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    35
#include "oops/instanceKlass.hpp"
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    36
#include "oops/klass.inline.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    37
#include "oops/objArrayKlass.inline.hpp"
29081
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents: 27680
diff changeset
    38
#include "oops/objArrayOop.inline.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    39
#include "oops/oop.inline.hpp"
8076
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7890
diff changeset
    40
#include "oops/symbol.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    41
#include "runtime/handles.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    42
#include "runtime/mutexLocker.hpp"
24351
61b33cc6d3cf 8042195: Introduce umbrella header orderAccess.inline.hpp.
goetz
parents: 23841
diff changeset
    43
#include "runtime/orderAccess.inline.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    44
#include "utilities/copy.hpp"
15482
470d0b0c09f1 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 14588
diff changeset
    45
#include "utilities/macros.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    47
ObjArrayKlass* ObjArrayKlass::allocate(ClassLoaderData* loader_data, int n, KlassHandle klass_handle, Symbol* name, TRAPS) {
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    48
  assert(ObjArrayKlass::header_size() <= InstanceKlass::header_size(),
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    49
      "array klasses must be same size as InstanceKlass");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    50
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    51
  int size = ArrayKlass::static_size(ObjArrayKlass::header_size());
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    52
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    53
  return new (loader_data, size, THREAD) ObjArrayKlass(n, klass_handle, name);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    54
}
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    55
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    56
Klass* ObjArrayKlass::allocate_objArray_klass(ClassLoaderData* loader_data,
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    57
                                                int n, KlassHandle element_klass, TRAPS) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    58
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    59
  // Eagerly allocate the direct array supertype.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    60
  KlassHandle super_klass = KlassHandle();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    61
  if (!Universe::is_bootstrapping() || SystemDictionary::Object_klass_loaded()) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    62
    KlassHandle element_super (THREAD, element_klass->super());
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    63
    if (element_super.not_null()) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    64
      // The element type has a direct super.  E.g., String[] has direct super of Object[].
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    65
      super_klass = KlassHandle(THREAD, element_super->array_klass_or_null());
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    66
      bool supers_exist = super_klass.not_null();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    67
      // Also, see if the element has secondary supertypes.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    68
      // We need an array type for each.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    69
      Array<Klass*>* element_supers = element_klass->secondary_supers();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    70
      for( int i = element_supers->length()-1; i >= 0; i-- ) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    71
        Klass* elem_super = element_supers->at(i);
14488
ab48109f7d1b 8001471: Klass::cast() does nothing
hseigel
parents: 13961
diff changeset
    72
        if (elem_super->array_klass_or_null() == NULL) {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    73
          supers_exist = false;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    74
          break;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    75
        }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    76
      }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    77
      if (!supers_exist) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    78
        // Oops.  Not allocated yet.  Back out, allocate it, and retry.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    79
        KlassHandle ek;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    80
        {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    81
          MutexUnlocker mu(MultiArray_lock);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    82
          MutexUnlocker mc(Compile_lock);   // for vtables
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    83
          Klass* sk = element_super->array_klass(CHECK_0);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    84
          super_klass = KlassHandle(THREAD, sk);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    85
          for( int i = element_supers->length()-1; i >= 0; i-- ) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    86
            KlassHandle elem_super (THREAD, element_supers->at(i));
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    87
            elem_super->array_klass(CHECK_0);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    88
          }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    89
          // Now retry from the beginning
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    90
          Klass* klass_oop = element_klass->array_klass(n, CHECK_0);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    91
          // Create a handle because the enclosing brace, when locking
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    92
          // can cause a gc.  Better to have this function return a Handle.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    93
          ek = KlassHandle(THREAD, klass_oop);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    94
        }  // re-lock
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    95
        return ek();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    96
      }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    97
    } else {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    98
      // The element type is already Object.  Object[] has direct super of Object.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    99
      super_klass = KlassHandle(THREAD, SystemDictionary::Object_klass());
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   100
    }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   101
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   102
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   103
  // Create type name for klass.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   104
  Symbol* name = NULL;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   105
  if (!element_klass->oop_is_instance() ||
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   106
      (name = InstanceKlass::cast(element_klass())->array_name()) == NULL) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   107
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   108
    ResourceMark rm(THREAD);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   109
    char *name_str = element_klass->name()->as_C_string();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   110
    int len = element_klass->name()->utf8_length();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   111
    char *new_str = NEW_RESOURCE_ARRAY(char, len + 4);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   112
    int idx = 0;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   113
    new_str[idx++] = '[';
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   114
    if (element_klass->oop_is_instance()) { // it could be an array or simple type
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   115
      new_str[idx++] = 'L';
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   116
    }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   117
    memcpy(&new_str[idx], name_str, len * sizeof(char));
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   118
    idx += len;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   119
    if (element_klass->oop_is_instance()) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   120
      new_str[idx++] = ';';
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   121
    }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   122
    new_str[idx++] = '\0';
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   123
    name = SymbolTable::new_permanent_symbol(new_str, CHECK_0);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   124
    if (element_klass->oop_is_instance()) {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   125
      InstanceKlass* ik = InstanceKlass::cast(element_klass());
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   126
      ik->set_array_name(name);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   127
    }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   128
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   129
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   130
  // Initialize instance variables
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   131
  ObjArrayKlass* oak = ObjArrayKlass::allocate(loader_data, n, element_klass, name, CHECK_0);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   132
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   133
  // Add all classes to our internal class loader list here,
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   134
  // including classes in the bootstrap (NULL) class loader.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   135
  // GC walks these as strong roots.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   136
  loader_data->add_class(oak);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   137
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   138
  // Call complete_create_array_klass after all instance variables has been initialized.
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   139
  ArrayKlass::complete_create_array_klass(oak, super_klass, CHECK_0);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   140
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   141
  return oak;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   142
}
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   143
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   144
ObjArrayKlass::ObjArrayKlass(int n, KlassHandle element_klass, Symbol* name) : ArrayKlass(name) {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   145
  this->set_dimension(n);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   146
  this->set_element_klass(element_klass());
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   147
  // decrement refcount because object arrays are not explicitly freed.  The
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   148
  // InstanceKlass array_name() keeps the name counted while the klass is
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   149
  // loaded.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   150
  name->decrement_refcount();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   151
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   152
  Klass* bk;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   153
  if (element_klass->oop_is_objArray()) {
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   154
    bk = ObjArrayKlass::cast(element_klass())->bottom_klass();
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   155
  } else {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   156
    bk = element_klass();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   157
  }
14488
ab48109f7d1b 8001471: Klass::cast() does nothing
hseigel
parents: 13961
diff changeset
   158
  assert(bk != NULL && (bk->oop_is_instance() || bk->oop_is_typeArray()), "invalid bottom klass");
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   159
  this->set_bottom_klass(bk);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   160
  this->set_class_loader_data(bk->class_loader_data());
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   161
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   162
  this->set_layout_helper(array_layout_helper(T_OBJECT));
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   163
  assert(this->oop_is_array(), "sanity");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   164
  assert(this->oop_is_objArray(), "sanity");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   165
}
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   166
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   167
int ObjArrayKlass::oop_size(oop obj) const {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  assert(obj->is_objArray(), "must be object array");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  return objArrayOop(obj)->object_size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   172
objArrayOop ObjArrayKlass::allocate(int length, TRAPS) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  if (length >= 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
    if (length <= arrayOopDesc::max_array_length(T_OBJECT)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
      int size = objArrayOopDesc::object_size(length);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   176
      KlassHandle h_k(THREAD, this);
27680
8ecc0871c18e 8064811: Use THREAD instead of CHECK_NULL in return statements
stefank
parents: 26316
diff changeset
   177
      return (objArrayOop)CollectedHeap::array_allocate(h_k, size, length, THREAD);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
    } else {
3576
4ceec8fb3e18 6850957: Honor -XX:OnOutOfMemoryError when array size exceeds VM limit
martin
parents: 2332
diff changeset
   179
      report_java_out_of_memory("Requested array size exceeds VM limit");
12114
9a825a536095 7123170: JCK vm/jvmti/ResourceExhausted/resexh001/resexh00101/ tests fails since 7u4 b02
sspitsyn
parents: 8297
diff changeset
   180
      JvmtiExport::post_array_size_exhausted();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
      THROW_OOP_0(Universe::out_of_memory_error_array_size());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
    THROW_0(vmSymbols::java_lang_NegativeArraySizeException());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
static int multi_alloc_counter = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   190
oop ObjArrayKlass::multi_allocate(int rank, jint* sizes, TRAPS) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  int length = *sizes;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  // Call to lower_dimension uses this pointer, so most be called before a
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  // possible GC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
  KlassHandle h_lower_dimension(THREAD, lower_dimension());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
  // If length < 0 allocate will throw an exception.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  objArrayOop array = allocate(length, CHECK_NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  objArrayHandle h_array (THREAD, array);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
  if (rank > 1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
    if (length != 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
      for (int index = 0; index < length; index++) {
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   201
        ArrayKlass* ak = ArrayKlass::cast(h_lower_dimension());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
        oop sub_array = ak->multi_allocate(rank-1, &sizes[1], CHECK_NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
        h_array->obj_at_put(index, sub_array);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
      // Since this array dimension has zero length, nothing will be
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
      // allocated, however the lower dimension values must be checked
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
      // for illegal values.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
      for (int i = 0; i < rank - 1; ++i) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
        sizes += 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
        if (*sizes < 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
          THROW_0(vmSymbols::java_lang_NegativeArraySizeException());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  return h_array();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   220
// Either oop or narrowOop depending on UseCompressedOops.
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   221
template <class T> void ObjArrayKlass::do_copy(arrayOop s, T* src,
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   222
                               arrayOop d, T* dst, int length, TRAPS) {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   223
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   224
  BarrierSet* bs = Universe::heap()->barrier_set();
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   225
  // For performance reasons, we assume we are that the write barrier we
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   226
  // are using has optimized modes for arrays of references.  At least one
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   227
  // of the asserts below will fail if this is not the case.
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   228
  assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt");
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   229
  assert(bs->has_write_ref_array_pre_opt(), "For pre-barrier as well.");
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   230
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   231
  if (s == d) {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   232
    // since source and destination are equal we do not need conversion checks.
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   233
    assert(length > 0, "sanity check");
3262
30d1c247fc25 6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents: 2332
diff changeset
   234
    bs->write_ref_array_pre(dst, length);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   235
    Copy::conjoint_oops_atomic(src, dst, length);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   236
  } else {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   237
    // We have to make sure all elements conform to the destination array
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   238
    Klass* bound = ObjArrayKlass::cast(d->klass())->element_klass();
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   239
    Klass* stype = ObjArrayKlass::cast(s->klass())->element_klass();
14488
ab48109f7d1b 8001471: Klass::cast() does nothing
hseigel
parents: 13961
diff changeset
   240
    if (stype == bound || stype->is_subtype_of(bound)) {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   241
      // elements are guaranteed to be subtypes, so no check necessary
3262
30d1c247fc25 6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents: 2332
diff changeset
   242
      bs->write_ref_array_pre(dst, length);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   243
      Copy::conjoint_oops_atomic(src, dst, length);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   244
    } else {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   245
      // slow case: need individual subtype checks
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   246
      // note: don't use obj_at_put below because it includes a redundant store check
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   247
      T* from = src;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   248
      T* end = from + length;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   249
      for (T* p = dst; from < end; from++, p++) {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   250
        // XXX this is going to be slow.
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   251
        T element = *from;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   252
        // even slower now
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   253
        bool element_is_null = oopDesc::is_null(element);
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   254
        oop new_val = element_is_null ? oop(NULL)
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   255
                                      : oopDesc::decode_heap_oop_not_null(element);
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   256
        if (element_is_null ||
14488
ab48109f7d1b 8001471: Klass::cast() does nothing
hseigel
parents: 13961
diff changeset
   257
            (new_val->klass())->is_subtype_of(bound)) {
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   258
          bs->write_ref_field_pre(p, new_val);
23841
f861d5d148bf 8029858: Enhance array copies
dsimms
parents: 22794
diff changeset
   259
          *p = element;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   260
        } else {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   261
          // We must do a barrier to cover the partial copy.
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   262
          const size_t pd = pointer_delta(p, dst, (size_t)heapOopSize);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   263
          // pointer delta is scaled to number of elements (length field in
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   264
          // objArrayOop) which we assume is 32 bit.
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   265
          assert(pd == (size_t)(int)pd, "length field overflow");
4461
c17c526d36ef 6906727: UseCompressedOops: some card-marking fixes related to object arrays
ysr
parents: 3579
diff changeset
   266
          bs->write_ref_array((HeapWord*)dst, pd);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   267
          THROW(vmSymbols::java_lang_ArrayStoreException());
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   268
          return;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   269
        }
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   270
      }
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   271
    }
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   272
  }
4461
c17c526d36ef 6906727: UseCompressedOops: some card-marking fixes related to object arrays
ysr
parents: 3579
diff changeset
   273
  bs->write_ref_array((HeapWord*)dst, length);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   274
}
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   275
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   276
void ObjArrayKlass::copy_array(arrayOop s, int src_pos, arrayOop d,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
                               int dst_pos, int length, TRAPS) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
  assert(s->is_objArray(), "must be obj array");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
  if (!d->is_objArray()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
    THROW(vmSymbols::java_lang_ArrayStoreException());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
  // Check is all offsets and lengths are non negative
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
  if (src_pos < 0 || dst_pos < 0 || length < 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
    THROW(vmSymbols::java_lang_ArrayIndexOutOfBoundsException());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
  // Check if the ranges are valid
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
  if  ( (((unsigned int) length + (unsigned int) src_pos) > (unsigned int) s->length())
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
     || (((unsigned int) length + (unsigned int) dst_pos) > (unsigned int) d->length()) ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
    THROW(vmSymbols::java_lang_ArrayIndexOutOfBoundsException());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
  // Special case. Boundary cases must be checked first
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
  // This allows the following call: copy_array(s, s.length(), d.length(), 0).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
  // This is correct, since the position is supposed to be an 'in between point', i.e., s.length(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
  // points to the right of the last element.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
  if (length==0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
    return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
  }
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   301
  if (UseCompressedOops) {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   302
    narrowOop* const src = objArrayOop(s)->obj_at_addr<narrowOop>(src_pos);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   303
    narrowOop* const dst = objArrayOop(d)->obj_at_addr<narrowOop>(dst_pos);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   304
    do_copy<narrowOop>(s, src, d, dst, length, CHECK);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  } else {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   306
    oop* const src = objArrayOop(s)->obj_at_addr<oop>(src_pos);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   307
    oop* const dst = objArrayOop(d)->obj_at_addr<oop>(dst_pos);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   308
    do_copy<oop> (s, src, d, dst, length, CHECK);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   313
Klass* ObjArrayKlass::array_klass_impl(bool or_null, int n, TRAPS) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   315
  assert(dimension() <= n, "check order of chain");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   316
  int dim = dimension();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   317
  if (dim == n) return this;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   319
  if (higher_dimension() == NULL) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
    if (or_null)  return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
    ResourceMark rm;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
    JavaThread *jt = (JavaThread *)THREAD;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
    {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
      MutexLocker mc(Compile_lock, THREAD);   // for vtables
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
      // Ensure atomic creation of higher dimensions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
      MutexLocker mu(MultiArray_lock, THREAD);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
      // Check if another thread beat us
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   330
      if (higher_dimension() == NULL) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
        // Create multi-dim klass object and link them together
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   333
        Klass* k =
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   334
          ObjArrayKlass::allocate_objArray_klass(class_loader_data(), dim + 1, this, CHECK_NULL);
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   335
        ObjArrayKlass* ak = ObjArrayKlass::cast(k);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   336
        ak->set_lower_dimension(this);
7890
7d1d76674e2e 7011386: race in objArrayKlass::array_klass_impl
kvn
parents: 7397
diff changeset
   337
        OrderAccess::storestore();
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   338
        set_higher_dimension(ak);
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   339
        assert(ak->oop_is_objArray(), "incorrect initialization of ObjArrayKlass");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
    CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   346
  ObjArrayKlass *ak = ObjArrayKlass::cast(higher_dimension());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
  if (or_null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
    return ak->array_klass_or_null(n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
  }
27680
8ecc0871c18e 8064811: Use THREAD instead of CHECK_NULL in return statements
stefank
parents: 26316
diff changeset
   350
  return ak->array_klass(n, THREAD);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   353
Klass* ObjArrayKlass::array_klass_impl(bool or_null, TRAPS) {
27680
8ecc0871c18e 8064811: Use THREAD instead of CHECK_NULL in return statements
stefank
parents: 26316
diff changeset
   354
  return array_klass_impl(or_null, dimension() +  1, THREAD);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   357
bool ObjArrayKlass::can_be_primary_super_slow() const {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   358
  if (!bottom_klass()->can_be_primary_super())
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
    // array of interfaces
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
    return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
  else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
    return Klass::can_be_primary_super_slow();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   365
GrowableArray<Klass*>* ObjArrayKlass::compute_secondary_supers(int num_extra_slots) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
  // interfaces = { cloneable_klass, serializable_klass, elemSuper[], ... };
14488
ab48109f7d1b 8001471: Klass::cast() does nothing
hseigel
parents: 13961
diff changeset
   367
  Array<Klass*>* elem_supers = element_klass()->secondary_supers();
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   368
  int num_elem_supers = elem_supers == NULL ? 0 : elem_supers->length();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
  int num_secondaries = num_extra_slots + 2 + num_elem_supers;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
  if (num_secondaries == 2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
    // Must share this for correct bootstrapping!
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   372
    set_secondary_supers(Universe::the_array_interfaces_array());
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   373
    return NULL;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
  } else {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   375
    GrowableArray<Klass*>* secondaries = new GrowableArray<Klass*>(num_elem_supers+2);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   376
    secondaries->push(SystemDictionary::Cloneable_klass());
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   377
    secondaries->push(SystemDictionary::Serializable_klass());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
    for (int i = 0; i < num_elem_supers; i++) {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   379
      Klass* elem_super = (Klass*) elem_supers->at(i);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   380
      Klass* array_super = elem_super->array_klass_or_null();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
      assert(array_super != NULL, "must already have been created");
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   382
      secondaries->push(array_super);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
    }
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   384
    return secondaries;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   388
bool ObjArrayKlass::compute_is_subtype_of(Klass* k) {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   389
  if (!k->oop_is_objArray())
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   390
    return ArrayKlass::compute_is_subtype_of(k);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   392
  ObjArrayKlass* oak = ObjArrayKlass::cast(k);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   393
  return element_klass()->is_subtype_of(oak->element_klass());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   396
void ObjArrayKlass::initialize(TRAPS) {
14488
ab48109f7d1b 8001471: Klass::cast() does nothing
hseigel
parents: 13961
diff changeset
   397
  bottom_klass()->initialize(THREAD);  // dispatches to either InstanceKlass or TypeArrayKlass
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
// JVM support
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   402
jint ObjArrayKlass::compute_modifier_flags(TRAPS) const {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
  // The modifier for an objectArray is the same as its element
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
  if (element_klass() == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
    assert(Universe::is_bootstrapping(), "partial objArray only at startup");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
    return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
  }
1430
16aa7ef1ffa1 6700107: java/lang/Class/forName/TooManyDimensions.java crashes with SIGSEGV in c2 compiler with fastdebug
coleenp
parents: 1388
diff changeset
   408
  // Return the flags of the bottom element type.
14488
ab48109f7d1b 8001471: Klass::cast() does nothing
hseigel
parents: 13961
diff changeset
   409
  jint element_flags = bottom_klass()->compute_modifier_flags(CHECK_0);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
  return (element_flags & (JVM_ACC_PUBLIC | JVM_ACC_PRIVATE | JVM_ACC_PROTECTED))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
                        | (JVM_ACC_ABSTRACT | JVM_ACC_FINAL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   416
// Printing
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   417
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   418
void ObjArrayKlass::print_on(outputStream* st) const {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
#ifndef PRODUCT
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   420
  Klass::print_on(st);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   421
  st->print(" - instance klass: ");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   422
  element_klass()->print_value_on(st);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   423
  st->cr();
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   424
#endif //PRODUCT
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   425
}
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   426
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   427
void ObjArrayKlass::print_value_on(outputStream* st) const {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   428
  assert(is_klass(), "must be klass");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   429
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   430
  element_klass()->print_value_on(st);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   431
  st->print("[]");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   432
}
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   433
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   434
#ifndef PRODUCT
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   436
void ObjArrayKlass::oop_print_on(oop obj, outputStream* st) {
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   437
  ArrayKlass::oop_print_on(obj, st);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
  assert(obj->is_objArray(), "must be objArray");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   439
  objArrayOop oa = objArrayOop(obj);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
  int print_len = MIN2((intx) oa->length(), MaxElementPrintSize);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
  for(int index = 0; index < print_len; index++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   442
    st->print(" - %3d : ", index);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
    oa->obj_at(index)->print_value_on(st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
    st->cr();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
  int remaining = oa->length() - print_len;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
  if (remaining > 0) {
13922
ab7d352debe6 8000227: [obj|type]ArrayKlass::oop_print_on prints one line to tty instead of the provided output stream
stefank
parents: 13728
diff changeset
   448
    st->print_cr(" - <%d more elements, increase MaxElementPrintSize to print>", remaining);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
4584
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 4571
diff changeset
   452
#endif //PRODUCT
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 4571
diff changeset
   453
2332
5c7b6f4ce0a1 6814659: separable cleanups and subroutines for 6655638
jrose
parents: 1430
diff changeset
   454
static int max_objArray_print_length = 4;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   456
void ObjArrayKlass::oop_print_value_on(oop obj, outputStream* st) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
  assert(obj->is_objArray(), "must be objArray");
2332
5c7b6f4ce0a1 6814659: separable cleanups and subroutines for 6655638
jrose
parents: 1430
diff changeset
   458
  st->print("a ");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
  element_klass()->print_value_on(st);
2332
5c7b6f4ce0a1 6814659: separable cleanups and subroutines for 6655638
jrose
parents: 1430
diff changeset
   460
  int len = objArrayOop(obj)->length();
5c7b6f4ce0a1 6814659: separable cleanups and subroutines for 6655638
jrose
parents: 1430
diff changeset
   461
  st->print("[%d] ", len);
5c7b6f4ce0a1 6814659: separable cleanups and subroutines for 6655638
jrose
parents: 1430
diff changeset
   462
  obj->print_address_on(st);
4584
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 4571
diff changeset
   463
  if (NOT_PRODUCT(PrintOopAddress ||) PrintMiscellaneous && (WizardMode || Verbose)) {
2332
5c7b6f4ce0a1 6814659: separable cleanups and subroutines for 6655638
jrose
parents: 1430
diff changeset
   464
    st->print("{");
5c7b6f4ce0a1 6814659: separable cleanups and subroutines for 6655638
jrose
parents: 1430
diff changeset
   465
    for (int i = 0; i < len; i++) {
5c7b6f4ce0a1 6814659: separable cleanups and subroutines for 6655638
jrose
parents: 1430
diff changeset
   466
      if (i > max_objArray_print_length) {
5c7b6f4ce0a1 6814659: separable cleanups and subroutines for 6655638
jrose
parents: 1430
diff changeset
   467
        st->print("..."); break;
5c7b6f4ce0a1 6814659: separable cleanups and subroutines for 6655638
jrose
parents: 1430
diff changeset
   468
      }
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   469
      st->print(" " INTPTR_FORMAT, (intptr_t)(void*)objArrayOop(obj)->obj_at(i));
2332
5c7b6f4ce0a1 6814659: separable cleanups and subroutines for 6655638
jrose
parents: 1430
diff changeset
   470
    }
5c7b6f4ce0a1 6814659: separable cleanups and subroutines for 6655638
jrose
parents: 1430
diff changeset
   471
    st->print(" }");
5c7b6f4ce0a1 6814659: separable cleanups and subroutines for 6655638
jrose
parents: 1430
diff changeset
   472
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   475
const char* ObjArrayKlass::internal_name() const {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
  return external_name();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   477
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   478
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   479
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   480
// Verification
489c9b5090e2 Initial load
duke
parents:
diff changeset
   481
22794
f1c014ad3754 8027146: Class loading verification failure if GC occurs in Universe::flush_dependents_on
coleenp
parents: 22234
diff changeset
   482
void ObjArrayKlass::verify_on(outputStream* st) {
f1c014ad3754 8027146: Class loading verification failure if GC occurs in Universe::flush_dependents_on
coleenp
parents: 22234
diff changeset
   483
  ArrayKlass::verify_on(st);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   484
  guarantee(element_klass()->is_klass(), "should be klass");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   485
  guarantee(bottom_klass()->is_klass(), "should be klass");
14488
ab48109f7d1b 8001471: Klass::cast() does nothing
hseigel
parents: 13961
diff changeset
   486
  Klass* bk = bottom_klass();
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   487
  guarantee(bk->oop_is_instance() || bk->oop_is_typeArray(),  "invalid bottom klass");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   488
}
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   489
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   490
void ObjArrayKlass::oop_verify_on(oop obj, outputStream* st) {
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   491
  ArrayKlass::oop_verify_on(obj, st);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
  guarantee(obj->is_objArray(), "must be objArray");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
  objArrayOop oa = objArrayOop(obj);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
  for(int index = 0; index < oa->length(); index++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
    guarantee(oa->obj_at(index)->is_oop_or_null(), "should be oop");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   496
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
}