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 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 = 3 * kInstrSize; 22 const int Deoptimizer::kLazyDeoptExitSize = 3 * kInstrSize; 23 GetFloatRegister(unsigned n) const24Float32 RegisterValues::GetFloatRegister(unsigned n) const { 25 float float_val = static_cast<float>(double_registers_[n].get_scalar()); 26 return Float32::FromBits(bit_cast<uint32_t>(float_val)); 27 } 28 SetCallerPc(unsigned offset,intptr_t value)29void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) { 30 SetFrameSlot(offset, value); 31 } 32 SetCallerFp(unsigned offset,intptr_t value)33void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) { 34 SetFrameSlot(offset, value); 35 } 36 SetCallerConstantPool(unsigned offset,intptr_t value)37void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) { 38 DCHECK(FLAG_enable_embedded_constant_pool); 39 SetFrameSlot(offset, value); 40 } 41 SetPc(intptr_t pc)42void FrameDescription::SetPc(intptr_t pc) { pc_ = pc; } 43 44 } // namespace internal 45 } // namespace v8 46