1 // Copyright 2021 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "src/deoptimizer/deoptimizer.h"
6 
7 namespace v8 {
8 namespace internal {
9 
10 const bool Deoptimizer::kSupportsFixedDeoptExitSizes = true;
11 const int Deoptimizer::kNonLazyDeoptExitSize = 2 * kInstrSize;
12 const int Deoptimizer::kLazyDeoptExitSize = 2 * kInstrSize;
13 const int Deoptimizer::kEagerWithResumeBeforeArgsSize = 3 * kInstrSize;
14 const int Deoptimizer::kEagerWithResumeDeoptExitSize =
15     kEagerWithResumeBeforeArgsSize + 4 * kInstrSize;
16 const int Deoptimizer::kEagerWithResumeImmedArgs1PcOffset = kInstrSize;
17 const int Deoptimizer::kEagerWithResumeImmedArgs2PcOffset =
18     kInstrSize + kSystemPointerSize;
19 
GetFloatRegister(unsigned n) const20 Float32 RegisterValues::GetFloatRegister(unsigned n) const {
21   return Float32::FromBits(
22       static_cast<uint32_t>(double_registers_[n].get_bits()));
23 }
24 
SetCallerPc(unsigned offset,intptr_t value)25 void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
26   SetFrameSlot(offset, value);
27 }
28 
SetCallerFp(unsigned offset,intptr_t value)29 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
30   SetFrameSlot(offset, value);
31 }
32 
SetCallerConstantPool(unsigned offset,intptr_t value)33 void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
34   // No embedded constant pool support.
35   UNREACHABLE();
36 }
37 
SetPc(intptr_t pc)38 void FrameDescription::SetPc(intptr_t pc) { pc_ = pc; }
39 
40 }  // namespace internal
41 }  // namespace v8
42