| 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 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1598 if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) { | 1598 if (instr->CheckFlag(HValue::kBailoutOnMinusZero)) { |
| 1599 temp = TempRegister(); | 1599 temp = TempRegister(); |
| 1600 } | 1600 } |
| 1601 LMulI* mul = new(zone()) LMulI(left, right, temp); | 1601 LMulI* mul = new(zone()) LMulI(left, right, temp); |
| 1602 if (instr->CheckFlag(HValue::kCanOverflow) || | 1602 if (instr->CheckFlag(HValue::kCanOverflow) || |
| 1603 instr->CheckFlag(HValue::kBailoutOnMinusZero)) { | 1603 instr->CheckFlag(HValue::kBailoutOnMinusZero)) { |
| 1604 AssignEnvironment(mul); | 1604 AssignEnvironment(mul); |
| 1605 } | 1605 } |
| 1606 return DefineSameAsFirst(mul); | 1606 return DefineSameAsFirst(mul); |
| 1607 } else if (instr->representation().IsDouble()) { | 1607 } else if (instr->representation().IsDouble()) { |
| 1608 return DoArithmeticD(Token::MUL, instr); | 1608 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { |
| 1609 return DoArithmeticD(Token::MUL, instr); |
| 1610 } |
| 1611 ASSERT(instr->right()->IsConstant() && |
| 1612 static_cast<HConstant*>(instr->right())->DoubleValue() == -1); |
| 1613 // TODO(olivf) This is currently just a hack to support the UnaryOp Minus |
| 1614 // Stub. This will go away once we can use more than one X87 register, |
| 1615 // thus fully support binary instructions without SSE2. |
| 1616 LOperand* left = UseX87TopOfStack(instr->left()); |
| 1617 LNegateNoSSE2D* result = new(zone()) LNegateNoSSE2D(left); |
| 1618 return DefineX87TOS(result); |
| 1609 } else { | 1619 } else { |
| 1610 ASSERT(instr->representation().IsSmiOrTagged()); | 1620 ASSERT(instr->representation().IsSmiOrTagged()); |
| 1611 return DoArithmeticT(Token::MUL, instr); | 1621 return DoArithmeticT(Token::MUL, instr); |
| 1612 } | 1622 } |
| 1613 } | 1623 } |
| 1614 | 1624 |
| 1615 | 1625 |
| 1616 LInstruction* LChunkBuilder::DoSub(HSub* instr) { | 1626 LInstruction* LChunkBuilder::DoSub(HSub* instr) { |
| 1617 if (instr->representation().IsInteger32()) { | 1627 if (instr->representation().IsInteger32()) { |
| 1618 ASSERT(instr->left()->representation().IsInteger32()); | 1628 ASSERT(instr->left()->representation().IsInteger32()); |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2063 return NULL; | 2073 return NULL; |
| 2064 } | 2074 } |
| 2065 | 2075 |
| 2066 | 2076 |
| 2067 LInstruction* LChunkBuilder::DoCheckNonSmi(HCheckNonSmi* instr) { | 2077 LInstruction* LChunkBuilder::DoCheckNonSmi(HCheckNonSmi* instr) { |
| 2068 LOperand* value = UseAtStart(instr->value()); | 2078 LOperand* value = UseAtStart(instr->value()); |
| 2069 return AssignEnvironment(new(zone()) LCheckNonSmi(value)); | 2079 return AssignEnvironment(new(zone()) LCheckNonSmi(value)); |
| 2070 } | 2080 } |
| 2071 | 2081 |
| 2072 | 2082 |
| 2083 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { |
| 2084 LOperand* value = UseRegisterAtStart(instr->value()); |
| 2085 return AssignEnvironment(new(zone()) LCheckSmi(value)); |
| 2086 } |
| 2087 |
| 2088 |
| 2089 LInstruction* LChunkBuilder::DoIsNumberAndBranch(HIsNumberAndBranch* instr) { |
| 2090 return new(zone()) |
| 2091 LIsNumberAndBranch(UseRegisterOrConstantAtStart(instr->value())); |
| 2092 } |
| 2093 |
| 2094 |
| 2073 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { | 2095 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { |
| 2074 LOperand* value = UseRegisterAtStart(instr->value()); | 2096 LOperand* value = UseRegisterAtStart(instr->value()); |
| 2075 LOperand* temp = TempRegister(); | 2097 LOperand* temp = TempRegister(); |
| 2076 LCheckInstanceType* result = new(zone()) LCheckInstanceType(value, temp); | 2098 LCheckInstanceType* result = new(zone()) LCheckInstanceType(value, temp); |
| 2077 return AssignEnvironment(result); | 2099 return AssignEnvironment(result); |
| 2078 } | 2100 } |
| 2079 | 2101 |
| 2080 | 2102 |
| 2081 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { | 2103 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { |
| 2082 LUnallocated* temp = TempRegister(); | 2104 LUnallocated* temp = TempRegister(); |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2814 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2836 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2815 LOperand* object = UseRegister(instr->object()); | 2837 LOperand* object = UseRegister(instr->object()); |
| 2816 LOperand* index = UseTempRegister(instr->index()); | 2838 LOperand* index = UseTempRegister(instr->index()); |
| 2817 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2839 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2818 } | 2840 } |
| 2819 | 2841 |
| 2820 | 2842 |
| 2821 } } // namespace v8::internal | 2843 } } // namespace v8::internal |
| 2822 | 2844 |
| 2823 #endif // V8_TARGET_ARCH_IA32 | 2845 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |