Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Side by Side Diff: src/arm64/deoptimizer-arm64.cc

Issue 1769833006: [arm][stubs] Fix d16-d31 preservation on stub failure (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: arm64 needs fixing too Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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" 9 #include "src/register-configuration.h"
10 #include "src/safepoint-table.h" 10 #include "src/safepoint-table.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 CPURegList copy_to_input = saved_registers; 160 CPURegList copy_to_input = saved_registers;
161 for (int i = 0; i < saved_registers.Count(); i++) { 161 for (int i = 0; i < saved_registers.Count(); i++) {
162 __ Peek(x2, i * kPointerSize); 162 __ Peek(x2, i * kPointerSize);
163 CPURegister current_reg = copy_to_input.PopLowestIndex(); 163 CPURegister current_reg = copy_to_input.PopLowestIndex();
164 int offset = (current_reg.code() * kPointerSize) + 164 int offset = (current_reg.code() * kPointerSize) +
165 FrameDescription::registers_offset(); 165 FrameDescription::registers_offset();
166 __ Str(x2, MemOperand(x1, offset)); 166 __ Str(x2, MemOperand(x1, offset));
167 } 167 }
168 168
169 // Copy FP registers to the input frame. 169 // Copy FP registers to the input frame.
170 CPURegList copy_fp_to_input = saved_fp_registers;
170 for (int i = 0; i < saved_fp_registers.Count(); i++) { 171 for (int i = 0; i < saved_fp_registers.Count(); i++) {
171 int dst_offset = FrameDescription::double_registers_offset() +
172 (i * kDoubleSize);
173 int src_offset = kFPRegistersOffset + (i * kDoubleSize); 172 int src_offset = kFPRegistersOffset + (i * kDoubleSize);
174 __ Peek(x2, src_offset); 173 __ Peek(x2, src_offset);
174 CPURegister reg = copy_fp_to_input.PopLowestIndex();
175 int dst_offset = FrameDescription::double_registers_offset() +
176 (reg.code() * kDoubleSize);
Jakob Kummerow 2016/03/09 11:07:25 The change here is s/i/reg.code()/. We must not us
175 __ Str(x2, MemOperand(x1, dst_offset)); 177 __ Str(x2, MemOperand(x1, dst_offset));
176 } 178 }
177 179
178 // Remove the bailout id and the saved registers from the stack. 180 // Remove the bailout id and the saved registers from the stack.
179 __ Drop(1 + (kSavedRegistersAreaSize / kXRegSize)); 181 __ Drop(1 + (kSavedRegistersAreaSize / kXRegSize));
180 182
181 // Compute a pointer to the unwinding limit in register x2; that is 183 // Compute a pointer to the unwinding limit in register x2; that is
182 // the first stack slot not part of the input frame. 184 // the first stack slot not part of the input frame.
183 Register unwind_limit = x2; 185 Register unwind_limit = x2;
184 __ Ldr(unwind_limit, MemOperand(x1, FrameDescription::frame_size_offset())); 186 __ Ldr(unwind_limit, MemOperand(x1, FrameDescription::frame_size_offset()));
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 235
234 __ Add(x0, x0, kPointerSize); 236 __ Add(x0, x0, kPointerSize);
235 __ Bind(&outer_loop_header); 237 __ Bind(&outer_loop_header);
236 __ Cmp(x0, x1); 238 __ Cmp(x0, x1);
237 __ B(lt, &outer_push_loop); 239 __ B(lt, &outer_push_loop);
238 240
239 __ Ldr(x1, MemOperand(x4, Deoptimizer::input_offset())); 241 __ Ldr(x1, MemOperand(x4, Deoptimizer::input_offset()));
240 DCHECK(!saved_fp_registers.IncludesAliasOf(crankshaft_fp_scratch) && 242 DCHECK(!saved_fp_registers.IncludesAliasOf(crankshaft_fp_scratch) &&
241 !saved_fp_registers.IncludesAliasOf(fp_zero) && 243 !saved_fp_registers.IncludesAliasOf(fp_zero) &&
242 !saved_fp_registers.IncludesAliasOf(fp_scratch)); 244 !saved_fp_registers.IncludesAliasOf(fp_scratch));
243 int src_offset = FrameDescription::double_registers_offset();
244 while (!saved_fp_registers.IsEmpty()) { 245 while (!saved_fp_registers.IsEmpty()) {
245 const CPURegister reg = saved_fp_registers.PopLowestIndex(); 246 const CPURegister reg = saved_fp_registers.PopLowestIndex();
247 int src_offset = FrameDescription::double_registers_offset() +
248 (reg.code() * kDoubleSize);
246 __ Ldr(reg, MemOperand(x1, src_offset)); 249 __ Ldr(reg, MemOperand(x1, src_offset));
247 src_offset += kDoubleSize;
248 } 250 }
249 251
250 // Push state from the last output frame. 252 // Push state from the last output frame.
251 __ Ldr(x6, MemOperand(current_frame, FrameDescription::state_offset())); 253 __ Ldr(x6, MemOperand(current_frame, FrameDescription::state_offset()));
252 __ Push(x6); 254 __ Push(x6);
253 255
254 // TODO(all): ARM copies a lot (if not all) of the last output frame onto the 256 // TODO(all): ARM copies a lot (if not all) of the last output frame onto the
255 // stack, then pops it all into registers. Here, we try to load it directly 257 // stack, then pops it all into registers. Here, we try to load it directly
256 // into the relevant registers. Is this correct? If so, we should improve the 258 // into the relevant registers. Is this correct? If so, we should improve the
257 // ARM code. 259 // ARM code.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) { 337 void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) {
336 // No embedded constant pool support. 338 // No embedded constant pool support.
337 UNREACHABLE(); 339 UNREACHABLE();
338 } 340 }
339 341
340 342
341 #undef __ 343 #undef __
342 344
343 } // namespace internal 345 } // namespace internal
344 } // namespace v8 346 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698