127 ~InterpreterOopMap(); 128 129 // Copy the OopMapCacheEntry in parameter "from" into this 130 // InterpreterOopMap. If the _bit_mask[0] in "from" points to 131 // allocated space (i.e., the bit mask was to large to hold 132 // in-line), allocate the space from a Resource area. 133 void resource_copy(OopMapCacheEntry* from); 134 135 void iterate_oop(OffsetClosure* oop_closure) const; 136 void print() const; 137 138 int number_of_entries() const { return mask_size() / bits_per_entry; } 139 bool is_dead(int offset) const { return (entry_at(offset) & (1 << dead_bit_number)) != 0; } 140 bool is_oop (int offset) const { return (entry_at(offset) & (1 << oop_bit_number )) != 0; } 141 142 int expression_stack_size() const { return _expression_stack_size; } 143 144 }; 145 146 class OopMapCache : public CHeapObj<mtClass> { 147 private: 148 enum { _size = 32, // Use fixed size for now 149 _probe_depth = 3 // probe depth in case of collisions 150 }; 151 152 OopMapCacheEntry* _array; 153 154 unsigned int hash_value_for(const methodHandle& method, int bci) const; 155 OopMapCacheEntry* entry_at(int i) const; 156 157 mutable Mutex _mut; 158 159 void flush(); 160 161 public: 162 OopMapCache(); 163 ~OopMapCache(); // free up memory 164 165 // flush cache entry is occupied by an obsolete method 166 void flush_obsolete_entries(); 167 168 // Returns the oopMap for (method, bci) in parameter "entry". 169 // Returns false if an oop map was not found. 170 void lookup(const methodHandle& method, int bci, InterpreterOopMap* entry) const; 171 172 // Compute an oop map without updating the cache or grabbing any locks (for debugging) 173 static void compute_one_oop_map(const methodHandle& method, int bci, InterpreterOopMap* entry); 174 175 // Returns total no. of bytes allocated as part of OopMapCache's 176 static long memory_usage() PRODUCT_RETURN0; 177 }; 178 179 #endif // SHARE_VM_INTERPRETER_OOPMAPCACHE_HPP | 127 ~InterpreterOopMap(); 128 129 // Copy the OopMapCacheEntry in parameter "from" into this 130 // InterpreterOopMap. If the _bit_mask[0] in "from" points to 131 // allocated space (i.e., the bit mask was to large to hold 132 // in-line), allocate the space from a Resource area. 133 void resource_copy(OopMapCacheEntry* from); 134 135 void iterate_oop(OffsetClosure* oop_closure) const; 136 void print() const; 137 138 int number_of_entries() const { return mask_size() / bits_per_entry; } 139 bool is_dead(int offset) const { return (entry_at(offset) & (1 << dead_bit_number)) != 0; } 140 bool is_oop (int offset) const { return (entry_at(offset) & (1 << oop_bit_number )) != 0; } 141 142 int expression_stack_size() const { return _expression_stack_size; } 143 144 }; 145 146 class OopMapCache : public CHeapObj<mtClass> { 147 static OopMapCacheEntry* volatile _old_entries; 148 private: 149 enum { _size = 32, // Use fixed size for now 150 _probe_depth = 3 // probe depth in case of collisions 151 }; 152 153 OopMapCacheEntry* volatile * _array; 154 155 unsigned int hash_value_for(const methodHandle& method, int bci) const; 156 OopMapCacheEntry* entry_at(int i) const; 157 bool put_at(int i, OopMapCacheEntry* entry, OopMapCacheEntry* old); 158 159 static void enqueue_for_cleanup(OopMapCacheEntry* entry); 160 161 void flush(); 162 163 public: 164 OopMapCache(); 165 ~OopMapCache(); // free up memory 166 167 // flush cache entry is occupied by an obsolete method 168 void flush_obsolete_entries(); 169 170 // Returns the oopMap for (method, bci) in parameter "entry". 171 // Returns false if an oop map was not found. 172 void lookup(const methodHandle& method, int bci, InterpreterOopMap* entry); 173 174 // Compute an oop map without updating the cache or grabbing any locks (for debugging) 175 static void compute_one_oop_map(const methodHandle& method, int bci, InterpreterOopMap* entry); 176 static void cleanup_old_entries(); 177 }; 178 179 #endif // SHARE_VM_INTERPRETER_OOPMAPCACHE_HPP |