< prev index next >

src/share/vm/oops/typeArrayKlass.cpp

Print this page
rev 12906 : [mq]: gc_interface


  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/moduleEntry.hpp"
  27 #include "classfile/packageEntry.hpp"
  28 #include "classfile/symbolTable.hpp"
  29 #include "classfile/systemDictionary.hpp"
  30 #include "classfile/vmSymbols.hpp"
  31 #include "gc/shared/collectedHeap.hpp"
  32 #include "gc/shared/collectedHeap.inline.hpp"
  33 #include "memory/metadataFactory.hpp"
  34 #include "memory/resourceArea.hpp"
  35 #include "memory/universe.hpp"
  36 #include "memory/universe.inline.hpp"
  37 #include "oops/arrayKlass.inline.hpp"
  38 #include "oops/instanceKlass.hpp"
  39 #include "oops/klass.inline.hpp"
  40 #include "oops/objArrayKlass.hpp"
  41 #include "oops/oop.inline.hpp"
  42 #include "oops/typeArrayKlass.inline.hpp"
  43 #include "oops/typeArrayOop.inline.hpp"

  44 #include "runtime/handles.inline.hpp"
  45 #include "utilities/macros.hpp"
  46 
  47 bool TypeArrayKlass::compute_is_subtype_of(Klass* k) {
  48   if (!k->is_typeArray_klass()) {
  49     return ArrayKlass::compute_is_subtype_of(k);
  50   }
  51 
  52   TypeArrayKlass* tak = TypeArrayKlass::cast(k);
  53   if (dimension() != tak->dimension()) return false;
  54 
  55   return element_type() == tak->element_type();
  56 }
  57 
  58 TypeArrayKlass* TypeArrayKlass::create_klass(BasicType type,
  59                                       const char* name_str, TRAPS) {
  60   Symbol* sym = NULL;
  61   if (name_str != NULL) {
  62     sym = SymbolTable::new_permanent_symbol(name_str, CHECK_NULL);
  63   }


 335   int remaining = ta->length() - print_len;
 336   if (remaining > 0) {
 337     st->print_cr(" - <%d more elements, increase MaxElementPrintSize to print>", remaining);
 338   }
 339 }
 340 
 341 #endif // PRODUCT
 342 
 343 const char* TypeArrayKlass::internal_name() const {
 344   return Klass::external_name();
 345 }
 346 
 347 // A TypeArrayKlass is an array of a primitive type, its defining module is java.base
 348 ModuleEntry* TypeArrayKlass::module() const {
 349   return ModuleEntryTable::javabase_moduleEntry();
 350 }
 351 
 352 PackageEntry* TypeArrayKlass::package() const {
 353   return NULL;
 354 }
































  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/moduleEntry.hpp"
  27 #include "classfile/packageEntry.hpp"
  28 #include "classfile/symbolTable.hpp"
  29 #include "classfile/systemDictionary.hpp"
  30 #include "classfile/vmSymbols.hpp"
  31 #include "gc/shared/collectedHeap.hpp"
  32 #include "gc/shared/collectedHeap.inline.hpp"
  33 #include "memory/metadataFactory.hpp"
  34 #include "memory/resourceArea.hpp"
  35 #include "memory/universe.hpp"
  36 #include "memory/universe.inline.hpp"
  37 #include "oops/arrayKlass.inline.hpp"
  38 #include "oops/instanceKlass.hpp"
  39 #include "oops/klass.inline.hpp"
  40 #include "oops/objArrayKlass.hpp"
  41 #include "oops/oop.inline.hpp"
  42 #include "oops/typeArrayKlass.inline.hpp"
  43 #include "oops/typeArrayOop.inline.hpp"
  44 #include "runtime/access.inline.hpp"
  45 #include "runtime/handles.inline.hpp"
  46 #include "utilities/macros.hpp"
  47 
  48 bool TypeArrayKlass::compute_is_subtype_of(Klass* k) {
  49   if (!k->is_typeArray_klass()) {
  50     return ArrayKlass::compute_is_subtype_of(k);
  51   }
  52 
  53   TypeArrayKlass* tak = TypeArrayKlass::cast(k);
  54   if (dimension() != tak->dimension()) return false;
  55 
  56   return element_type() == tak->element_type();
  57 }
  58 
  59 TypeArrayKlass* TypeArrayKlass::create_klass(BasicType type,
  60                                       const char* name_str, TRAPS) {
  61   Symbol* sym = NULL;
  62   if (name_str != NULL) {
  63     sym = SymbolTable::new_permanent_symbol(name_str, CHECK_NULL);
  64   }


 336   int remaining = ta->length() - print_len;
 337   if (remaining > 0) {
 338     st->print_cr(" - <%d more elements, increase MaxElementPrintSize to print>", remaining);
 339   }
 340 }
 341 
 342 #endif // PRODUCT
 343 
 344 const char* TypeArrayKlass::internal_name() const {
 345   return Klass::external_name();
 346 }
 347 
 348 // A TypeArrayKlass is an array of a primitive type, its defining module is java.base
 349 ModuleEntry* TypeArrayKlass::module() const {
 350   return ModuleEntryTable::javabase_moduleEntry();
 351 }
 352 
 353 PackageEntry* TypeArrayKlass::package() const {
 354   return NULL;
 355 }
 356 
 357 jbyte typeArrayOopDesc::byte_at(int which) const                  { return HeapAccess<ACCESS_ON_ARRAY>::load_at(oop_base(), byte_at_offset(which)); }
 358 void typeArrayOopDesc::byte_at_put(int which, jbyte contents)     { HeapAccess<ACCESS_ON_ARRAY>::store_at(oop_base(), byte_at_offset(which), contents); }
 359 
 360 jboolean typeArrayOopDesc::bool_at(int which) const               { return HeapAccess<ACCESS_ON_ARRAY>::load_at(oop_base(), bool_at_offset(which)); }
 361 void typeArrayOopDesc::bool_at_put(int which, jboolean contents)  { HeapAccess<ACCESS_ON_ARRAY>::store_at(oop_base(), bool_at_offset(which), (jboolean)(((jint)contents) & 1)); }
 362 
 363 jchar typeArrayOopDesc::char_at(int which) const                  { return HeapAccess<ACCESS_ON_ARRAY>::load_at(oop_base(), char_at_offset(which)); }
 364 void typeArrayOopDesc::char_at_put(int which, jchar contents)     { HeapAccess<ACCESS_ON_ARRAY>::store_at(oop_base(), char_at_offset(which), contents); }
 365 
 366 jint typeArrayOopDesc::int_at(int which) const                    { return HeapAccess<ACCESS_ON_ARRAY>::load_at(oop_base(), int_at_offset(which)); }
 367 void typeArrayOopDesc::int_at_put(int which, jint contents)       { HeapAccess<ACCESS_ON_ARRAY>::store_at(oop_base(), int_at_offset(which), contents); }
 368 
 369 jshort typeArrayOopDesc::short_at(int which) const                { return HeapAccess<ACCESS_ON_ARRAY>::load_at(oop_base(), short_at_offset(which)); }
 370 void typeArrayOopDesc::short_at_put(int which, jshort contents)   { HeapAccess<ACCESS_ON_ARRAY>::store_at(oop_base(), short_at_offset(which), contents); }
 371 
 372 jushort typeArrayOopDesc::ushort_at(int which) const              { return HeapAccess<ACCESS_ON_ARRAY>::load_at(oop_base(), short_at_offset(which)); }
 373 void typeArrayOopDesc::ushort_at_put(int which, jushort contents) { HeapAccess<ACCESS_ON_ARRAY>::store_at(oop_base(), short_at_offset(which), contents); }
 374 
 375 jlong typeArrayOopDesc::long_at(int which) const                  { return HeapAccess<ACCESS_ON_ARRAY>::load_at(oop_base(), long_at_offset(which)); }
 376 void typeArrayOopDesc::long_at_put(int which, jlong contents)     { HeapAccess<ACCESS_ON_ARRAY>::store_at(oop_base(), long_at_offset(which), contents); }
 377 
 378 jfloat typeArrayOopDesc::float_at(int which) const                { return HeapAccess<ACCESS_ON_ARRAY>::load_at(oop_base(), float_at_offset(which)); }
 379 void typeArrayOopDesc::float_at_put(int which, jfloat contents)   { HeapAccess<ACCESS_ON_ARRAY>::store_at(oop_base(), float_at_offset(which), contents); }
 380 
 381 jdouble typeArrayOopDesc::double_at(int which) const              { return HeapAccess<ACCESS_ON_ARRAY>::load_at(oop_base(), double_at_offset(which)); }
 382 void typeArrayOopDesc::double_at_put(int which, jdouble contents) { HeapAccess<ACCESS_ON_ARRAY>::store_at(oop_base(), double_at_offset(which), contents); }
 383 
 384 jbyte typeArrayOopDesc::byte_at_acquire(int which) const              { return HeapAccess<ACCESS_ON_ARRAY | MO_ACQUIRE>::load_at(oop_base(), byte_at_offset(which)); }
 385 void typeArrayOopDesc::release_byte_at_put(int which, jbyte contents) { HeapAccess<ACCESS_ON_ARRAY | MO_RELEASE>::store_at(oop_base(), byte_at_offset(which), contents); }
< prev index next >