| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.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 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2276 __ subp(rsp, Immediate(kDoubleSize)); | 2276 __ subp(rsp, Immediate(kDoubleSize)); |
| 2277 __ Movsd(MemOperand(rsp, 0), input_reg); | 2277 __ Movsd(MemOperand(rsp, 0), input_reg); |
| 2278 __ addp(rsp, Immediate(kDoubleSize)); | 2278 __ addp(rsp, Immediate(kDoubleSize)); |
| 2279 | 2279 |
| 2280 int offset = sizeof(kHoleNanUpper32); | 2280 int offset = sizeof(kHoleNanUpper32); |
| 2281 __ cmpl(MemOperand(rsp, -offset), Immediate(kHoleNanUpper32)); | 2281 __ cmpl(MemOperand(rsp, -offset), Immediate(kHoleNanUpper32)); |
| 2282 EmitBranch(instr, equal); | 2282 EmitBranch(instr, equal); |
| 2283 } | 2283 } |
| 2284 | 2284 |
| 2285 | 2285 |
| 2286 void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) { | |
| 2287 Representation rep = instr->hydrogen()->value()->representation(); | |
| 2288 DCHECK(!rep.IsInteger32()); | |
| 2289 | |
| 2290 if (rep.IsDouble()) { | |
| 2291 XMMRegister value = ToDoubleRegister(instr->value()); | |
| 2292 XMMRegister xmm_scratch = double_scratch0(); | |
| 2293 __ Xorpd(xmm_scratch, xmm_scratch); | |
| 2294 __ Ucomisd(xmm_scratch, value); | |
| 2295 EmitFalseBranch(instr, not_equal); | |
| 2296 __ Movmskpd(kScratchRegister, value); | |
| 2297 __ testl(kScratchRegister, Immediate(1)); | |
| 2298 EmitBranch(instr, not_zero); | |
| 2299 } else { | |
| 2300 Register value = ToRegister(instr->value()); | |
| 2301 Handle<Map> map = masm()->isolate()->factory()->heap_number_map(); | |
| 2302 __ CheckMap(value, map, instr->FalseLabel(chunk()), DO_SMI_CHECK); | |
| 2303 __ cmpl(FieldOperand(value, HeapNumber::kExponentOffset), | |
| 2304 Immediate(0x1)); | |
| 2305 EmitFalseBranch(instr, no_overflow); | |
| 2306 __ cmpl(FieldOperand(value, HeapNumber::kMantissaOffset), | |
| 2307 Immediate(0x00000000)); | |
| 2308 EmitBranch(instr, equal); | |
| 2309 } | |
| 2310 } | |
| 2311 | |
| 2312 | |
| 2313 Condition LCodeGen::EmitIsString(Register input, | 2286 Condition LCodeGen::EmitIsString(Register input, |
| 2314 Register temp1, | 2287 Register temp1, |
| 2315 Label* is_not_string, | 2288 Label* is_not_string, |
| 2316 SmiCheck check_needed = INLINE_SMI_CHECK) { | 2289 SmiCheck check_needed = INLINE_SMI_CHECK) { |
| 2317 if (check_needed == INLINE_SMI_CHECK) { | 2290 if (check_needed == INLINE_SMI_CHECK) { |
| 2318 __ JumpIfSmi(input, is_not_string); | 2291 __ JumpIfSmi(input, is_not_string); |
| 2319 } | 2292 } |
| 2320 | 2293 |
| 2321 Condition cond = masm_->IsObjectStringType(input, temp1, temp1); | 2294 Condition cond = masm_->IsObjectStringType(input, temp1, temp1); |
| 2322 | 2295 |
| (...skipping 3323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5646 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5619 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5647 } | 5620 } |
| 5648 | 5621 |
| 5649 | 5622 |
| 5650 #undef __ | 5623 #undef __ |
| 5651 | 5624 |
| 5652 } // namespace internal | 5625 } // namespace internal |
| 5653 } // namespace v8 | 5626 } // namespace v8 |
| 5654 | 5627 |
| 5655 #endif // V8_TARGET_ARCH_X64 | 5628 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |