Mercurial > hg > graal-jvmci-8
comparison src/share/vm/oops/constantPoolOop.hpp @ 113:ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
Summary: Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv
Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
author | coleenp |
---|---|
date | Sun, 13 Apr 2008 17:43:42 -0400 |
parents | a61af66fc99e |
children | d1605aabd0a1 |
comparison
equal
deleted
inserted
replaced
110:a49a647afe9a | 113:ba764ed4b6f2 |
---|---|
32 // the entry in the constant pool is a klass or String object and | 32 // the entry in the constant pool is a klass or String object and |
33 // not a symbolOop. | 33 // not a symbolOop. |
34 | 34 |
35 class SymbolHashMap; | 35 class SymbolHashMap; |
36 | 36 |
37 class constantPoolOopDesc : public arrayOopDesc { | 37 class constantPoolOopDesc : public oopDesc { |
38 friend class VMStructs; | 38 friend class VMStructs; |
39 friend class BytecodeInterpreter; // Directly extracts an oop in the pool for fast instanceof/checkcast | 39 friend class BytecodeInterpreter; // Directly extracts an oop in the pool for fast instanceof/checkcast |
40 private: | 40 private: |
41 typeArrayOop _tags; // the tag array describing the constant pool's contents | 41 typeArrayOop _tags; // the tag array describing the constant pool's contents |
42 constantPoolCacheOop _cache; // the cache holding interpreter runtime information | 42 constantPoolCacheOop _cache; // the cache holding interpreter runtime information |
43 klassOop _pool_holder; // the corresponding class | 43 klassOop _pool_holder; // the corresponding class |
44 int _length; // number of elements in the array | |
44 // only set to non-zero if constant pool is merged by RedefineClasses | 45 // only set to non-zero if constant pool is merged by RedefineClasses |
45 int _orig_length; | 46 int _orig_length; |
46 | 47 |
47 void set_tags(typeArrayOop tags) { oop_store_without_check((oop*)&_tags, tags); } | 48 void set_tags(typeArrayOop tags) { oop_store_without_check((oop*)&_tags, tags); } |
48 void tag_at_put(int which, jbyte t) { tags()->byte_at_put(which, t); } | 49 void tag_at_put(int which, jbyte t) { tags()->byte_at_put(which, t); } |
328 | 329 |
329 // Klass name matches name at offset | 330 // Klass name matches name at offset |
330 bool klass_name_at_matches(instanceKlassHandle k, int which); | 331 bool klass_name_at_matches(instanceKlassHandle k, int which); |
331 | 332 |
332 // Sizing | 333 // Sizing |
334 int length() const { return _length; } | |
335 void set_length(int length) { _length = length; } | |
336 | |
337 // Tells whether index is within bounds. | |
338 bool is_within_bounds(int index) const { | |
339 return 0 <= index && index < length(); | |
340 } | |
341 | |
333 static int header_size() { return sizeof(constantPoolOopDesc)/HeapWordSize; } | 342 static int header_size() { return sizeof(constantPoolOopDesc)/HeapWordSize; } |
334 static int object_size(int length) { return align_object_size(header_size() + length); } | 343 static int object_size(int length) { return align_object_size(header_size() + length); } |
335 int object_size() { return object_size(length()); } | 344 int object_size() { return object_size(length()); } |
336 | 345 |
337 friend class constantPoolKlass; | 346 friend class constantPoolKlass; |