| 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 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { | 1581 return DoArithmeticD(Token::MUL, instr); |
| 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); | |
| 1592 } else { | 1582 } else { |
| 1593 ASSERT(instr->representation().IsSmiOrTagged()); | 1583 ASSERT(instr->representation().IsSmiOrTagged()); |
| 1594 return DoArithmeticT(Token::MUL, instr); | 1584 return DoArithmeticT(Token::MUL, instr); |
| 1595 } | 1585 } |
| 1596 } | 1586 } |
| 1597 | 1587 |
| 1598 | 1588 |
| 1599 LInstruction* LChunkBuilder::DoSub(HSub* instr) { | 1589 LInstruction* LChunkBuilder::DoSub(HSub* instr) { |
| 1600 if (instr->representation().IsInteger32()) { | 1590 if (instr->representation().IsInteger32()) { |
| 1601 ASSERT(instr->left()->representation().IsInteger32()); | 1591 ASSERT(instr->left()->representation().IsInteger32()); |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 return NULL; | 2031 return NULL; |
| 2042 } | 2032 } |
| 2043 | 2033 |
| 2044 | 2034 |
| 2045 LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) { | 2035 LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) { |
| 2046 LOperand* value = UseAtStart(instr->value()); | 2036 LOperand* value = UseAtStart(instr->value()); |
| 2047 return AssignEnvironment(new(zone()) LCheckNonSmi(value)); | 2037 return AssignEnvironment(new(zone()) LCheckNonSmi(value)); |
| 2048 } | 2038 } |
| 2049 | 2039 |
| 2050 | 2040 |
| 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 | |
| 2063 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { | 2041 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { |
| 2064 LOperand* value = UseRegisterAtStart(instr->value()); | 2042 LOperand* value = UseRegisterAtStart(instr->value()); |
| 2065 LOperand* temp = TempRegister(); | 2043 LOperand* temp = TempRegister(); |
| 2066 LCheckInstanceType* result = new(zone()) LCheckInstanceType(value, temp); | 2044 LCheckInstanceType* result = new(zone()) LCheckInstanceType(value, temp); |
| 2067 return AssignEnvironment(result); | 2045 return AssignEnvironment(result); |
| 2068 } | 2046 } |
| 2069 | 2047 |
| 2070 | 2048 |
| 2071 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { | 2049 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { |
| 2072 LUnallocated* temp = TempRegister(); | 2050 LUnallocated* temp = TempRegister(); |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2804 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2782 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2805 LOperand* object = UseRegister(instr->object()); | 2783 LOperand* object = UseRegister(instr->object()); |
| 2806 LOperand* index = UseTempRegister(instr->index()); | 2784 LOperand* index = UseTempRegister(instr->index()); |
| 2807 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2785 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2808 } | 2786 } |
| 2809 | 2787 |
| 2810 | 2788 |
| 2811 } } // namespace v8::internal | 2789 } } // namespace v8::internal |
| 2812 | 2790 |
| 2813 #endif // V8_TARGET_ARCH_IA32 | 2791 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |