comparison src/share/vm/ci/ciCPCache.hpp @ 1602:136b78722a08

6939203: JSR 292 needs method handle constants Summary: Add new CP types CONSTANT_MethodHandle, CONSTANT_MethodType; extend 'ldc' bytecode. Reviewed-by: twisti, never
author jrose
date Wed, 09 Jun 2010 18:50:45 -0700
parents c18cbe5936b8
children f95d63e2154a
comparison
equal deleted inserted replaced
1585:49fac4acd688 1602:136b78722a08
27 // This class represents a constant pool cache. 27 // This class represents a constant pool cache.
28 // 28 //
29 // Note: This class is called ciCPCache as ciConstantPoolCache is used 29 // Note: This class is called ciCPCache as ciConstantPoolCache is used
30 // for something different. 30 // for something different.
31 class ciCPCache : public ciObject { 31 class ciCPCache : public ciObject {
32 private:
33 constantPoolCacheOop get_cpCacheOop() { // must be called inside a VM_ENTRY_MARK
34 return (constantPoolCacheOop) get_oop();
35 }
36
37 ConstantPoolCacheEntry* entry_at(int i) {
38 int raw_index = i;
39 if (constantPoolCacheOopDesc::is_secondary_index(i))
40 raw_index = constantPoolCacheOopDesc::decode_secondary_index(i);
41 return get_cpCacheOop()->entry_at(raw_index);
42 }
43
32 public: 44 public:
33 ciCPCache(constantPoolCacheHandle cpcache) : ciObject(cpcache) {} 45 ciCPCache(constantPoolCacheHandle cpcache) : ciObject(cpcache) {}
34 46
35 // What kind of ciObject is this? 47 // What kind of ciObject is this?
36 bool is_cpcache() const { return true; } 48 bool is_cpcache() const { return true; }
39 // requested entry. 51 // requested entry.
40 size_t get_f1_offset(int index); 52 size_t get_f1_offset(int index);
41 53
42 bool is_f1_null_at(int index); 54 bool is_f1_null_at(int index);
43 55
56 int get_pool_index(int index);
57
44 void print(); 58 void print();
45 }; 59 };