OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/arm64/frames-arm64.h" | 5 #include "src/arm64/frames-arm64.h" |
6 #include "src/codegen.h" | 6 #include "src/codegen.h" |
7 #include "src/deoptimizer.h" | 7 #include "src/deoptimizer.h" |
8 #include "src/full-codegen/full-codegen.h" | 8 #include "src/full-codegen/full-codegen.h" |
9 #include "src/register-configuration.h" | |
10 #include "src/safepoint-table.h" | 9 #include "src/safepoint-table.h" |
11 | 10 |
12 | 11 |
13 namespace v8 { | 12 namespace v8 { |
14 namespace internal { | 13 namespace internal { |
15 | 14 |
16 | 15 |
17 int Deoptimizer::patch_size() { | 16 int Deoptimizer::patch_size() { |
18 // Size of the code used to patch lazy bailout points. | 17 // Size of the code used to patch lazy bailout points. |
19 // Patching is done by Deoptimizer::DeoptimizeFunction. | 18 // Patching is done by Deoptimizer::DeoptimizeFunction. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // callee saved registers in JavaScript frames, so all registers are | 68 // callee saved registers in JavaScript frames, so all registers are |
70 // spilled. Registers fp and sp are set to the correct values though. | 69 // spilled. Registers fp and sp are set to the correct values though. |
71 for (int i = 0; i < Register::NumRegisters(); i++) { | 70 for (int i = 0; i < Register::NumRegisters(); i++) { |
72 input_->SetRegister(i, 0); | 71 input_->SetRegister(i, 0); |
73 } | 72 } |
74 | 73 |
75 // TODO(all): Do we also need to set a value to csp? | 74 // TODO(all): Do we also need to set a value to csp? |
76 input_->SetRegister(jssp.code(), reinterpret_cast<intptr_t>(frame->sp())); | 75 input_->SetRegister(jssp.code(), reinterpret_cast<intptr_t>(frame->sp())); |
77 input_->SetRegister(fp.code(), reinterpret_cast<intptr_t>(frame->fp())); | 76 input_->SetRegister(fp.code(), reinterpret_cast<intptr_t>(frame->fp())); |
78 | 77 |
79 for (int i = 0; i < DoubleRegister::kMaxNumRegisters; i++) { | 78 for (int i = 0; i < DoubleRegister::NumAllocatableRegisters(); i++) { |
80 input_->SetDoubleRegister(i, 0.0); | 79 input_->SetDoubleRegister(i, 0.0); |
81 } | 80 } |
82 | 81 |
83 // Fill the frame content from the actual data on the frame. | 82 // Fill the frame content from the actual data on the frame. |
84 for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) { | 83 for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) { |
85 input_->SetFrameSlot(i, Memory::uint64_at(tos + i)); | 84 input_->SetFrameSlot(i, Memory::uint64_at(tos + i)); |
86 } | 85 } |
87 } | 86 } |
88 | 87 |
89 | 88 |
(...skipping 26 matching lines...) Expand all Loading... |
116 #define __ masm()-> | 115 #define __ masm()-> |
117 | 116 |
118 void Deoptimizer::TableEntryGenerator::Generate() { | 117 void Deoptimizer::TableEntryGenerator::Generate() { |
119 GeneratePrologue(); | 118 GeneratePrologue(); |
120 | 119 |
121 // TODO(all): This code needs to be revisited. We probably only need to save | 120 // TODO(all): This code needs to be revisited. We probably only need to save |
122 // caller-saved registers here. Callee-saved registers can be stored directly | 121 // caller-saved registers here. Callee-saved registers can be stored directly |
123 // in the input frame. | 122 // in the input frame. |
124 | 123 |
125 // Save all allocatable floating point registers. | 124 // Save all allocatable floating point registers. |
126 CPURegList saved_fp_registers( | 125 CPURegList saved_fp_registers(CPURegister::kFPRegister, kDRegSizeInBits, |
127 CPURegister::kFPRegister, kDRegSizeInBits, | 126 FPRegister::kAllocatableFPRegisters); |
128 RegisterConfiguration::ArchDefault()->allocatable_double_codes_mask()); | |
129 __ PushCPURegList(saved_fp_registers); | 127 __ PushCPURegList(saved_fp_registers); |
130 | 128 |
131 // We save all the registers expcept jssp, sp and lr. | 129 // We save all the registers expcept jssp, sp and lr. |
132 CPURegList saved_registers(CPURegister::kRegister, kXRegSizeInBits, 0, 27); | 130 CPURegList saved_registers(CPURegister::kRegister, kXRegSizeInBits, 0, 27); |
133 saved_registers.Combine(fp); | 131 saved_registers.Combine(fp); |
134 __ PushCPURegList(saved_registers); | 132 __ PushCPURegList(saved_registers); |
135 | 133 |
136 __ Mov(x3, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); | 134 __ Mov(x3, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); |
137 __ Str(fp, MemOperand(x3)); | 135 __ Str(fp, MemOperand(x3)); |
138 | 136 |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) { | 355 void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) { |
358 // No embedded constant pool support. | 356 // No embedded constant pool support. |
359 UNREACHABLE(); | 357 UNREACHABLE(); |
360 } | 358 } |
361 | 359 |
362 | 360 |
363 #undef __ | 361 #undef __ |
364 | 362 |
365 } // namespace internal | 363 } // namespace internal |
366 } // namespace v8 | 364 } // namespace v8 |
OLD | NEW |