• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2012 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 
8 namespace v8 {
9 namespace 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)
17 ASSERT_OFFSET(Builtin::kDeoptimizationEntry_Eager);
18 ASSERT_OFFSET(Builtin::kDeoptimizationEntry_Lazy);
19 #undef ASSERT_OFFSET
20 
21 const int Deoptimizer::kEagerDeoptExitSize = 2 * kInstrSize;
22 const int Deoptimizer::kLazyDeoptExitSize = 2 * kInstrSize;
23 
GetFloatRegister(unsigned n) const24 Float32 RegisterValues::GetFloatRegister(unsigned n) const {
25   const int kShift = n % 2 == 0 ? 0 : 32;
26 
27   return Float32::FromBits(
28       static_cast<uint32_t>(double_registers_[n / 2].get_bits() >> kShift));
29 }
30 
SetCallerPc(unsigned offset,intptr_t value)31 void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
32   SetFrameSlot(offset, value);
33 }
34 
SetCallerFp(unsigned offset,intptr_t value)35 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
36   SetFrameSlot(offset, value);
37 }
38 
SetCallerConstantPool(unsigned offset,intptr_t value)39 void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
40   // No embedded constant pool support.
41   UNREACHABLE();
42 }
43 
SetPc(intptr_t pc)44 void FrameDescription::SetPc(intptr_t pc) { pc_ = pc; }
45 
46 }  // namespace internal
47 }  // namespace v8
48