src/cpu/mips/vm/frame_mips.cpp

changeset 8009
0477693968a6
parent 7996
2102a5402a07
child 8030
da097266f312
equal deleted inserted replaced
8008:2c1fab4a6f4e 8009:0477693968a6
289 289
290 //------------------------------sender_for_compiled_frame----------------------- 290 //------------------------------sender_for_compiled_frame-----------------------
291 frame frame::sender_for_compiled_frame(RegisterMap* map) const { 291 frame frame::sender_for_compiled_frame(RegisterMap* map) const {
292 assert(map != NULL, "map must be set"); 292 assert(map != NULL, "map must be set");
293 293
294 // frame owned by optimizing compiler
295 assert(_cb->frame_size() >= 0, "must have non-zero frame size");
296
297 intptr_t* sender_sp = sender_sp = sp() + _cb->frame_size();
298 #ifdef ASSERT
294 const bool c1_compiled = _cb->is_compiled_by_c1(); 299 const bool c1_compiled = _cb->is_compiled_by_c1();
295 // frame owned by optimizing compiler
296 intptr_t* sender_sp = NULL;
297 bool native = _cb->is_nmethod() && ((nmethod*)_cb)->is_native_method(); 300 bool native = _cb->is_nmethod() && ((nmethod*)_cb)->is_native_method();
298
299 assert(_cb->frame_size() >= 0, "must have non-zero frame size");
300 //FIXME , may be error here , do MIPS have the return address and link address on the stack?
301
302 sender_sp = sp() + _cb->frame_size();
303 #ifdef ASSERT
304 if (c1_compiled && native) { 301 if (c1_compiled && native) {
305 assert(sender_sp == fp() + frame::sender_sp_offset, "incorrect frame size"); 302 assert(sender_sp == fp() + frame::sender_sp_offset, "incorrect frame size");
306 } 303 }
307 #endif // ASSERT 304 #endif // ASSERT
308 // On Intel the return_address is always the word on the stack 305 // On Intel the return_address is always the word on the stack
310 // so getting sender for compiled frame is not same as interpreter frame. 307 // so getting sender for compiled frame is not same as interpreter frame.
311 // we hard code here temporarily 308 // we hard code here temporarily
312 // spark 309 // spark
313 address sender_pc = (address) *(sender_sp-1); 310 address sender_pc = (address) *(sender_sp-1);
314 311
315 intptr_t *saved_fp = (intptr_t*)*(sender_sp - frame::sender_sp_offset); 312 intptr_t** saved_fp_addr = (intptr_t**) (sender_sp - frame::sender_sp_offset);
316
317 // so getting sender for compiled frame is not same as interpreter frame.
318 // we hard code here temporarily
319 // spark
320 313
321 if (map->update_map()) { 314 if (map->update_map()) {
322 // Tell GC to use argument oopmaps for some runtime stubs that need it. 315 // Tell GC to use argument oopmaps for some runtime stubs that need it.
323 // For C1, the runtime stub might not have oop maps, so set this flag 316 // For C1, the runtime stub might not have oop maps, so set this flag
324 // outside of update_register_map. 317 // outside of update_register_map.
325
326 map->set_include_argument_oops(_cb->caller_must_gc_arguments(map->thread())); 318 map->set_include_argument_oops(_cb->caller_must_gc_arguments(map->thread()));
327 if (_cb->oop_maps() != NULL) { 319 if (_cb->oop_maps() != NULL) {
328 OopMapSet::update_register_map(this, map); 320 OopMapSet::update_register_map(this, map);
329 } 321 }
322
330 // Since the prolog does the save and restore of epb there is no oopmap 323 // Since the prolog does the save and restore of epb there is no oopmap
331 // for it so we must fill in its location as if there was an oopmap entry 324 // for it so we must fill in its location as if there was an oopmap entry
332 // since if our caller was compiled code there could be live jvm state in it. 325 // since if our caller was compiled code there could be live jvm state in it.
333 // map->set_location(ebp->as_VMReg(), (address) (sender_sp - frame::sender_sp_offset)); 326 map->set_location(FP->as_VMReg(), (address) saved_fp_addr);
334 map->set_location(FP->as_VMReg(), (address) (sender_sp - frame::sender_sp_offset));
335 } 327 }
336 assert(sender_sp != sp(), "must have changed"); 328 assert(sender_sp != sp(), "must have changed");
337 return frame(sender_sp, saved_fp, sender_pc); 329 return frame(sender_sp, *saved_fp_addr, sender_pc);
338 } 330 }
339 331
340 frame frame::sender(RegisterMap* map) const { 332 frame frame::sender(RegisterMap* map) const {
341 // Default is we done have to follow them. The sender_for_xxx will 333 // Default is we done have to follow them. The sender_for_xxx will
342 // update it accordingly 334 // update it accordingly

mercurial