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 4403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4414 LOperand* input = instr->value(); | 4414 LOperand* input = instr->value(); |
4415 LOperand* output = instr->result(); | 4415 LOperand* output = instr->result(); |
4416 LOperand* temp = instr->temp(); | 4416 LOperand* temp = instr->temp(); |
4417 | 4417 |
4418 __ LoadUint32(ToDoubleRegister(output), | 4418 __ LoadUint32(ToDoubleRegister(output), |
4419 ToRegister(input), | 4419 ToRegister(input), |
4420 ToDoubleRegister(temp)); | 4420 ToDoubleRegister(temp)); |
4421 } | 4421 } |
4422 | 4422 |
4423 | 4423 |
| 4424 void LCodeGen::DoUint32ToSmi(LUint32ToSmi* instr) { |
| 4425 LOperand* input = instr->value(); |
| 4426 ASSERT(input->IsRegister()); |
| 4427 LOperand* output = instr->result(); |
| 4428 if (!instr->hydrogen()->value()->HasRange() || |
| 4429 !instr->hydrogen()->value()->range()->IsInSmiRange() || |
| 4430 instr->hydrogen()->value()->range()->upper() == kMaxInt) { |
| 4431 // The Range class can't express upper bounds in the (kMaxInt, kMaxUint32] |
| 4432 // interval, so we treat kMaxInt as a sentinel for this entire interval. |
| 4433 __ testl(ToRegister(input), Immediate(0x80000000)); |
| 4434 DeoptimizeIf(not_zero, instr->environment()); |
| 4435 } |
| 4436 __ Integer32ToSmi(ToRegister(output), ToRegister(input)); |
| 4437 } |
| 4438 |
| 4439 |
4424 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { | 4440 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
4425 LOperand* input = instr->value(); | 4441 LOperand* input = instr->value(); |
4426 ASSERT(input->IsRegister() && input->Equals(instr->result())); | 4442 ASSERT(input->IsRegister() && input->Equals(instr->result())); |
4427 Register reg = ToRegister(input); | 4443 Register reg = ToRegister(input); |
4428 | 4444 |
4429 __ Integer32ToSmi(reg, reg); | 4445 __ Integer32ToSmi(reg, reg); |
4430 } | 4446 } |
4431 | 4447 |
4432 | 4448 |
4433 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { | 4449 void LCodeGen::DoNumberTagU(LNumberTagU* instr) { |
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5455 FixedArray::kHeaderSize - kPointerSize)); | 5471 FixedArray::kHeaderSize - kPointerSize)); |
5456 __ bind(&done); | 5472 __ bind(&done); |
5457 } | 5473 } |
5458 | 5474 |
5459 | 5475 |
5460 #undef __ | 5476 #undef __ |
5461 | 5477 |
5462 } } // namespace v8::internal | 5478 } } // namespace v8::internal |
5463 | 5479 |
5464 #endif // V8_TARGET_ARCH_X64 | 5480 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |