| 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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 CHECK(!FLAG_pretenuring_call_new); | 512 CHECK(!FLAG_pretenuring_call_new); |
| 513 | 513 |
| 514 { | 514 { |
| 515 FrameScope frame_scope(masm, StackFrame::CONSTRUCT); | 515 FrameScope frame_scope(masm, StackFrame::CONSTRUCT); |
| 516 | 516 |
| 517 // Preserve actual arguments count. | 517 // Preserve actual arguments count. |
| 518 __ SmiTag(eax); | 518 __ SmiTag(eax); |
| 519 __ push(eax); | 519 __ push(eax); |
| 520 __ SmiUntag(eax); | 520 __ SmiUntag(eax); |
| 521 | 521 |
| 522 // Push new.target. | |
| 523 __ push(edx); | |
| 524 | |
| 525 // receiver is the hole. | 522 // receiver is the hole. |
| 526 __ push(Immediate(masm->isolate()->factory()->the_hole_value())); | 523 __ push(Immediate(masm->isolate()->factory()->the_hole_value())); |
| 527 | 524 |
| 528 // Set up pointer to last argument. | 525 // Set up pointer to last argument. |
| 529 __ lea(ebx, Operand(ebp, StandardFrameConstants::kCallerSPOffset)); | 526 __ lea(ebx, Operand(ebp, StandardFrameConstants::kCallerSPOffset)); |
| 530 | 527 |
| 531 // Copy arguments and receiver to the expression stack. | 528 // Copy arguments and receiver to the expression stack. |
| 532 Label loop, entry; | 529 Label loop, entry; |
| 533 __ mov(ecx, eax); | 530 __ mov(ecx, eax); |
| 534 __ jmp(&entry); | 531 __ jmp(&entry); |
| 535 __ bind(&loop); | 532 __ bind(&loop); |
| 536 __ push(Operand(ebx, ecx, times_4, 0)); | 533 __ push(Operand(ebx, ecx, times_4, 0)); |
| 537 __ bind(&entry); | 534 __ bind(&entry); |
| 538 __ dec(ecx); | 535 __ dec(ecx); |
| 539 __ j(greater_equal, &loop); | 536 __ j(greater_equal, &loop); |
| 540 | 537 |
| 541 __ inc(eax); // Pushed new.target. | |
| 542 ParameterCount actual(eax); | 538 ParameterCount actual(eax); |
| 543 __ InvokeFunction(edi, actual, CALL_FUNCTION, NullCallWrapper()); | 539 __ InvokeFunction(edi, actual, CALL_FUNCTION, NullCallWrapper()); |
| 544 | 540 |
| 545 // Restore context from the frame. | 541 // Restore context from the frame. |
| 546 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 542 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 547 | 543 |
| 548 __ mov(ebx, Operand(esp, 0)); | 544 __ mov(ebx, Operand(esp, 0)); |
| 549 } | 545 } |
| 550 | 546 |
| 551 __ pop(ecx); // Return address. | 547 __ pop(ecx); // Return address. |
| (...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1529 | 1525 |
| 1530 __ bind(&ok); | 1526 __ bind(&ok); |
| 1531 __ ret(0); | 1527 __ ret(0); |
| 1532 } | 1528 } |
| 1533 | 1529 |
| 1534 #undef __ | 1530 #undef __ |
| 1535 } | 1531 } |
| 1536 } // namespace v8::internal | 1532 } // namespace v8::internal |
| 1537 | 1533 |
| 1538 #endif // V8_TARGET_ARCH_IA32 | 1534 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |