OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) { | 1571 if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) { |
1572 temp = TempRegister(); | 1572 temp = TempRegister(); |
1573 } | 1573 } |
1574 LMulI* mul = new(zone()) LMulI(left, right, temp); | 1574 LMulI* mul = new(zone()) LMulI(left, right, temp); |
1575 if (instr->CheckFlag(HValue::kCanOverflow) || | 1575 if (instr->CheckFlag(HValue::kCanOverflow) || |
1576 instr->CheckFlag(HValue::kBailoutOnMinusZero)) { | 1576 instr->CheckFlag(HValue::kBailoutOnMinusZero)) { |
1577 AssignEnvironment(mul); | 1577 AssignEnvironment(mul); |
1578 } | 1578 } |
1579 return DefineSameAsFirst(mul); | 1579 return DefineSameAsFirst(mul); |
1580 } else if (instr->representation().IsDouble()) { | 1580 } else if (instr->representation().IsDouble()) { |
1581 return DoArithmeticD(Token::MUL, instr); | 1581 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { |
| 1582 return DoArithmeticD(Token::MUL, instr); |
| 1583 } |
| 1584 ASSERT(instr->right()->IsConstant() && |
| 1585 static_cast<HConstant*>(instr->right())->DoubleValue() == -1); |
| 1586 // TODO(olivf) This is currently just a hack to support the UnaryOp Minus |
| 1587 // Stub. This will go away once we can use more than one X87 register, |
| 1588 // thus fully support binary instructions without SSE2. |
| 1589 LOperand* left = UseX87TopOfStack(instr->left()); |
| 1590 LNegateNoSSE2D* result = new(zone()) LNegateNoSSE2D(left); |
| 1591 return DefineX87TOS(result); |
1582 } else { | 1592 } else { |
1583 ASSERT(instr->representation().IsSmiOrTagged()); | 1593 ASSERT(instr->representation().IsSmiOrTagged()); |
1584 return DoArithmeticT(Token::MUL, instr); | 1594 return DoArithmeticT(Token::MUL, instr); |
1585 } | 1595 } |
1586 } | 1596 } |
1587 | 1597 |
1588 | 1598 |
1589 LInstruction* LChunkBuilder::DoSub(HSub* instr) { | 1599 LInstruction* LChunkBuilder::DoSub(HSub* instr) { |
1590 if (instr->representation().IsInteger32()) { | 1600 if (instr->representation().IsInteger32()) { |
1591 ASSERT(instr->left()->representation().IsInteger32()); | 1601 ASSERT(instr->left()->representation().IsInteger32()); |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2031 return NULL; | 2041 return NULL; |
2032 } | 2042 } |
2033 | 2043 |
2034 | 2044 |
2035 LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) { | 2045 LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) { |
2036 LOperand* value = UseAtStart(instr->value()); | 2046 LOperand* value = UseAtStart(instr->value()); |
2037 return AssignEnvironment(new(zone()) LCheckNonSmi(value)); | 2047 return AssignEnvironment(new(zone()) LCheckNonSmi(value)); |
2038 } | 2048 } |
2039 | 2049 |
2040 | 2050 |
| 2051 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { |
| 2052 LOperand* value = UseRegisterAtStart(instr->value()); |
| 2053 return AssignEnvironment(new(zone()) LCheckSmi(value)); |
| 2054 } |
| 2055 |
| 2056 |
| 2057 LInstruction* LChunkBuilder::DoIsNumberAndBranch(HIsNumberAndBranch* instr) { |
| 2058 return new(zone()) |
| 2059 LIsNumberAndBranch(UseRegisterOrConstantAtStart(instr->value())); |
| 2060 } |
| 2061 |
| 2062 |
2041 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { | 2063 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { |
2042 LOperand* value = UseRegisterAtStart(instr->value()); | 2064 LOperand* value = UseRegisterAtStart(instr->value()); |
2043 LOperand* temp = TempRegister(); | 2065 LOperand* temp = TempRegister(); |
2044 LCheckInstanceType* result = new(zone()) LCheckInstanceType(value, temp); | 2066 LCheckInstanceType* result = new(zone()) LCheckInstanceType(value, temp); |
2045 return AssignEnvironment(result); | 2067 return AssignEnvironment(result); |
2046 } | 2068 } |
2047 | 2069 |
2048 | 2070 |
2049 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { | 2071 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { |
2050 LUnallocated* temp = TempRegister(); | 2072 LUnallocated* temp = TempRegister(); |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2782 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2804 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2783 LOperand* object = UseRegister(instr->object()); | 2805 LOperand* object = UseRegister(instr->object()); |
2784 LOperand* index = UseTempRegister(instr->index()); | 2806 LOperand* index = UseTempRegister(instr->index()); |
2785 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2807 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2786 } | 2808 } |
2787 | 2809 |
2788 | 2810 |
2789 } } // namespace v8::internal | 2811 } } // namespace v8::internal |
2790 | 2812 |
2791 #endif // V8_TARGET_ARCH_IA32 | 2813 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |