33
33
34
34
// Inline functions for ppc64 frames:
35
35
36
- // Initialize frame members (_pc and _sp must be given)
36
+ // Initialize frame members (_sp must be given)
37
37
inline void frame::setup () {
38
- assert (_pc != nullptr , " precondition: must have PC" );
38
+ if (_pc == nullptr ) {
39
+ _pc = (address)own_abi ()->lr ;
40
+ assert (_pc != nullptr , " must have PC" );
41
+ }
39
42
40
43
if (_cb == nullptr ) {
41
44
_cb = CodeCache::find_blob (_pc);
@@ -45,6 +48,10 @@ inline void frame::setup() {
45
48
_fp = (intptr_t *)own_abi ()->callers_sp ;
46
49
}
47
50
51
+ if (_unextended_sp == nullptr ) {
52
+ _unextended_sp = _sp;
53
+ }
54
+
48
55
// When thawing continuation frames the _unextended_sp passed to the constructor is not aligend
49
56
assert (_on_heap || (is_aligned (_sp, alignment_in_bytes) && is_aligned (_fp, alignment_in_bytes)),
50
57
" invalid alignment sp:" PTR_FORMAT " unextended_sp:" PTR_FORMAT " fp:" PTR_FORMAT, p2i (_sp), p2i (_unextended_sp), p2i (_fp));
@@ -68,28 +75,18 @@ inline void frame::setup() {
68
75
69
76
// Constructors
70
77
71
- // Initialize all fields, _unextended_sp will be adjusted in find_codeblob_and_set_pc_and_deopt_state.
78
+ // Initialize all fields
72
79
inline frame::frame () : _sp(nullptr ), _pc(nullptr ), _cb(nullptr ), _oop_map(nullptr ), _deopt_state(unknown),
73
80
_on_heap(false ), DEBUG_ONLY(_frame_index(-1 ) COMMA) _unextended_sp(nullptr ), _fp(nullptr ) {}
74
81
75
- inline frame::frame (intptr_t * sp)
76
- : _sp(sp), _pc((address)own_abi()->lr), _cb(nullptr ), _oop_map(nullptr ),
77
- _on_heap(false ), DEBUG_ONLY(_frame_index(-1 ) COMMA) _unextended_sp(sp), _fp(nullptr ) {
78
- setup ();
79
- }
80
-
81
- inline frame::frame (intptr_t * sp, address pc)
82
- : _sp(sp), _pc(pc), _cb(nullptr ), _oop_map(nullptr ),
83
- _on_heap(false ), DEBUG_ONLY(_frame_index(-1 ) COMMA) _unextended_sp(sp), _fp(nullptr ) {
84
- setup ();
85
- }
86
-
87
82
inline frame::frame (intptr_t * sp, address pc, intptr_t * unextended_sp, intptr_t * fp, CodeBlob* cb)
88
- : _sp(sp), _pc(pc), _cb(nullptr ), _oop_map(nullptr ),
83
+ : _sp(sp), _pc(pc), _cb(cb ), _oop_map(nullptr ),
89
84
_on_heap(false ), DEBUG_ONLY(_frame_index(-1 ) COMMA) _unextended_sp(unextended_sp), _fp(fp) {
90
85
setup ();
91
86
}
92
87
88
+ inline frame::frame (intptr_t * sp) : frame(sp, nullptr ) {}
89
+
93
90
// Accessors
94
91
95
92
// Return unique id for this frame. The id must have a value where we
@@ -305,32 +302,29 @@ inline frame frame::sender_raw(RegisterMap* map) const {
305
302
if (is_interpreted_frame ()) return sender_for_interpreter_frame (map);
306
303
assert (_cb == CodeCache::find_blob (pc ())," Must be the same" );
307
304
308
- if (_cb != NULL ) return sender_for_compiled_frame (map);
305
+ if (_cb != nullptr ) return sender_for_compiled_frame (map);
309
306
310
307
// Must be native-compiled frame, i.e. the marshaling code for native
311
308
// methods that exists in the core system.
312
309
return frame (sender_sp (), sender_pc ());
313
310
}
314
311
315
312
inline frame frame::sender_for_compiled_frame (RegisterMap *map) const {
316
- assert (map != NULL , " map must be set" );
313
+ assert (map != nullptr , " map must be set" );
317
314
318
- // Frame owned by compiler.
319
- address pc = *compiled_sender_pc_addr (_cb);
320
- frame caller (compiled_sender_sp (_cb), pc);
315
+ intptr_t * sender_sp = this ->sender_sp ();
316
+ address sender_pc = this ->sender_pc ();
321
317
322
318
// Now adjust the map.
323
-
324
- // Get the rest.
325
319
if (map->update_map ()) {
326
320
// Tell GC to use argument oopmaps for some runtime stubs that need it.
327
321
map->set_include_argument_oops (_cb->caller_must_gc_arguments (map->thread ()));
328
- if (_cb->oop_maps () != NULL ) {
322
+ if (_cb->oop_maps () != nullptr ) {
329
323
OopMapSet::update_register_map (this , map);
330
324
}
331
325
}
332
326
333
- return caller ;
327
+ return frame (sender_sp, sender_pc) ;
334
328
}
335
329
336
330
template <typename RegisterMapT>
0 commit comments