Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | List of all members
dart::compiler::ffi::FrameRebase Class Reference

#include <frame_rebase.h>

Inheritance diagram for dart::compiler::ffi::FrameRebase:
dart::ValueObject

Public Member Functions

 FrameRebase (Zone *zone, const Register old_base, const Register new_base, intptr_t stack_delta_in_bytes)
 
const NativeLocationRebase (const NativeLocation &loc) const
 
Location Rebase (const Location loc) const
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

Definition at line 32 of file frame_rebase.h.

Constructor & Destructor Documentation

◆ FrameRebase()

dart::compiler::ffi::FrameRebase::FrameRebase ( Zone zone,
const Register  old_base,
const Register  new_base,
intptr_t  stack_delta_in_bytes 
)
inline

Definition at line 34 of file frame_rebase.h.

38 : zone_(zone),
39 old_base_(old_base),
40 new_base_(new_base),
41 stack_delta_in_bytes_(stack_delta_in_bytes) {}

Member Function Documentation

◆ Rebase() [1/2]

Location dart::compiler::ffi::FrameRebase::Rebase ( const Location  loc) const

Definition at line 23 of file frame_rebase.cc.

23 {
24 if (loc.IsPairLocation()) {
25 return Location::Pair(Rebase(loc.Component(0)), Rebase(loc.Component(1)));
26 }
27 if (!loc.HasStackIndex() || loc.base_reg() != old_base_) {
28 return loc;
29 }
30
31 const intptr_t new_stack_index =
32 loc.stack_index() + stack_delta_in_bytes_ / compiler::target::kWordSize;
33 if (loc.IsStackSlot()) {
34 return Location::StackSlot(new_stack_index, new_base_);
35 }
36 if (loc.IsDoubleStackSlot()) {
37 return Location::DoubleStackSlot(new_stack_index, new_base_);
38 }
39 ASSERT(loc.IsQuadStackSlot());
40 return Location::QuadStackSlot(new_stack_index, new_base_);
41}
static Location StackSlot(intptr_t stack_index, Register base)
Definition: locations.h:447
static Location QuadStackSlot(intptr_t stack_index, Register base)
Definition: locations.h:469
static Location Pair(Location first, Location second)
Definition: locations.cc:271
static Location DoubleStackSlot(intptr_t stack_index, Register base)
Definition: locations.h:458
const NativeLocation & Rebase(const NativeLocation &loc) const
Definition: frame_rebase.cc:13
#define ASSERT(E)
static constexpr intptr_t kWordSize
Definition: runtime_api.h:274

◆ Rebase() [2/2]

const NativeLocation & dart::compiler::ffi::FrameRebase::Rebase ( const NativeLocation loc) const

Definition at line 13 of file frame_rebase.cc.

13 {
14 if (!loc.IsStack() || loc.AsStack().base_register() != old_base_) {
15 return loc;
16 }
17
18 return *new (zone_) NativeStackLocation(
19 loc.payload_type(), loc.container_type(), new_base_,
20 loc.AsStack().offset_in_bytes() + stack_delta_in_bytes_);
21}

The documentation for this class was generated from the following files: