| 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/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2498 | 2498 |
| 2499 __ add(esp, Immediate(kDoubleSize)); | 2499 __ add(esp, Immediate(kDoubleSize)); |
| 2500 int offset = sizeof(kHoleNanUpper32); | 2500 int offset = sizeof(kHoleNanUpper32); |
| 2501 // x87 converts sNaN(0xfff7fffffff7ffff) to QNaN(0xfffffffffff7ffff), | 2501 // x87 converts sNaN(0xfff7fffffff7ffff) to QNaN(0xfffffffffff7ffff), |
| 2502 // so we check the upper with 0xffffffff for hole as a temporary fix. | 2502 // so we check the upper with 0xffffffff for hole as a temporary fix. |
| 2503 __ cmp(MemOperand(esp, -offset), Immediate(0xffffffff)); | 2503 __ cmp(MemOperand(esp, -offset), Immediate(0xffffffff)); |
| 2504 EmitBranch(instr, equal); | 2504 EmitBranch(instr, equal); |
| 2505 } | 2505 } |
| 2506 | 2506 |
| 2507 | 2507 |
| 2508 void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) { | |
| 2509 Representation rep = instr->hydrogen()->value()->representation(); | |
| 2510 DCHECK(!rep.IsInteger32()); | |
| 2511 | |
| 2512 if (rep.IsDouble()) { | |
| 2513 X87Register input = ToX87Register(instr->value()); | |
| 2514 X87LoadForUsage(input); | |
| 2515 __ FXamMinusZero(); | |
| 2516 EmitBranch(instr, equal); | |
| 2517 } else { | |
| 2518 Register value = ToRegister(instr->value()); | |
| 2519 Handle<Map> map = masm()->isolate()->factory()->heap_number_map(); | |
| 2520 __ CheckMap(value, map, instr->FalseLabel(chunk()), DO_SMI_CHECK); | |
| 2521 __ cmp(FieldOperand(value, HeapNumber::kExponentOffset), | |
| 2522 Immediate(0x1)); | |
| 2523 EmitFalseBranch(instr, no_overflow); | |
| 2524 __ cmp(FieldOperand(value, HeapNumber::kMantissaOffset), | |
| 2525 Immediate(0x00000000)); | |
| 2526 EmitBranch(instr, equal); | |
| 2527 } | |
| 2528 } | |
| 2529 | |
| 2530 | |
| 2531 Condition LCodeGen::EmitIsString(Register input, | 2508 Condition LCodeGen::EmitIsString(Register input, |
| 2532 Register temp1, | 2509 Register temp1, |
| 2533 Label* is_not_string, | 2510 Label* is_not_string, |
| 2534 SmiCheck check_needed = INLINE_SMI_CHECK) { | 2511 SmiCheck check_needed = INLINE_SMI_CHECK) { |
| 2535 if (check_needed == INLINE_SMI_CHECK) { | 2512 if (check_needed == INLINE_SMI_CHECK) { |
| 2536 __ JumpIfSmi(input, is_not_string); | 2513 __ JumpIfSmi(input, is_not_string); |
| 2537 } | 2514 } |
| 2538 | 2515 |
| 2539 Condition cond = masm_->IsObjectStringType(input, temp1, temp1); | 2516 Condition cond = masm_->IsObjectStringType(input, temp1, temp1); |
| 2540 | 2517 |
| (...skipping 3475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6016 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5993 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6017 } | 5994 } |
| 6018 | 5995 |
| 6019 | 5996 |
| 6020 #undef __ | 5997 #undef __ |
| 6021 | 5998 |
| 6022 } // namespace internal | 5999 } // namespace internal |
| 6023 } // namespace v8 | 6000 } // namespace v8 |
| 6024 | 6001 |
| 6025 #endif // V8_TARGET_ARCH_X87 | 6002 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |