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" | 9 #include "src/register-configuration.h" |
10 #include "src/safepoint-table.h" | 10 #include "src/safepoint-table.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // Get the bailout id from the stack. | 119 // Get the bailout id from the stack. |
120 Register bailout_id = x2; | 120 Register bailout_id = x2; |
121 __ Peek(bailout_id, kSavedRegistersAreaSize); | 121 __ Peek(bailout_id, kSavedRegistersAreaSize); |
122 | 122 |
123 Register code_object = x3; | 123 Register code_object = x3; |
124 Register fp_to_sp = x4; | 124 Register fp_to_sp = x4; |
125 // Get the address of the location in the code object. This is the return | 125 // Get the address of the location in the code object. This is the return |
126 // address for lazy deoptimization. | 126 // address for lazy deoptimization. |
127 __ Mov(code_object, lr); | 127 __ Mov(code_object, lr); |
128 // Compute the fp-to-sp delta, and correct one word for bailout id. | 128 // Compute the fp-to-sp delta, and correct one word for bailout id. |
129 __ Add(fp_to_sp, masm()->StackPointer(), | 129 __ Add(fp_to_sp, __ StackPointer(), |
130 kSavedRegistersAreaSize + (1 * kPointerSize)); | 130 kSavedRegistersAreaSize + (1 * kPointerSize)); |
131 __ Sub(fp_to_sp, fp, fp_to_sp); | 131 __ Sub(fp_to_sp, fp, fp_to_sp); |
132 | 132 |
133 // Allocate a new deoptimizer object. | 133 // Allocate a new deoptimizer object. |
134 __ Mov(x0, 0); | 134 __ Mov(x0, 0); |
135 Label context_check; | 135 Label context_check; |
136 __ Ldr(x1, MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset)); | 136 __ Ldr(x1, MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset)); |
137 __ JumpIfSmi(x1, &context_check); | 137 __ JumpIfSmi(x1, &context_check); |
138 __ Ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 138 __ Ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
139 __ bind(&context_check); | 139 __ bind(&context_check); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 __ Push(x0); // Preserve deoptimizer object across call. | 202 __ Push(x0); // Preserve deoptimizer object across call. |
203 | 203 |
204 { | 204 { |
205 // Call Deoptimizer::ComputeOutputFrames(). | 205 // Call Deoptimizer::ComputeOutputFrames(). |
206 AllowExternalCallThatCantCauseGC scope(masm()); | 206 AllowExternalCallThatCantCauseGC scope(masm()); |
207 __ CallCFunction( | 207 __ CallCFunction( |
208 ExternalReference::compute_output_frames_function(isolate()), 1); | 208 ExternalReference::compute_output_frames_function(isolate()), 1); |
209 } | 209 } |
210 __ Pop(x4); // Restore deoptimizer object (class Deoptimizer). | 210 __ Pop(x4); // Restore deoptimizer object (class Deoptimizer). |
211 | 211 |
| 212 __ Ldr(__ StackPointer(), |
| 213 MemOperand(x4, Deoptimizer::caller_frame_top_offset())); |
| 214 |
212 // Replace the current (input) frame with the output frames. | 215 // Replace the current (input) frame with the output frames. |
213 Label outer_push_loop, inner_push_loop, | 216 Label outer_push_loop, inner_push_loop, |
214 outer_loop_header, inner_loop_header; | 217 outer_loop_header, inner_loop_header; |
215 __ Ldrsw(x1, MemOperand(x4, Deoptimizer::output_count_offset())); | 218 __ Ldrsw(x1, MemOperand(x4, Deoptimizer::output_count_offset())); |
216 __ Ldr(x0, MemOperand(x4, Deoptimizer::output_offset())); | 219 __ Ldr(x0, MemOperand(x4, Deoptimizer::output_offset())); |
217 __ Add(x1, x0, Operand(x1, LSL, kPointerSizeLog2)); | 220 __ Add(x1, x0, Operand(x1, LSL, kPointerSizeLog2)); |
218 __ B(&outer_loop_header); | 221 __ B(&outer_loop_header); |
219 | 222 |
220 __ Bind(&outer_push_loop); | 223 __ Bind(&outer_push_loop); |
221 Register current_frame = x2; | 224 Register current_frame = x2; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) { | 338 void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) { |
336 // No embedded constant pool support. | 339 // No embedded constant pool support. |
337 UNREACHABLE(); | 340 UNREACHABLE(); |
338 } | 341 } |
339 | 342 |
340 | 343 |
341 #undef __ | 344 #undef __ |
342 | 345 |
343 } // namespace internal | 346 } // namespace internal |
344 } // namespace v8 | 347 } // namespace v8 |
OLD | NEW |