@@ -254,33 +254,6 @@ inline void frame::interpreted_frame_oop_map(InterpreterOopMap* mask) const {
254
254
m->mask_for (bci, mask); // OopMapCache::compute_one_oop_map(m, bci, mask);
255
255
}
256
256
257
- // helper to update a map with callee-saved RBP
258
-
259
- template <typename RegisterMapT>
260
- void frame::update_map_with_saved_link (RegisterMapT* map, intptr_t ** link_addr) {
261
- // The interpreter and compiler(s) always save EBP/RBP in a known
262
- // location on entry. We must record where that location is
263
- // so this if EBP/RBP was live on callout from c2 we can find
264
- // the saved copy no matter what it called.
265
-
266
- // Since the interpreter always saves EBP/RBP if we record where it is then
267
- // we don't have to always save EBP/RBP on entry and exit to c2 compiled
268
- // code, on entry will be enough.
269
- map->set_location (rfp->as_VMReg (), (address) link_addr);
270
- // this is weird "H" ought to be at a higher address however the
271
- // oopMaps seems to have the "H" regs at the same address and the
272
- // vanilla register.
273
- // XXXX make this go away
274
- if (true ) {
275
- map->set_location (rfp->as_VMReg ()->next (), (address) link_addr);
276
- }
277
- }
278
-
279
- template <typename RegisterMapT>
280
- intptr_t ** frame::saved_link_address (const RegisterMapT* map) {
281
- return (intptr_t **)map->location (rfp->as_VMReg ());
282
- }
283
-
284
257
// Return address:
285
258
286
259
inline address* frame::sender_pc_addr () const { return (address*) addr_at ( return_addr_offset); }
@@ -414,6 +387,18 @@ inline const ImmutableOopMap* frame::get_oop_map() const {
414
387
return NULL ;
415
388
}
416
389
390
+ // ------------------------------------------------------------------------------
391
+ // frame::sender
392
+ inline frame frame::sender (RegisterMap* map) const {
393
+ frame result = sender_raw (map);
394
+
395
+ if (map->process_frames () && !map->in_cont ()) {
396
+ StackWatermarkSet::on_iteration (map->thread (), result);
397
+ }
398
+
399
+ return result;
400
+ }
401
+
417
402
inline frame frame::sender_raw (RegisterMap* map) const {
418
403
// Default is we done have to follow them. The sender_for_xxx will
419
404
// update it accordingly
@@ -428,17 +413,14 @@ inline frame frame::sender_raw(RegisterMap* map) const {
428
413
if (is_interpreted_frame ()) return sender_for_interpreter_frame (map);
429
414
430
415
assert (_cb == CodeCache::find_blob (pc ()), " Must be the same" );
416
+ if (_cb != NULL ) return sender_for_compiled_frame (map);
431
417
432
- if (_cb != NULL ) {
433
- return _cb->is_compiled () ? sender_for_compiled_frame<false >(map) : sender_for_compiled_frame<true >(map);
434
- }
435
418
// Must be native-compiled frame, i.e. the marshaling code for native
436
419
// methods that exists in the core system.
437
420
return frame (sender_sp (), link (), sender_pc ());
438
421
}
439
422
440
- template <bool stub>
441
- frame frame::sender_for_compiled_frame (RegisterMap* map) const {
423
+ inline frame frame::sender_for_compiled_frame (RegisterMap* map) const {
442
424
// we cannot rely upon the last fp having been saved to the thread
443
425
// in C2 code but it will have been pushed onto the stack. so we
444
426
// have to find it relative to the unextended sp
@@ -456,7 +438,7 @@ frame frame::sender_for_compiled_frame(RegisterMap* map) const {
456
438
// Tell GC to use argument oopmaps for some runtime stubs that need it.
457
439
// For C1, the runtime stub might not have oop maps, so set this flag
458
440
// outside of update_register_map.
459
- if (stub ) { // compiled frames do not use callee-saved registers
441
+ if (!_cb-> is_compiled () ) { // compiled frames do not use callee-saved registers
460
442
map->set_include_argument_oops (_cb->caller_must_gc_arguments (map->thread ()));
461
443
if (oop_map () != NULL ) {
462
444
_oop_map->update_register_map (this , map);
@@ -485,4 +467,23 @@ frame frame::sender_for_compiled_frame(RegisterMap* map) const {
485
467
return frame (sender_sp, unextended_sp, *saved_fp_addr, sender_pc);
486
468
}
487
469
470
+ template <typename RegisterMapT>
471
+ void frame::update_map_with_saved_link (RegisterMapT* map, intptr_t ** link_addr) {
472
+ // The interpreter and compiler(s) always save EBP/RBP in a known
473
+ // location on entry. We must record where that location is
474
+ // so this if EBP/RBP was live on callout from c2 we can find
475
+ // the saved copy no matter what it called.
476
+
477
+ // Since the interpreter always saves EBP/RBP if we record where it is then
478
+ // we don't have to always save EBP/RBP on entry and exit to c2 compiled
479
+ // code, on entry will be enough.
480
+ map->set_location (rfp->as_VMReg (), (address) link_addr);
481
+ // this is weird "H" ought to be at a higher address however the
482
+ // oopMaps seems to have the "H" regs at the same address and the
483
+ // vanilla register.
484
+ // XXXX make this go away
485
+ if (true ) {
486
+ map->set_location (rfp->as_VMReg ()->next (), (address) link_addr);
487
+ }
488
+ }
488
489
#endif // CPU_AARCH64_FRAME_AARCH64_INLINE_HPP
0 commit comments