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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 __ ret(0); // rax, rdx were pushed | 1567 __ ret(0); // rax, rdx were pushed |
1568 } | 1568 } |
1569 __ bind(&runtime_call); | 1569 __ bind(&runtime_call); |
1570 | 1570 |
1571 // Push arguments below the return address. | 1571 // Push arguments below the return address. |
1572 __ pop(ecx); | 1572 __ pop(ecx); |
1573 __ push(edx); | 1573 __ push(edx); |
1574 __ push(eax); | 1574 __ push(eax); |
1575 | 1575 |
1576 // Figure out which native to call and setup the arguments. | 1576 // Figure out which native to call and setup the arguments. |
1577 if (cc == equal && strict()) { | 1577 if (cc == equal) { |
1578 __ push(ecx); | 1578 __ push(ecx); |
1579 __ TailCallRuntime(Runtime::kStrictEquals, 2, 1); | 1579 __ TailCallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals, 2, |
| 1580 1); |
1580 } else { | 1581 } else { |
1581 int context_index; | 1582 int native_context_index = is_strong(strength()) |
1582 if (cc == equal) { | 1583 ? Context::COMPARE_STRONG_BUILTIN_INDEX |
1583 context_index = Context::EQUALS_BUILTIN_INDEX; | 1584 : Context::COMPARE_BUILTIN_INDEX; |
1584 } else { | 1585 __ push(Immediate(Smi::FromInt(NegativeComparisonResult(cc)))); |
1585 context_index = is_strong(strength()) | |
1586 ? Context::COMPARE_STRONG_BUILTIN_INDEX | |
1587 : Context::COMPARE_BUILTIN_INDEX; | |
1588 __ push(Immediate(Smi::FromInt(NegativeComparisonResult(cc)))); | |
1589 } | |
1590 | 1586 |
1591 // Restore return address on the stack. | 1587 // Restore return address on the stack. |
1592 __ push(ecx); | 1588 __ push(ecx); |
1593 | 1589 |
1594 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) | 1590 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) |
1595 // tagged as a small integer. | 1591 // tagged as a small integer. |
1596 __ InvokeBuiltin(context_index, JUMP_FUNCTION); | 1592 __ InvokeBuiltin(native_context_index, JUMP_FUNCTION); |
1597 } | 1593 } |
1598 | 1594 |
1599 __ bind(&miss); | 1595 __ bind(&miss); |
1600 GenerateMiss(masm); | 1596 GenerateMiss(masm); |
1601 } | 1597 } |
1602 | 1598 |
1603 | 1599 |
1604 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub, | 1600 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub, |
1605 bool is_super) { | 1601 bool is_super) { |
1606 // eax : number of arguments to the construct function | 1602 // eax : number of arguments to the construct function |
(...skipping 3879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5486 Operand(ebp, 7 * kPointerSize), NULL); | 5482 Operand(ebp, 7 * kPointerSize), NULL); |
5487 } | 5483 } |
5488 | 5484 |
5489 | 5485 |
5490 #undef __ | 5486 #undef __ |
5491 | 5487 |
5492 } // namespace internal | 5488 } // namespace internal |
5493 } // namespace v8 | 5489 } // namespace v8 |
5494 | 5490 |
5495 #endif // V8_TARGET_ARCH_X87 | 5491 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |