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/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 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 | 1435 |
1436 __ bind(&undetectable); | 1436 __ bind(&undetectable); |
1437 __ test_b(FieldOperand(ecx, Map::kBitFieldOffset), | 1437 __ test_b(FieldOperand(ecx, Map::kBitFieldOffset), |
1438 1 << Map::kIsUndetectable); | 1438 1 << Map::kIsUndetectable); |
1439 __ j(zero, &return_unequal, Label::kNear); | 1439 __ j(zero, &return_unequal, Label::kNear); |
1440 __ Move(eax, Immediate(EQUAL)); | 1440 __ Move(eax, Immediate(EQUAL)); |
1441 __ ret(0); // eax, edx were pushed | 1441 __ ret(0); // eax, edx were pushed |
1442 } | 1442 } |
1443 __ bind(&runtime_call); | 1443 __ bind(&runtime_call); |
1444 | 1444 |
1445 // Push arguments below the return address. | |
1446 __ pop(ecx); | |
1447 __ push(edx); | |
1448 __ push(eax); | |
1449 | |
1450 // Figure out which native to call and setup the arguments. | |
1451 if (cc == equal) { | 1445 if (cc == equal) { |
| 1446 { |
| 1447 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1448 __ Push(edx); |
| 1449 __ Push(eax); |
| 1450 __ CallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals); |
| 1451 } |
| 1452 // Turn true into 0 and false into some non-zero value. |
| 1453 STATIC_ASSERT(EQUAL == 0); |
| 1454 __ sub(eax, Immediate(isolate()->factory()->true_value())); |
| 1455 __ Ret(); |
| 1456 } else { |
| 1457 // Push arguments below the return address. |
| 1458 __ pop(ecx); |
| 1459 __ push(edx); |
| 1460 __ push(eax); |
| 1461 __ push(Immediate(Smi::FromInt(NegativeComparisonResult(cc)))); |
1452 __ push(ecx); | 1462 __ push(ecx); |
1453 __ TailCallRuntime(strict() ? Runtime::kStrictEquals : Runtime::kEquals); | |
1454 } else { | |
1455 __ push(Immediate(Smi::FromInt(NegativeComparisonResult(cc)))); | |
1456 | |
1457 // Restore return address on the stack. | |
1458 __ push(ecx); | |
1459 | |
1460 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) | 1463 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) |
1461 // tagged as a small integer. | 1464 // tagged as a small integer. |
1462 __ TailCallRuntime(Runtime::kCompare); | 1465 __ TailCallRuntime(Runtime::kCompare); |
1463 } | 1466 } |
1464 | 1467 |
1465 __ bind(&miss); | 1468 __ bind(&miss); |
1466 GenerateMiss(masm); | 1469 GenerateMiss(masm); |
1467 } | 1470 } |
1468 | 1471 |
1469 | 1472 |
(...skipping 4449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5919 return_value_operand, NULL); | 5922 return_value_operand, NULL); |
5920 } | 5923 } |
5921 | 5924 |
5922 | 5925 |
5923 #undef __ | 5926 #undef __ |
5924 | 5927 |
5925 } // namespace internal | 5928 } // namespace internal |
5926 } // namespace v8 | 5929 } // namespace v8 |
5927 | 5930 |
5928 #endif // V8_TARGET_ARCH_IA32 | 5931 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |