OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2239 __ subq(rsp, Immediate(kDoubleSize)); | 2239 __ subq(rsp, Immediate(kDoubleSize)); |
2240 __ movsd(MemOperand(rsp, 0), input_reg); | 2240 __ movsd(MemOperand(rsp, 0), input_reg); |
2241 __ addq(rsp, Immediate(kDoubleSize)); | 2241 __ addq(rsp, Immediate(kDoubleSize)); |
2242 | 2242 |
2243 int offset = sizeof(kHoleNanUpper32); | 2243 int offset = sizeof(kHoleNanUpper32); |
2244 __ cmpl(MemOperand(rsp, -offset), Immediate(kHoleNanUpper32)); | 2244 __ cmpl(MemOperand(rsp, -offset), Immediate(kHoleNanUpper32)); |
2245 EmitBranch(instr, equal); | 2245 EmitBranch(instr, equal); |
2246 } | 2246 } |
2247 | 2247 |
2248 | 2248 |
| 2249 void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) { |
| 2250 Representation rep = instr->hydrogen()->value()->representation(); |
| 2251 ASSERT(!rep.IsInteger32()); |
| 2252 Label if_false; |
| 2253 |
| 2254 if (rep.IsDouble()) { |
| 2255 XMMRegister value = ToDoubleRegister(instr->value()); |
| 2256 XMMRegister xmm_scratch = double_scratch0(); |
| 2257 __ xorps(xmm_scratch, xmm_scratch); |
| 2258 __ ucomisd(xmm_scratch, value); |
| 2259 __ j(not_equal, &if_false); |
| 2260 __ movmskpd(kScratchRegister, value); |
| 2261 __ testl(kScratchRegister, Immediate(1)); |
| 2262 EmitBranch(instr, not_zero); |
| 2263 } else { |
| 2264 Register value = ToRegister(instr->value()); |
| 2265 Handle<Map> map = masm()->isolate()->factory()->heap_number_map(); |
| 2266 __ CheckMap(rax, map, &if_false, DO_SMI_CHECK); |
| 2267 __ cmpl(FieldOperand(value, HeapNumber::kExponentOffset), |
| 2268 Immediate(0x80000000)); |
| 2269 __ j(not_equal, &if_false); |
| 2270 __ cmpl(FieldOperand(value, HeapNumber::kMantissaOffset), |
| 2271 Immediate(0x00000000)); |
| 2272 EmitBranch(instr, equal); |
| 2273 } |
| 2274 |
| 2275 __ bind(&if_false); |
| 2276 EmitFalseBranch(instr, always); |
| 2277 } |
| 2278 |
| 2279 |
2249 Condition LCodeGen::EmitIsObject(Register input, | 2280 Condition LCodeGen::EmitIsObject(Register input, |
2250 Label* is_not_object, | 2281 Label* is_not_object, |
2251 Label* is_object) { | 2282 Label* is_object) { |
2252 ASSERT(!input.is(kScratchRegister)); | 2283 ASSERT(!input.is(kScratchRegister)); |
2253 | 2284 |
2254 __ JumpIfSmi(input, is_not_object); | 2285 __ JumpIfSmi(input, is_not_object); |
2255 | 2286 |
2256 __ CompareRoot(input, Heap::kNullValueRootIndex); | 2287 __ CompareRoot(input, Heap::kNullValueRootIndex); |
2257 __ j(equal, is_object); | 2288 __ j(equal, is_object); |
2258 | 2289 |
(...skipping 3375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5634 FixedArray::kHeaderSize - kPointerSize)); | 5665 FixedArray::kHeaderSize - kPointerSize)); |
5635 __ bind(&done); | 5666 __ bind(&done); |
5636 } | 5667 } |
5637 | 5668 |
5638 | 5669 |
5639 #undef __ | 5670 #undef __ |
5640 | 5671 |
5641 } } // namespace v8::internal | 5672 } } // namespace v8::internal |
5642 | 5673 |
5643 #endif // V8_TARGET_ARCH_X64 | 5674 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |