OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
9 #include "src/full-codegen/full-codegen.h" | 9 #include "src/full-codegen/full-codegen.h" |
10 #include "src/register-configuration.h" | 10 #include "src/register-configuration.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 | 181 |
182 void Deoptimizer::CopyDoubleRegisters(FrameDescription* output_frame) { | 182 void Deoptimizer::CopyDoubleRegisters(FrameDescription* output_frame) { |
183 for (int i = 0; i < X87Register::kMaxNumRegisters; ++i) { | 183 for (int i = 0; i < X87Register::kMaxNumRegisters; ++i) { |
184 double double_value = input_->GetDoubleRegister(i); | 184 double double_value = input_->GetDoubleRegister(i); |
185 output_frame->SetDoubleRegister(i, double_value); | 185 output_frame->SetDoubleRegister(i, double_value); |
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 bool Deoptimizer::HasAlignmentPadding(SharedFunctionInfo* shared) { | 189 bool Deoptimizer::HasAlignmentPadding(SharedFunctionInfo* shared) { |
190 int parameter_count = shared->internal_formal_parameter_count() + 1; | 190 // There is no dynamic alignment padding on x87 in the input frame. |
191 unsigned input_frame_size = input_->GetFrameSize(); | 191 return false; |
192 unsigned alignment_state_offset = | |
193 input_frame_size - parameter_count * kPointerSize - | |
194 StandardFrameConstants::kFixedFrameSize - | |
195 kPointerSize; | |
196 DCHECK(JavaScriptFrameConstants::kDynamicAlignmentStateOffset == | |
197 JavaScriptFrameConstants::kLocal0Offset); | |
198 int32_t alignment_state = input_->GetFrameSlot(alignment_state_offset); | |
199 return (alignment_state == kAlignmentPaddingPushed); | |
200 } | 192 } |
201 | 193 |
202 | 194 |
203 #define __ masm()-> | 195 #define __ masm()-> |
204 | 196 |
205 void Deoptimizer::TableEntryGenerator::Generate() { | 197 void Deoptimizer::TableEntryGenerator::Generate() { |
206 GeneratePrologue(); | 198 GeneratePrologue(); |
207 | 199 |
208 // Save all general purpose registers before messing with them. | 200 // Save all general purpose registers before messing with them. |
209 const int kNumberOfRegisters = Register::kNumRegisters; | 201 const int kNumberOfRegisters = Register::kNumRegisters; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 __ PrepareCallCFunction(1, ebx); | 322 __ PrepareCallCFunction(1, ebx); |
331 __ mov(Operand(esp, 0 * kPointerSize), eax); | 323 __ mov(Operand(esp, 0 * kPointerSize), eax); |
332 { | 324 { |
333 AllowExternalCallThatCantCauseGC scope(masm()); | 325 AllowExternalCallThatCantCauseGC scope(masm()); |
334 __ CallCFunction( | 326 __ CallCFunction( |
335 ExternalReference::compute_output_frames_function(isolate()), 1); | 327 ExternalReference::compute_output_frames_function(isolate()), 1); |
336 } | 328 } |
337 __ pop(eax); | 329 __ pop(eax); |
338 __ pop(edi); | 330 __ pop(edi); |
339 | 331 |
340 // If frame was dynamically aligned, pop padding. | |
341 Label no_padding; | |
342 __ cmp(Operand(eax, Deoptimizer::has_alignment_padding_offset()), | |
343 Immediate(0)); | |
344 __ j(equal, &no_padding); | |
345 __ pop(ecx); | |
346 if (FLAG_debug_code) { | |
347 __ cmp(ecx, Immediate(kAlignmentZapValue)); | |
348 __ Assert(equal, kAlignmentMarkerExpected); | |
349 } | |
350 __ bind(&no_padding); | |
351 | |
352 // Replace the current frame with the output frames. | 332 // Replace the current frame with the output frames. |
353 Label outer_push_loop, inner_push_loop, | 333 Label outer_push_loop, inner_push_loop, |
354 outer_loop_header, inner_loop_header; | 334 outer_loop_header, inner_loop_header; |
355 // Outer loop state: eax = current FrameDescription**, edx = one past the | 335 // Outer loop state: eax = current FrameDescription**, edx = one past the |
356 // last FrameDescription**. | 336 // last FrameDescription**. |
357 __ mov(edx, Operand(eax, Deoptimizer::output_count_offset())); | 337 __ mov(edx, Operand(eax, Deoptimizer::output_count_offset())); |
358 __ mov(eax, Operand(eax, Deoptimizer::output_offset())); | 338 __ mov(eax, Operand(eax, Deoptimizer::output_offset())); |
359 __ lea(edx, Operand(eax, edx, times_4, 0)); | 339 __ lea(edx, Operand(eax, edx, times_4, 0)); |
360 __ jmp(&outer_loop_header); | 340 __ jmp(&outer_loop_header); |
361 __ bind(&outer_push_loop); | 341 __ bind(&outer_push_loop); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 } | 423 } |
444 | 424 |
445 | 425 |
446 #undef __ | 426 #undef __ |
447 | 427 |
448 | 428 |
449 } // namespace internal | 429 } // namespace internal |
450 } // namespace v8 | 430 } // namespace v8 |
451 | 431 |
452 #endif // V8_TARGET_ARCH_X87 | 432 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |