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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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/ia32/frames-ia32.h" | 10 #include "src/ia32/frames-ia32.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 < XMMRegister::kMaxNumRegisters; ++i) { | 183 for (int i = 0; i < XMMRegister::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 ia32 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 __ push(eax); | 296 __ push(eax); |
305 __ PrepareCallCFunction(1, ebx); | 297 __ PrepareCallCFunction(1, ebx); |
306 __ mov(Operand(esp, 0 * kPointerSize), eax); | 298 __ mov(Operand(esp, 0 * kPointerSize), eax); |
307 { | 299 { |
308 AllowExternalCallThatCantCauseGC scope(masm()); | 300 AllowExternalCallThatCantCauseGC scope(masm()); |
309 __ CallCFunction( | 301 __ CallCFunction( |
310 ExternalReference::compute_output_frames_function(isolate()), 1); | 302 ExternalReference::compute_output_frames_function(isolate()), 1); |
311 } | 303 } |
312 __ pop(eax); | 304 __ pop(eax); |
313 | 305 |
314 // If frame was dynamically aligned, pop padding. | |
315 Label no_padding; | |
316 __ cmp(Operand(eax, Deoptimizer::has_alignment_padding_offset()), | |
317 Immediate(0)); | |
318 __ j(equal, &no_padding); | |
319 __ pop(ecx); | |
320 if (FLAG_debug_code) { | |
321 __ cmp(ecx, Immediate(kAlignmentZapValue)); | |
322 __ Assert(equal, kAlignmentMarkerExpected); | |
323 } | |
324 __ bind(&no_padding); | |
325 | |
326 // Replace the current frame with the output frames. | 306 // Replace the current frame with the output frames. |
327 Label outer_push_loop, inner_push_loop, | 307 Label outer_push_loop, inner_push_loop, |
328 outer_loop_header, inner_loop_header; | 308 outer_loop_header, inner_loop_header; |
329 // Outer loop state: eax = current FrameDescription**, edx = one past the | 309 // Outer loop state: eax = current FrameDescription**, edx = one past the |
330 // last FrameDescription**. | 310 // last FrameDescription**. |
331 __ mov(edx, Operand(eax, Deoptimizer::output_count_offset())); | 311 __ mov(edx, Operand(eax, Deoptimizer::output_count_offset())); |
332 __ mov(eax, Operand(eax, Deoptimizer::output_offset())); | 312 __ mov(eax, Operand(eax, Deoptimizer::output_offset())); |
333 __ lea(edx, Operand(eax, edx, times_4, 0)); | 313 __ lea(edx, Operand(eax, edx, times_4, 0)); |
334 __ jmp(&outer_loop_header); | 314 __ jmp(&outer_loop_header); |
335 __ bind(&outer_push_loop); | 315 __ bind(&outer_push_loop); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 } | 386 } |
407 | 387 |
408 | 388 |
409 #undef __ | 389 #undef __ |
410 | 390 |
411 | 391 |
412 } // namespace internal | 392 } // namespace internal |
413 } // namespace v8 | 393 } // namespace v8 |
414 | 394 |
415 #endif // V8_TARGET_ARCH_IA32 | 395 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |