• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 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/api/api.h"
6 #include "src/deoptimizer/deoptimizer.h"
7 #include "src/execution/pointer-authentication.h"
8 
9 namespace v8 {
10 namespace internal {
11 
12 const int Deoptimizer::kEagerDeoptExitSize = kInstrSize;
13 #ifdef V8_ENABLE_CONTROL_FLOW_INTEGRITY
14 const int Deoptimizer::kLazyDeoptExitSize = 2 * kInstrSize;
15 #else
16 const int Deoptimizer::kLazyDeoptExitSize = 1 * kInstrSize;
17 #endif
18 
GetFloatRegister(unsigned n) const19 Float32 RegisterValues::GetFloatRegister(unsigned n) const {
20   return Float32::FromBits(
21       static_cast<uint32_t>(double_registers_[n].get_bits()));
22 }
23 
SetCallerPc(unsigned offset,intptr_t value)24 void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
25   Address new_context =
26       static_cast<Address>(GetTop()) + offset + kPCOnStackSize;
27   value = PointerAuthentication::SignAndCheckPC(value, new_context);
28   SetFrameSlot(offset, value);
29 }
30 
SetCallerFp(unsigned offset,intptr_t value)31 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
32   SetFrameSlot(offset, value);
33 }
34 
SetCallerConstantPool(unsigned offset,intptr_t value)35 void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
36   // No embedded constant pool support.
37   UNREACHABLE();
38 }
39 
SetPc(intptr_t pc)40 void FrameDescription::SetPc(intptr_t pc) {
41   if (ENABLE_CONTROL_FLOW_INTEGRITY_BOOL) {
42     CHECK(
43         Deoptimizer::IsValidReturnAddress(PointerAuthentication::StripPAC(pc)));
44   }
45   pc_ = pc;
46 }
47 
48 }  // namespace internal
49 }  // namespace v8
50