deoptimizer-ppc.cc 1.51 KB
Newer Older
1 2 3 4
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
#include "src/deoptimizer/deoptimizer.h"
6
#include "src/execution/isolate-data.h"
7 8 9 10

namespace v8 {
namespace internal {

11 12 13
// The deopt exit sizes below depend on the following IsolateData layout
// guarantees:
#define ASSERT_OFFSET(BuiltinName)                                       \
14
  static_assert(IsolateData::builtin_tier0_entry_table_offset() +        \
15 16 17 18 19 20
                    Builtins::ToInt(BuiltinName) * kSystemPointerSize <= \
                0x1000)
ASSERT_OFFSET(Builtin::kDeoptimizationEntry_Eager);
ASSERT_OFFSET(Builtin::kDeoptimizationEntry_Lazy);
#undef ASSERT_OFFSET

21
const int Deoptimizer::kEagerDeoptExitSize = 3 * kInstrSize;
22
const int Deoptimizer::kLazyDeoptExitSize = 3 * kInstrSize;
23

24 25
Float32 RegisterValues::GetFloatRegister(unsigned n) const {
  float float_val = static_cast<float>(double_registers_[n].get_scalar());
26
  return Float32::FromBits(base::bit_cast<uint32_t>(float_val));
27 28
}

29 30 31 32 33 34 35 36 37
void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
  SetFrameSlot(offset, value);
}

void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
  SetFrameSlot(offset, value);
}

void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
38 39
  DCHECK(FLAG_enable_embedded_constant_pool);
  SetFrameSlot(offset, value);
40 41
}

42 43
void FrameDescription::SetPc(intptr_t pc) { pc_ = pc; }

44 45
}  // namespace internal
}  // namespace v8