| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 V(CmpMapAndBranch) \ | 77 V(CmpMapAndBranch) \ |
| 78 V(CmpObjectEqAndBranch) \ | 78 V(CmpObjectEqAndBranch) \ |
| 79 V(CmpT) \ | 79 V(CmpT) \ |
| 80 V(CompareMinusZeroAndBranch) \ | 80 V(CompareMinusZeroAndBranch) \ |
| 81 V(CompareNumericAndBranch) \ | 81 V(CompareNumericAndBranch) \ |
| 82 V(ConstantD) \ | 82 V(ConstantD) \ |
| 83 V(ConstantE) \ | 83 V(ConstantE) \ |
| 84 V(ConstantI) \ | 84 V(ConstantI) \ |
| 85 V(ConstantS) \ | 85 V(ConstantS) \ |
| 86 V(ConstantT) \ | 86 V(ConstantT) \ |
| 87 V(ConstructDouble) \ |
| 87 V(Context) \ | 88 V(Context) \ |
| 88 V(DateField) \ | 89 V(DateField) \ |
| 89 V(DebugBreak) \ | 90 V(DebugBreak) \ |
| 90 V(DeclareGlobals) \ | 91 V(DeclareGlobals) \ |
| 91 V(Deoptimize) \ | 92 V(Deoptimize) \ |
| 93 V(DivByConstI) \ |
| 94 V(DivByPowerOf2I) \ |
| 92 V(DivI) \ | 95 V(DivI) \ |
| 96 V(DoubleBits) \ |
| 93 V(DoubleToIntOrSmi) \ | 97 V(DoubleToIntOrSmi) \ |
| 94 V(Drop) \ | 98 V(Drop) \ |
| 95 V(Dummy) \ | 99 V(Dummy) \ |
| 96 V(DummyUse) \ | 100 V(DummyUse) \ |
| 101 V(FlooringDivByConstI) \ |
| 102 V(FlooringDivByPowerOf2I) \ |
| 103 V(FlooringDivI) \ |
| 97 V(ForInCacheArray) \ | 104 V(ForInCacheArray) \ |
| 98 V(ForInPrepareMap) \ | 105 V(ForInPrepareMap) \ |
| 99 V(FunctionLiteral) \ | 106 V(FunctionLiteral) \ |
| 100 V(GetCachedArrayIndex) \ | 107 V(GetCachedArrayIndex) \ |
| 101 V(Goto) \ | 108 V(Goto) \ |
| 102 V(HasCachedArrayIndexAndBranch) \ | 109 V(HasCachedArrayIndexAndBranch) \ |
| 103 V(HasInstanceTypeAndBranch) \ | 110 V(HasInstanceTypeAndBranch) \ |
| 104 V(InnerAllocatedObject) \ | 111 V(InnerAllocatedObject) \ |
| 105 V(InstanceOf) \ | 112 V(InstanceOf) \ |
| 106 V(InstanceOfKnownGlobal) \ | 113 V(InstanceOfKnownGlobal) \ |
| 107 V(InstructionGap) \ | 114 V(InstructionGap) \ |
| 108 V(Integer32ToDouble) \ | 115 V(Integer32ToDouble) \ |
| 109 V(Integer32ToSmi) \ | |
| 110 V(InvokeFunction) \ | 116 V(InvokeFunction) \ |
| 111 V(IsConstructCallAndBranch) \ | 117 V(IsConstructCallAndBranch) \ |
| 112 V(IsObjectAndBranch) \ | 118 V(IsObjectAndBranch) \ |
| 113 V(IsSmiAndBranch) \ | 119 V(IsSmiAndBranch) \ |
| 114 V(IsStringAndBranch) \ | 120 V(IsStringAndBranch) \ |
| 115 V(IsUndetectableAndBranch) \ | 121 V(IsUndetectableAndBranch) \ |
| 116 V(Label) \ | 122 V(Label) \ |
| 117 V(LazyBailout) \ | 123 V(LazyBailout) \ |
| 118 V(LoadContextSlot) \ | 124 V(LoadContextSlot) \ |
| 119 V(LoadFieldByIndex) \ | 125 V(LoadFieldByIndex) \ |
| 120 V(LoadFunctionPrototype) \ | 126 V(LoadFunctionPrototype) \ |
| 121 V(LoadGlobalCell) \ | 127 V(LoadGlobalCell) \ |
| 122 V(LoadGlobalGeneric) \ | 128 V(LoadGlobalGeneric) \ |
| 123 V(LoadKeyedExternal) \ | 129 V(LoadKeyedExternal) \ |
| 124 V(LoadKeyedFixed) \ | 130 V(LoadKeyedFixed) \ |
| 125 V(LoadKeyedFixedDouble) \ | 131 V(LoadKeyedFixedDouble) \ |
| 126 V(LoadKeyedGeneric) \ | 132 V(LoadKeyedGeneric) \ |
| 127 V(LoadNamedField) \ | 133 V(LoadNamedField) \ |
| 128 V(LoadNamedGeneric) \ | 134 V(LoadNamedGeneric) \ |
| 129 V(LoadRoot) \ | 135 V(LoadRoot) \ |
| 130 V(MapEnumLength) \ | 136 V(MapEnumLength) \ |
| 131 V(MathAbs) \ | 137 V(MathAbs) \ |
| 132 V(MathAbsTagged) \ | 138 V(MathAbsTagged) \ |
| 133 V(MathClz32) \ | 139 V(MathClz32) \ |
| 134 V(MathExp) \ | 140 V(MathExp) \ |
| 135 V(MathFloor) \ | 141 V(MathFloor) \ |
| 136 V(MathFloorOfDiv) \ | |
| 137 V(MathLog) \ | 142 V(MathLog) \ |
| 138 V(MathMinMax) \ | 143 V(MathMinMax) \ |
| 139 V(MathPowHalf) \ | 144 V(MathPowHalf) \ |
| 140 V(MathRound) \ | 145 V(MathRound) \ |
| 141 V(MathSqrt) \ | 146 V(MathSqrt) \ |
| 147 V(ModByConstI) \ |
| 148 V(ModByPowerOf2I) \ |
| 142 V(ModI) \ | 149 V(ModI) \ |
| 143 V(MulConstIS) \ | 150 V(MulConstIS) \ |
| 144 V(MulI) \ | 151 V(MulI) \ |
| 145 V(MulS) \ | 152 V(MulS) \ |
| 146 V(NumberTagD) \ | 153 V(NumberTagD) \ |
| 147 V(NumberTagU) \ | 154 V(NumberTagU) \ |
| 148 V(NumberUntagD) \ | 155 V(NumberUntagD) \ |
| 149 V(OsrEntry) \ | 156 V(OsrEntry) \ |
| 150 V(Parameter) \ | 157 V(Parameter) \ |
| 151 V(Power) \ | 158 V(Power) \ |
| (...skipping 24 matching lines...) Expand all Loading... |
| 176 V(SubS) \ | 183 V(SubS) \ |
| 177 V(TaggedToI) \ | 184 V(TaggedToI) \ |
| 178 V(ThisFunction) \ | 185 V(ThisFunction) \ |
| 179 V(ToFastProperties) \ | 186 V(ToFastProperties) \ |
| 180 V(TransitionElementsKind) \ | 187 V(TransitionElementsKind) \ |
| 181 V(TrapAllocationMemento) \ | 188 V(TrapAllocationMemento) \ |
| 182 V(TruncateDoubleToIntOrSmi) \ | 189 V(TruncateDoubleToIntOrSmi) \ |
| 183 V(Typeof) \ | 190 V(Typeof) \ |
| 184 V(TypeofIsAndBranch) \ | 191 V(TypeofIsAndBranch) \ |
| 185 V(Uint32ToDouble) \ | 192 V(Uint32ToDouble) \ |
| 186 V(Uint32ToSmi) \ | |
| 187 V(UnknownOSRValue) \ | 193 V(UnknownOSRValue) \ |
| 188 V(WrapReceiver) | 194 V(WrapReceiver) |
| 189 | 195 |
| 190 | 196 |
| 191 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 197 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
| 192 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ | 198 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ |
| 193 return LInstruction::k##type; \ | 199 return LInstruction::k##type; \ |
| 194 } \ | 200 } \ |
| 195 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \ | 201 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \ |
| 196 virtual const char* Mnemonic() const V8_FINAL V8_OVERRIDE { \ | 202 virtual const char* Mnemonic() const V8_FINAL V8_OVERRIDE { \ |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 } | 605 } |
| 600 | 606 |
| 601 LOperand* left() { return inputs_[0]; } | 607 LOperand* left() { return inputs_[0]; } |
| 602 LOperand* right() { return inputs_[1]; } | 608 LOperand* right() { return inputs_[1]; } |
| 603 | 609 |
| 604 DECLARE_CONCRETE_INSTRUCTION(AddS, "add-s") | 610 DECLARE_CONCRETE_INSTRUCTION(AddS, "add-s") |
| 605 DECLARE_HYDROGEN_ACCESSOR(Add) | 611 DECLARE_HYDROGEN_ACCESSOR(Add) |
| 606 }; | 612 }; |
| 607 | 613 |
| 608 | 614 |
| 609 class LAllocate V8_FINAL : public LTemplateInstruction<1, 2, 2> { | 615 class LAllocate V8_FINAL : public LTemplateInstruction<1, 2, 3> { |
| 610 public: | 616 public: |
| 611 LAllocate(LOperand* context, | 617 LAllocate(LOperand* context, |
| 612 LOperand* size, | 618 LOperand* size, |
| 613 LOperand* temp1, | 619 LOperand* temp1, |
| 614 LOperand* temp2) { | 620 LOperand* temp2, |
| 621 LOperand* temp3) { |
| 615 inputs_[0] = context; | 622 inputs_[0] = context; |
| 616 inputs_[1] = size; | 623 inputs_[1] = size; |
| 617 temps_[0] = temp1; | 624 temps_[0] = temp1; |
| 618 temps_[1] = temp2; | 625 temps_[1] = temp2; |
| 626 temps_[2] = temp3; |
| 619 } | 627 } |
| 620 | 628 |
| 621 LOperand* context() { return inputs_[0]; } | 629 LOperand* context() { return inputs_[0]; } |
| 622 LOperand* size() { return inputs_[1]; } | 630 LOperand* size() { return inputs_[1]; } |
| 623 LOperand* temp1() { return temps_[0]; } | 631 LOperand* temp1() { return temps_[0]; } |
| 624 LOperand* temp2() { return temps_[1]; } | 632 LOperand* temp2() { return temps_[1]; } |
| 633 LOperand* temp3() { return temps_[2]; } |
| 625 | 634 |
| 626 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate") | 635 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate") |
| 627 DECLARE_HYDROGEN_ACCESSOR(Allocate) | 636 DECLARE_HYDROGEN_ACCESSOR(Allocate) |
| 628 }; | 637 }; |
| 629 | 638 |
| 630 | 639 |
| 631 class LApplyArguments V8_FINAL : public LTemplateInstruction<1, 4, 0> { | 640 class LApplyArguments V8_FINAL : public LTemplateInstruction<1, 4, 0> { |
| 632 public: | 641 public: |
| 633 LApplyArguments(LOperand* function, | 642 LApplyArguments(LOperand* function, |
| 634 LOperand* receiver, | 643 LOperand* receiver, |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 } | 1013 } |
| 1005 | 1014 |
| 1006 LOperand* unclamped() { return inputs_[0]; } | 1015 LOperand* unclamped() { return inputs_[0]; } |
| 1007 LOperand* temp1() { return temps_[0]; } | 1016 LOperand* temp1() { return temps_[0]; } |
| 1008 LOperand* temp2() { return temps_[1]; } | 1017 LOperand* temp2() { return temps_[1]; } |
| 1009 | 1018 |
| 1010 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") | 1019 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") |
| 1011 }; | 1020 }; |
| 1012 | 1021 |
| 1013 | 1022 |
| 1023 class LDoubleBits V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1024 public: |
| 1025 explicit LDoubleBits(LOperand* value) { |
| 1026 inputs_[0] = value; |
| 1027 } |
| 1028 |
| 1029 LOperand* value() { return inputs_[0]; } |
| 1030 |
| 1031 DECLARE_CONCRETE_INSTRUCTION(DoubleBits, "double-bits") |
| 1032 DECLARE_HYDROGEN_ACCESSOR(DoubleBits) |
| 1033 }; |
| 1034 |
| 1035 |
| 1036 class LConstructDouble V8_FINAL : public LTemplateInstruction<1, 2, 1> { |
| 1037 public: |
| 1038 LConstructDouble(LOperand* hi, LOperand* lo, LOperand* temp) { |
| 1039 inputs_[0] = hi; |
| 1040 inputs_[1] = lo; |
| 1041 temps_[0] = temp; |
| 1042 } |
| 1043 |
| 1044 LOperand* hi() { return inputs_[0]; } |
| 1045 LOperand* lo() { return inputs_[1]; } |
| 1046 LOperand* temp() { return temps_[0]; } |
| 1047 |
| 1048 DECLARE_CONCRETE_INSTRUCTION(ConstructDouble, "construct-double") |
| 1049 }; |
| 1050 |
| 1051 |
| 1014 class LClassOfTestAndBranch V8_FINAL : public LControlInstruction<1, 2> { | 1052 class LClassOfTestAndBranch V8_FINAL : public LControlInstruction<1, 2> { |
| 1015 public: | 1053 public: |
| 1016 LClassOfTestAndBranch(LOperand* value, LOperand* temp1, LOperand* temp2) { | 1054 LClassOfTestAndBranch(LOperand* value, LOperand* temp1, LOperand* temp2) { |
| 1017 inputs_[0] = value; | 1055 inputs_[0] = value; |
| 1018 temps_[0] = temp1; | 1056 temps_[0] = temp1; |
| 1019 temps_[1] = temp2; | 1057 temps_[1] = temp2; |
| 1020 } | 1058 } |
| 1021 | 1059 |
| 1022 LOperand* value() { return inputs_[0]; } | 1060 LOperand* value() { return inputs_[0]; } |
| 1023 LOperand* temp1() { return temps_[0]; } | 1061 LOperand* temp1() { return temps_[0]; } |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 }; | 1279 }; |
| 1242 | 1280 |
| 1243 | 1281 |
| 1244 class LDeoptimize V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 1282 class LDeoptimize V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
| 1245 public: | 1283 public: |
| 1246 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") | 1284 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") |
| 1247 DECLARE_HYDROGEN_ACCESSOR(Deoptimize) | 1285 DECLARE_HYDROGEN_ACCESSOR(Deoptimize) |
| 1248 }; | 1286 }; |
| 1249 | 1287 |
| 1250 | 1288 |
| 1289 class LDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1290 public: |
| 1291 LDivByPowerOf2I(LOperand* dividend, int32_t divisor) { |
| 1292 inputs_[0] = dividend; |
| 1293 divisor_ = divisor; |
| 1294 } |
| 1295 |
| 1296 LOperand* dividend() { return inputs_[0]; } |
| 1297 int32_t divisor() const { return divisor_; } |
| 1298 |
| 1299 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i") |
| 1300 DECLARE_HYDROGEN_ACCESSOR(Div) |
| 1301 |
| 1302 private: |
| 1303 int32_t divisor_; |
| 1304 }; |
| 1305 |
| 1306 |
| 1307 class LDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
| 1308 public: |
| 1309 LDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { |
| 1310 inputs_[0] = dividend; |
| 1311 divisor_ = divisor; |
| 1312 temps_[0] = temp; |
| 1313 } |
| 1314 |
| 1315 LOperand* dividend() { return inputs_[0]; } |
| 1316 int32_t divisor() const { return divisor_; } |
| 1317 LOperand* temp() { return temps_[0]; } |
| 1318 |
| 1319 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i") |
| 1320 DECLARE_HYDROGEN_ACCESSOR(Div) |
| 1321 |
| 1322 private: |
| 1323 int32_t divisor_; |
| 1324 }; |
| 1325 |
| 1326 |
| 1251 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 1327 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { |
| 1252 public: | 1328 public: |
| 1253 LDivI(LOperand* left, LOperand* right, LOperand* temp) { | 1329 LDivI(LOperand* left, LOperand* right, LOperand* temp) { |
| 1254 inputs_[0] = left; | 1330 inputs_[0] = left; |
| 1255 inputs_[1] = right; | 1331 inputs_[1] = right; |
| 1256 temps_[0] = temp; | 1332 temps_[0] = temp; |
| 1257 } | 1333 } |
| 1258 | 1334 |
| 1259 LOperand* left() { return inputs_[0]; } | 1335 LOperand* left() { return inputs_[0]; } |
| 1260 LOperand* right() { return inputs_[1]; } | 1336 LOperand* right() { return inputs_[1]; } |
| 1261 LOperand* temp() { return temps_[0]; } | 1337 LOperand* temp() { return temps_[0]; } |
| 1262 | 1338 |
| 1263 bool is_flooring() { return hydrogen_value()->IsMathFloorOfDiv(); } | |
| 1264 | |
| 1265 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") | 1339 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") |
| 1266 DECLARE_HYDROGEN_ACCESSOR(Div) | 1340 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation) |
| 1267 }; | 1341 }; |
| 1268 | 1342 |
| 1269 | 1343 |
| 1270 class LDoubleToIntOrSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1344 class LDoubleToIntOrSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1271 public: | 1345 public: |
| 1272 explicit LDoubleToIntOrSmi(LOperand* value) { | 1346 explicit LDoubleToIntOrSmi(LOperand* value) { |
| 1273 inputs_[0] = value; | 1347 inputs_[0] = value; |
| 1274 } | 1348 } |
| 1275 | 1349 |
| 1276 LOperand* value() { return inputs_[0]; } | 1350 LOperand* value() { return inputs_[0]; } |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1427 explicit LInteger32ToDouble(LOperand* value) { | 1501 explicit LInteger32ToDouble(LOperand* value) { |
| 1428 inputs_[0] = value; | 1502 inputs_[0] = value; |
| 1429 } | 1503 } |
| 1430 | 1504 |
| 1431 LOperand* value() { return inputs_[0]; } | 1505 LOperand* value() { return inputs_[0]; } |
| 1432 | 1506 |
| 1433 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") | 1507 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") |
| 1434 }; | 1508 }; |
| 1435 | 1509 |
| 1436 | 1510 |
| 1437 class LInteger32ToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> { | |
| 1438 public: | |
| 1439 explicit LInteger32ToSmi(LOperand* value) { | |
| 1440 inputs_[0] = value; | |
| 1441 } | |
| 1442 | |
| 1443 LOperand* value() { return inputs_[0]; } | |
| 1444 | |
| 1445 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-smi") | |
| 1446 DECLARE_HYDROGEN_ACCESSOR(Change) | |
| 1447 }; | |
| 1448 | |
| 1449 | |
| 1450 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { | 1511 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { |
| 1451 public: | 1512 public: |
| 1452 LCallWithDescriptor(const CallInterfaceDescriptor* descriptor, | 1513 LCallWithDescriptor(const CallInterfaceDescriptor* descriptor, |
| 1453 ZoneList<LOperand*>& operands, | 1514 ZoneList<LOperand*>& operands, |
| 1454 Zone* zone) | 1515 Zone* zone) |
| 1455 : descriptor_(descriptor), | 1516 : descriptor_(descriptor), |
| 1456 inputs_(descriptor->environment_length() + 1, zone) { | 1517 inputs_(descriptor->environment_length() + 1, zone) { |
| 1457 ASSERT(descriptor->environment_length() + 1 == operands.length()); | 1518 ASSERT(descriptor->environment_length() + 1 == operands.length()); |
| 1458 inputs_.AddAll(operands, zone); | 1519 inputs_.AddAll(operands, zone); |
| 1459 } | 1520 } |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1871 }; | 1932 }; |
| 1872 | 1933 |
| 1873 | 1934 |
| 1874 class LMathFloor V8_FINAL : public LUnaryMathOperation<0> { | 1935 class LMathFloor V8_FINAL : public LUnaryMathOperation<0> { |
| 1875 public: | 1936 public: |
| 1876 explicit LMathFloor(LOperand* value) : LUnaryMathOperation<0>(value) { } | 1937 explicit LMathFloor(LOperand* value) : LUnaryMathOperation<0>(value) { } |
| 1877 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") | 1938 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") |
| 1878 }; | 1939 }; |
| 1879 | 1940 |
| 1880 | 1941 |
| 1881 class LMathFloorOfDiv V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 1942 class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1882 public: | 1943 public: |
| 1883 LMathFloorOfDiv(LOperand* left, | 1944 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) { |
| 1884 LOperand* right, | 1945 inputs_[0] = dividend; |
| 1885 LOperand* temp = NULL) { | 1946 divisor_ = divisor; |
| 1886 inputs_[0] = left; | 1947 } |
| 1887 inputs_[1] = right; | 1948 |
| 1949 LOperand* dividend() { return inputs_[0]; } |
| 1950 int32_t divisor() const { return divisor_; } |
| 1951 |
| 1952 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, |
| 1953 "flooring-div-by-power-of-2-i") |
| 1954 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
| 1955 |
| 1956 private: |
| 1957 int32_t divisor_; |
| 1958 }; |
| 1959 |
| 1960 |
| 1961 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1962 public: |
| 1963 LFlooringDivByConstI(LOperand* dividend, int32_t divisor) { |
| 1964 inputs_[0] = dividend; |
| 1965 divisor_ = divisor; |
| 1966 } |
| 1967 |
| 1968 LOperand* dividend() { return inputs_[0]; } |
| 1969 int32_t divisor() const { return divisor_; } |
| 1970 LOperand* temp1() { return temps_[0]; } |
| 1971 |
| 1972 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") |
| 1973 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
| 1974 |
| 1975 private: |
| 1976 int32_t divisor_; |
| 1977 }; |
| 1978 |
| 1979 |
| 1980 class LFlooringDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { |
| 1981 public: |
| 1982 LFlooringDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { |
| 1983 inputs_[0] = dividend; |
| 1984 inputs_[1] = divisor; |
| 1888 temps_[0] = temp; | 1985 temps_[0] = temp; |
| 1889 } | 1986 } |
| 1890 | 1987 |
| 1891 LOperand* left() { return inputs_[0]; } | 1988 LOperand* dividend() { return inputs_[0]; } |
| 1892 LOperand* right() { return inputs_[1]; } | 1989 LOperand* divisor() { return inputs_[1]; } |
| 1893 LOperand* temp() { return temps_[0]; } | 1990 LOperand* temp() { return temps_[0]; } |
| 1894 | 1991 |
| 1895 DECLARE_CONCRETE_INSTRUCTION(MathFloorOfDiv, "math-floor-of-div") | 1992 DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i") |
| 1896 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) | 1993 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
| 1897 }; | 1994 }; |
| 1898 | 1995 |
| 1899 | 1996 |
| 1900 class LMathLog V8_FINAL : public LUnaryMathOperation<0> { | 1997 class LMathLog V8_FINAL : public LUnaryMathOperation<0> { |
| 1901 public: | 1998 public: |
| 1902 explicit LMathLog(LOperand* value) : LUnaryMathOperation<0>(value) { } | 1999 explicit LMathLog(LOperand* value) : LUnaryMathOperation<0>(value) { } |
| 1903 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log") | 2000 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log") |
| 1904 }; | 2001 }; |
| 1905 | 2002 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1946 }; | 2043 }; |
| 1947 | 2044 |
| 1948 | 2045 |
| 1949 class LMathSqrt V8_FINAL : public LUnaryMathOperation<0> { | 2046 class LMathSqrt V8_FINAL : public LUnaryMathOperation<0> { |
| 1950 public: | 2047 public: |
| 1951 explicit LMathSqrt(LOperand* value) : LUnaryMathOperation<0>(value) { } | 2048 explicit LMathSqrt(LOperand* value) : LUnaryMathOperation<0>(value) { } |
| 1952 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt") | 2049 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt") |
| 1953 }; | 2050 }; |
| 1954 | 2051 |
| 1955 | 2052 |
| 2053 class LModByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2054 public: |
| 2055 LModByPowerOf2I(LOperand* dividend, int32_t divisor) { |
| 2056 inputs_[0] = dividend; |
| 2057 divisor_ = divisor; |
| 2058 } |
| 2059 |
| 2060 LOperand* dividend() { return inputs_[0]; } |
| 2061 int32_t divisor() const { return divisor_; } |
| 2062 |
| 2063 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i") |
| 2064 DECLARE_HYDROGEN_ACCESSOR(Mod) |
| 2065 |
| 2066 private: |
| 2067 int32_t divisor_; |
| 2068 }; |
| 2069 |
| 2070 |
| 2071 class LModByConstI V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
| 2072 public: |
| 2073 LModByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { |
| 2074 inputs_[0] = dividend; |
| 2075 divisor_ = divisor; |
| 2076 temps_[0] = temp; |
| 2077 } |
| 2078 |
| 2079 LOperand* dividend() { return inputs_[0]; } |
| 2080 int32_t divisor() const { return divisor_; } |
| 2081 LOperand* temp() { return temps_[0]; } |
| 2082 |
| 2083 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i") |
| 2084 DECLARE_HYDROGEN_ACCESSOR(Mod) |
| 2085 |
| 2086 private: |
| 2087 int32_t divisor_; |
| 2088 }; |
| 2089 |
| 2090 |
| 1956 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2091 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
| 1957 public: | 2092 public: |
| 1958 LModI(LOperand* left, LOperand* right) { | 2093 LModI(LOperand* left, LOperand* right) { |
| 1959 inputs_[0] = left; | 2094 inputs_[0] = left; |
| 1960 inputs_[1] = right; | 2095 inputs_[1] = right; |
| 1961 } | 2096 } |
| 1962 | 2097 |
| 1963 LOperand* left() { return inputs_[0]; } | 2098 LOperand* left() { return inputs_[0]; } |
| 1964 LOperand* right() { return inputs_[1]; } | 2099 LOperand* right() { return inputs_[1]; } |
| 1965 | 2100 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2180 | 2315 |
| 2181 class LSmiTag V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2316 class LSmiTag V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2182 public: | 2317 public: |
| 2183 explicit LSmiTag(LOperand* value) { | 2318 explicit LSmiTag(LOperand* value) { |
| 2184 inputs_[0] = value; | 2319 inputs_[0] = value; |
| 2185 } | 2320 } |
| 2186 | 2321 |
| 2187 LOperand* value() { return inputs_[0]; } | 2322 LOperand* value() { return inputs_[0]; } |
| 2188 | 2323 |
| 2189 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") | 2324 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") |
| 2325 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 2190 }; | 2326 }; |
| 2191 | 2327 |
| 2192 | 2328 |
| 2193 class LSmiUntag V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2329 class LSmiUntag V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2194 public: | 2330 public: |
| 2195 LSmiUntag(LOperand* value, bool needs_check) | 2331 LSmiUntag(LOperand* value, bool needs_check) |
| 2196 : needs_check_(needs_check) { | 2332 : needs_check_(needs_check) { |
| 2197 inputs_[0] = value; | 2333 inputs_[0] = value; |
| 2198 } | 2334 } |
| 2199 | 2335 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2334 LOperand* context() { return inputs_[0]; } | 2470 LOperand* context() { return inputs_[0]; } |
| 2335 LOperand* object() { return inputs_[1]; } | 2471 LOperand* object() { return inputs_[1]; } |
| 2336 LOperand* key() { return inputs_[2]; } | 2472 LOperand* key() { return inputs_[2]; } |
| 2337 LOperand* value() { return inputs_[3]; } | 2473 LOperand* value() { return inputs_[3]; } |
| 2338 | 2474 |
| 2339 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") | 2475 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") |
| 2340 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) | 2476 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) |
| 2341 | 2477 |
| 2342 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2478 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 2343 | 2479 |
| 2344 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } | 2480 StrictMode strict_mode() { return hydrogen()->strict_mode(); } |
| 2345 }; | 2481 }; |
| 2346 | 2482 |
| 2347 | 2483 |
| 2348 class LStoreNamedField V8_FINAL : public LTemplateInstruction<0, 2, 2> { | 2484 class LStoreNamedField V8_FINAL : public LTemplateInstruction<0, 2, 2> { |
| 2349 public: | 2485 public: |
| 2350 LStoreNamedField(LOperand* object, LOperand* value, | 2486 LStoreNamedField(LOperand* object, LOperand* value, |
| 2351 LOperand* temp0, LOperand* temp1) { | 2487 LOperand* temp0, LOperand* temp1) { |
| 2352 inputs_[0] = object; | 2488 inputs_[0] = object; |
| 2353 inputs_[1] = value; | 2489 inputs_[1] = value; |
| 2354 temps_[0] = temp0; | 2490 temps_[0] = temp0; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2383 LOperand* context() { return inputs_[0]; } | 2519 LOperand* context() { return inputs_[0]; } |
| 2384 LOperand* object() { return inputs_[1]; } | 2520 LOperand* object() { return inputs_[1]; } |
| 2385 LOperand* value() { return inputs_[2]; } | 2521 LOperand* value() { return inputs_[2]; } |
| 2386 | 2522 |
| 2387 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") | 2523 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") |
| 2388 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) | 2524 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) |
| 2389 | 2525 |
| 2390 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2526 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 2391 | 2527 |
| 2392 Handle<Object> name() const { return hydrogen()->name(); } | 2528 Handle<Object> name() const { return hydrogen()->name(); } |
| 2393 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } | 2529 StrictMode strict_mode() { return hydrogen()->strict_mode(); } |
| 2394 }; | 2530 }; |
| 2395 | 2531 |
| 2396 | 2532 |
| 2397 class LStringAdd V8_FINAL : public LTemplateInstruction<1, 3, 0> { | 2533 class LStringAdd V8_FINAL : public LTemplateInstruction<1, 3, 0> { |
| 2398 public: | 2534 public: |
| 2399 LStringAdd(LOperand* context, LOperand* left, LOperand* right) { | 2535 LStringAdd(LOperand* context, LOperand* left, LOperand* right) { |
| 2400 inputs_[0] = context; | 2536 inputs_[0] = context; |
| 2401 inputs_[1] = left; | 2537 inputs_[1] = left; |
| 2402 inputs_[2] = right; | 2538 inputs_[2] = right; |
| 2403 } | 2539 } |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2743 explicit LUint32ToDouble(LOperand* value) { | 2879 explicit LUint32ToDouble(LOperand* value) { |
| 2744 inputs_[0] = value; | 2880 inputs_[0] = value; |
| 2745 } | 2881 } |
| 2746 | 2882 |
| 2747 LOperand* value() { return inputs_[0]; } | 2883 LOperand* value() { return inputs_[0]; } |
| 2748 | 2884 |
| 2749 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") | 2885 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") |
| 2750 }; | 2886 }; |
| 2751 | 2887 |
| 2752 | 2888 |
| 2753 class LUint32ToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> { | |
| 2754 public: | |
| 2755 explicit LUint32ToSmi(LOperand* value) { | |
| 2756 inputs_[0] = value; | |
| 2757 } | |
| 2758 | |
| 2759 LOperand* value() { return inputs_[0]; } | |
| 2760 | |
| 2761 DECLARE_CONCRETE_INSTRUCTION(Uint32ToSmi, "uint32-to-smi") | |
| 2762 DECLARE_HYDROGEN_ACCESSOR(Change) | |
| 2763 }; | |
| 2764 | |
| 2765 | |
| 2766 class LCheckMapValue V8_FINAL : public LTemplateInstruction<0, 2, 1> { | 2889 class LCheckMapValue V8_FINAL : public LTemplateInstruction<0, 2, 1> { |
| 2767 public: | 2890 public: |
| 2768 LCheckMapValue(LOperand* value, LOperand* map, LOperand* temp) { | 2891 LCheckMapValue(LOperand* value, LOperand* map, LOperand* temp) { |
| 2769 inputs_[0] = value; | 2892 inputs_[0] = value; |
| 2770 inputs_[1] = map; | 2893 inputs_[1] = map; |
| 2771 temps_[0] = temp; | 2894 temps_[0] = temp; |
| 2772 } | 2895 } |
| 2773 | 2896 |
| 2774 LOperand* value() { return inputs_[0]; } | 2897 LOperand* value() { return inputs_[0]; } |
| 2775 LOperand* map() { return inputs_[1]; } | 2898 LOperand* map() { return inputs_[1]; } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2822 class LChunkBuilder V8_FINAL : public LChunkBuilderBase { | 2945 class LChunkBuilder V8_FINAL : public LChunkBuilderBase { |
| 2823 public: | 2946 public: |
| 2824 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2947 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
| 2825 : LChunkBuilderBase(graph->zone()), | 2948 : LChunkBuilderBase(graph->zone()), |
| 2826 chunk_(NULL), | 2949 chunk_(NULL), |
| 2827 info_(info), | 2950 info_(info), |
| 2828 graph_(graph), | 2951 graph_(graph), |
| 2829 status_(UNUSED), | 2952 status_(UNUSED), |
| 2830 current_instruction_(NULL), | 2953 current_instruction_(NULL), |
| 2831 current_block_(NULL), | 2954 current_block_(NULL), |
| 2832 allocator_(allocator), | 2955 allocator_(allocator) { } |
| 2833 instruction_pending_deoptimization_environment_(NULL), | |
| 2834 pending_deoptimization_ast_id_(BailoutId::None()) { } | |
| 2835 | 2956 |
| 2836 // Build the sequence for the graph. | 2957 // Build the sequence for the graph. |
| 2837 LPlatformChunk* Build(); | 2958 LPlatformChunk* Build(); |
| 2838 | 2959 |
| 2839 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); | 2960 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); |
| 2840 | 2961 |
| 2841 // Declare methods that deal with the individual node types. | 2962 // Declare methods that deal with the individual node types. |
| 2842 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2963 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
| 2843 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2964 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
| 2844 #undef DECLARE_DO | 2965 #undef DECLARE_DO |
| 2845 | 2966 |
| 2967 LInstruction* DoDivByPowerOf2I(HDiv* instr); |
| 2968 LInstruction* DoDivByConstI(HDiv* instr); |
| 2969 LInstruction* DoDivI(HBinaryOperation* instr); |
| 2970 LInstruction* DoModByPowerOf2I(HMod* instr); |
| 2971 LInstruction* DoModByConstI(HMod* instr); |
| 2972 LInstruction* DoModI(HMod* instr); |
| 2973 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); |
| 2974 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); |
| 2975 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); |
| 2976 |
| 2846 static bool HasMagicNumberForDivision(int32_t divisor); | 2977 static bool HasMagicNumberForDivision(int32_t divisor); |
| 2847 | 2978 |
| 2848 private: | 2979 private: |
| 2849 enum Status { | 2980 enum Status { |
| 2850 UNUSED, | 2981 UNUSED, |
| 2851 BUILDING, | 2982 BUILDING, |
| 2852 DONE, | 2983 DONE, |
| 2853 ABORTED | 2984 ABORTED |
| 2854 }; | 2985 }; |
| 2855 | 2986 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2951 LInstruction* DoArithmeticT(Token::Value op, | 3082 LInstruction* DoArithmeticT(Token::Value op, |
| 2952 HBinaryOperation* instr); | 3083 HBinaryOperation* instr); |
| 2953 | 3084 |
| 2954 LPlatformChunk* chunk_; | 3085 LPlatformChunk* chunk_; |
| 2955 CompilationInfo* info_; | 3086 CompilationInfo* info_; |
| 2956 HGraph* const graph_; | 3087 HGraph* const graph_; |
| 2957 Status status_; | 3088 Status status_; |
| 2958 HInstruction* current_instruction_; | 3089 HInstruction* current_instruction_; |
| 2959 HBasicBlock* current_block_; | 3090 HBasicBlock* current_block_; |
| 2960 LAllocator* allocator_; | 3091 LAllocator* allocator_; |
| 2961 LInstruction* instruction_pending_deoptimization_environment_; | |
| 2962 BailoutId pending_deoptimization_ast_id_; | |
| 2963 | 3092 |
| 2964 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 3093 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2965 }; | 3094 }; |
| 2966 | 3095 |
| 2967 #undef DECLARE_HYDROGEN_ACCESSOR | 3096 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2968 #undef DECLARE_CONCRETE_INSTRUCTION | 3097 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2969 | 3098 |
| 2970 } } // namespace v8::internal | 3099 } } // namespace v8::internal |
| 2971 | 3100 |
| 2972 #endif // V8_A64_LITHIUM_A64_H_ | 3101 #endif // V8_A64_LITHIUM_A64_H_ |
| OLD | NEW |