equal
deleted
inserted
replaced
127 |
127 |
128 void CodeBlob::set_oop_maps(OopMapSet* p) { |
128 void CodeBlob::set_oop_maps(OopMapSet* p) { |
129 // Danger Will Robinson! This method allocates a big |
129 // Danger Will Robinson! This method allocates a big |
130 // chunk of memory, its your job to free it. |
130 // chunk of memory, its your job to free it. |
131 if (p != NULL) { |
131 if (p != NULL) { |
132 // We need to allocate a chunk big enough to hold the OopMapSet and all of its OopMaps |
132 _oop_maps = ImmutableOopMapSet::build_from(p); |
133 _oop_maps = (OopMapSet* )NEW_C_HEAP_ARRAY(unsigned char, p->heap_size(), mtCode); |
|
134 p->copy_to((address)_oop_maps); |
|
135 } else { |
133 } else { |
136 _oop_maps = NULL; |
134 _oop_maps = NULL; |
137 } |
135 } |
138 } |
136 } |
139 |
137 |
173 } |
171 } |
174 _strings.free(); |
172 _strings.free(); |
175 } |
173 } |
176 |
174 |
177 |
175 |
178 OopMap* CodeBlob::oop_map_for_return_address(address return_address) { |
176 const ImmutableOopMap* CodeBlob::oop_map_for_return_address(address return_address) { |
179 assert(oop_maps() != NULL, "nope"); |
177 assert(oop_maps() != NULL, "nope"); |
180 return oop_maps()->find_map_at_offset((intptr_t) return_address - (intptr_t) code_begin()); |
178 return oop_maps()->find_map_at_offset((intptr_t) return_address - (intptr_t) code_begin()); |
181 } |
179 } |
182 |
180 |
183 |
181 |