hotspot/src/share/vm/memory/oopFactory.cpp
changeset 46257 3e95288ce4ca
parent 33611 9abd65805e19
child 46271 979ebd346ecf
equal deleted inserted replaced
43605:07baf498d588 46257:3e95288ce4ca
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    55   TypeArrayKlass* type_asArrayKlass = TypeArrayKlass::cast(type_asKlassOop);
    55   TypeArrayKlass* type_asArrayKlass = TypeArrayKlass::cast(type_asKlassOop);
    56   typeArrayOop result = type_asArrayKlass->allocate(length, THREAD);
    56   typeArrayOop result = type_asArrayKlass->allocate(length, THREAD);
    57   return result;
    57   return result;
    58 }
    58 }
    59 
    59 
    60 // Create a Java array that points to metadata.
    60 // Create a Java array that points to Symbol.
    61 // As far as Java code is concerned, a metaData array is either an array of
    61 // As far as Java code is concerned, a Symbol array is either an array of
    62 // int or long depending on pointer size.  Only a few things use this, like
    62 // int or long depending on pointer size.  Only stack trace elements in Throwable use
    63 // stack trace elements in Throwable.  They cast Method* into this type.
    63 // this.  They cast Symbol* into this type.
    64 // Note:can't point to symbols because there's no way to unreference count
    64 typeArrayOop oopFactory::new_symbolArray(int length, TRAPS) {
    65 // them when this object goes away.
       
    66 typeArrayOop oopFactory::new_metaDataArray(int length, TRAPS) {
       
    67   BasicType type = LP64_ONLY(T_LONG) NOT_LP64(T_INT);
    65   BasicType type = LP64_ONLY(T_LONG) NOT_LP64(T_INT);
    68   Klass* type_asKlassOop = Universe::typeArrayKlassObj(type);
    66   Klass* type_asKlassOop = Universe::typeArrayKlassObj(type);
    69   TypeArrayKlass* type_asArrayKlass = TypeArrayKlass::cast(type_asKlassOop);
    67   TypeArrayKlass* type_asArrayKlass = TypeArrayKlass::cast(type_asKlassOop);
    70   typeArrayOop result = type_asArrayKlass->allocate_common(length, true, THREAD);
    68   typeArrayOop result = type_asArrayKlass->allocate(length, THREAD);
    71   return result;
    69   return result;
    72 }
    70 }
    73 
    71 
    74 typeArrayOop oopFactory::new_typeArray_nozero(BasicType type, int length, TRAPS) {
    72 typeArrayOop oopFactory::new_typeArray_nozero(BasicType type, int length, TRAPS) {
    75   Klass* type_asKlassOop = Universe::typeArrayKlassObj(type);
    73   Klass* type_asKlassOop = Universe::typeArrayKlassObj(type);