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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 // Copy arguments and receiver to the expression stack. | 523 // Copy arguments and receiver to the expression stack. |
524 Label loop, entry; | 524 Label loop, entry; |
525 __ mov(ecx, eax); | 525 __ mov(ecx, eax); |
526 __ jmp(&entry); | 526 __ jmp(&entry); |
527 __ bind(&loop); | 527 __ bind(&loop); |
528 __ push(Operand(ebx, ecx, times_4, 0)); | 528 __ push(Operand(ebx, ecx, times_4, 0)); |
529 __ bind(&entry); | 529 __ bind(&entry); |
530 __ dec(ecx); | 530 __ dec(ecx); |
531 __ j(greater_equal, &loop); | 531 __ j(greater_equal, &loop); |
532 | 532 |
533 __ inc(eax); // Pushed new.target. | |
534 | |
535 | |
536 // Handle step in. | 533 // Handle step in. |
537 Label skip_step_in; | 534 Label skip_step_in; |
538 ExternalReference debug_step_in_fp = | 535 ExternalReference debug_step_in_fp = |
539 ExternalReference::debug_step_in_fp_address(masm->isolate()); | 536 ExternalReference::debug_step_in_fp_address(masm->isolate()); |
540 __ cmp(Operand::StaticVariable(debug_step_in_fp), Immediate(0)); | 537 __ cmp(Operand::StaticVariable(debug_step_in_fp), Immediate(0)); |
541 __ j(equal, &skip_step_in); | 538 __ j(equal, &skip_step_in); |
542 | 539 |
543 __ push(eax); | 540 __ push(eax); |
544 __ push(edi); | 541 __ push(edi); |
545 __ push(edi); | 542 __ push(edi); |
546 __ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1); | 543 __ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1); |
547 __ pop(edi); | 544 __ pop(edi); |
548 __ pop(eax); | 545 __ pop(eax); |
549 | 546 |
550 __ bind(&skip_step_in); | 547 __ bind(&skip_step_in); |
551 | 548 |
552 // Invoke function. | 549 // Invoke function. |
553 ParameterCount actual(eax); | 550 ParameterCount actual(eax); |
554 __ InvokeFunction(edi, actual, CALL_FUNCTION, NullCallWrapper()); | 551 __ InvokeFunction(edi, actual, CALL_FUNCTION, NullCallWrapper()); |
555 | 552 |
556 // Restore context from the frame. | 553 // Restore context from the frame. |
557 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 554 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
558 | 555 |
559 __ mov(ebx, Operand(esp, 0)); | 556 // Get arguments count, skipping over new.target. |
| 557 __ mov(ebx, Operand(esp, kPointerSize)); |
560 } | 558 } |
561 | 559 |
562 __ pop(ecx); // Return address. | 560 __ pop(ecx); // Return address. |
563 __ lea(esp, Operand(esp, ebx, times_2, 1 * kPointerSize)); | 561 __ lea(esp, Operand(esp, ebx, times_2, 1 * kPointerSize)); |
564 __ push(ecx); | 562 __ push(ecx); |
565 __ ret(0); | 563 __ ret(0); |
566 } | 564 } |
567 | 565 |
568 | 566 |
569 enum IsTagged { kEaxIsSmiTagged, kEaxIsUntaggedInt }; | 567 enum IsTagged { kEaxIsSmiTagged, kEaxIsUntaggedInt }; |
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1708 | 1706 |
1709 __ bind(&ok); | 1707 __ bind(&ok); |
1710 __ ret(0); | 1708 __ ret(0); |
1711 } | 1709 } |
1712 | 1710 |
1713 #undef __ | 1711 #undef __ |
1714 } // namespace internal | 1712 } // namespace internal |
1715 } // namespace v8 | 1713 } // namespace v8 |
1716 | 1714 |
1717 #endif // V8_TARGET_ARCH_IA32 | 1715 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |