1// Copyright 2014 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#include "src/execution/isolate-data.h"
7
8namespace v8 {
9namespace internal {
10
11// The deopt exit sizes below depend on the following IsolateData layout
12// guarantees:
13#define ASSERT_OFFSET(BuiltinName)                                       \
14  STATIC_ASSERT(IsolateData::builtin_tier0_entry_table_offset() +        \
15                    Builtins::ToInt(BuiltinName) * kSystemPointerSize <= \
16                0x1000)
17ASSERT_OFFSET(Builtin::kDeoptimizationEntry_Eager);
18ASSERT_OFFSET(Builtin::kDeoptimizationEntry_Lazy);
19#undef ASSERT_OFFSET
20
21const int Deoptimizer::kEagerDeoptExitSize = 6 + 2;
22const int Deoptimizer::kLazyDeoptExitSize = 6 + 2;
23
24Float32 RegisterValues::GetFloatRegister(unsigned n) const {
25  return Float32::FromBits(
26      static_cast<uint32_t>(double_registers_[n].get_bits() >> 32));
27}
28
29void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
30  SetFrameSlot(offset, value);
31}
32
33void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
34  SetFrameSlot(offset, value);
35}
36
37void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
38  // No out-of-line constant pool support.
39  UNREACHABLE();
40}
41
42void FrameDescription::SetPc(intptr_t pc) { pc_ = pc; }
43
44}  // namespace internal
45}  // namespace v8
46