< prev index next >

hotspot/src/share/vm/utilities/array.hpp

Print this page
rev 10455 : imported patch move some typedef back
   1 /*
   2  * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 275     etype last() const                           { return top(); }                       \
 276   };                                                                                     \
 277 
 278 
 279 #define define_resource_list(element_type)                                               \
 280   define_generic_array(element_type##Array, element_type, ResourceArray)                 \
 281   define_stack(element_type##List, element_type##Array)
 282 
 283 #define define_resource_pointer_list(element_type)                                       \
 284   define_generic_array(element_type##Array, element_type *, ResourceArray)               \
 285   define_stack(element_type##List, element_type##Array)
 286 
 287 #define define_c_heap_list(element_type)                                                 \
 288   define_generic_array(element_type##Array, element_type, CHeapArray)                    \
 289   define_stack(element_type##List, element_type##Array)
 290 
 291 #define define_c_heap_pointer_list(element_type)                                         \
 292   define_generic_array(element_type##Array, element_type *, CHeapArray)                  \
 293   define_stack(element_type##List, element_type##Array)
 294 
 295 
 296 // Arrays for basic types
 297 
 298 define_array(boolArray, bool)          define_stack(boolStack, boolArray)
 299 define_array(intArray , int )          define_stack(intStack , intArray )

 300 
 301 // Array for metadata allocation
 302 
 303 template <typename T>
 304 class Array: public MetaspaceObj {
 305   friend class MetadataFactory;
 306   friend class VMStructs;
 307   friend class JVMCIVMStructs;
 308   friend class MethodHandleCompiler;           // special case
 309   friend class WhiteBox;
 310 protected:
 311   int _length;                                 // the number of array elements
 312   T   _data[1];                                // the array memory
 313 
 314   void initialize(int length) {
 315     _length = length;
 316   }
 317 
 318  private:
 319   // Turn off copy constructor and assignment operator.


   1 /*
   2  * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 275     etype last() const                           { return top(); }                       \
 276   };                                                                                     \
 277 
 278 
 279 #define define_resource_list(element_type)                                               \
 280   define_generic_array(element_type##Array, element_type, ResourceArray)                 \
 281   define_stack(element_type##List, element_type##Array)
 282 
 283 #define define_resource_pointer_list(element_type)                                       \
 284   define_generic_array(element_type##Array, element_type *, ResourceArray)               \
 285   define_stack(element_type##List, element_type##Array)
 286 
 287 #define define_c_heap_list(element_type)                                                 \
 288   define_generic_array(element_type##Array, element_type, CHeapArray)                    \
 289   define_stack(element_type##List, element_type##Array)
 290 
 291 #define define_c_heap_pointer_list(element_type)                                         \
 292   define_generic_array(element_type##Array, element_type *, CHeapArray)                  \
 293   define_stack(element_type##List, element_type##Array)
 294 

 295 // Arrays for basic types
 296 typedef GrowableArray<int> intArray;
 297 typedef GrowableArray<int> intStack;
 298 typedef GrowableArray<bool> boolArray;
 299 typedef GrowableArray<bool> boolStack;
 300 
 301 // Array for metadata allocation
 302 
 303 template <typename T>
 304 class Array: public MetaspaceObj {
 305   friend class MetadataFactory;
 306   friend class VMStructs;
 307   friend class JVMCIVMStructs;
 308   friend class MethodHandleCompiler;           // special case
 309   friend class WhiteBox;
 310 protected:
 311   int _length;                                 // the number of array elements
 312   T   _data[1];                                // the array memory
 313 
 314   void initialize(int length) {
 315     _length = length;
 316   }
 317 
 318  private:
 319   // Turn off copy constructor and assignment operator.


< prev index next >