Flutter Engine
The Flutter Engine
frame_rebase.cc
Go to the documentation of this file.
1// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
6
7namespace dart {
8
9namespace compiler {
10
11namespace ffi {
12
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}
22
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 }
40 return Location::QuadStackSlot(new_stack_index, new_base_);
41}
42
43} // namespace ffi
44
45} // namespace compiler
46
47} // namespace dart
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
bool IsDoubleStackSlot() const
Definition: locations.h:467
static Location DoubleStackSlot(intptr_t stack_index, Register base)
Definition: locations.h:458
intptr_t stack_index() const
Definition: locations.h:485
Location Component(intptr_t i) const
Definition: locations.cc:285
bool IsQuadStackSlot() const
Definition: locations.h:478
Register base_reg() const
Definition: locations.h:480
bool IsPairLocation() const
Definition: locations.h:316
bool IsStackSlot() const
Definition: locations.h:456
bool HasStackIndex() const
Definition: locations.h:491
const NativeLocation & Rebase(const NativeLocation &loc) const
Definition: frame_rebase.cc:13
const NativeType & container_type() const
const NativeStackLocation & AsStack() const
const NativeType & payload_type() const
#define ASSERT(E)
static constexpr intptr_t kWordSize
Definition: runtime_api.h:274
Definition: dart_vm.cc:33