| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 namespace v8 { | 36 namespace v8 { |
| 37 namespace internal { | 37 namespace internal { |
| 38 | 38 |
| 39 // Forward declarations. | 39 // Forward declarations. |
| 40 class LCodeGen; | 40 class LCodeGen; |
| 41 | 41 |
| 42 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ | 42 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ |
| 43 V(ControlInstruction) \ | 43 V(ControlInstruction) \ |
| 44 V(Call) \ | 44 V(Call) \ |
| 45 V(StoreKeyed) \ | |
| 46 V(StoreNamed) \ | |
| 47 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) | 45 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) |
| 48 | 46 |
| 49 | 47 |
| 50 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ | 48 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ |
| 51 V(AccessArgumentsAt) \ | 49 V(AccessArgumentsAt) \ |
| 52 V(AddI) \ | 50 V(AddI) \ |
| 53 V(ApplyArguments) \ | 51 V(ApplyArguments) \ |
| 54 V(ArgumentsElements) \ | 52 V(ArgumentsElements) \ |
| 55 V(ArgumentsLength) \ | 53 V(ArgumentsLength) \ |
| 56 V(ArithmeticD) \ | 54 V(ArithmeticD) \ |
| (...skipping 27 matching lines...) Expand all Loading... |
| 84 V(CmpT) \ | 82 V(CmpT) \ |
| 85 V(CmpTAndBranch) \ | 83 V(CmpTAndBranch) \ |
| 86 V(ConstantD) \ | 84 V(ConstantD) \ |
| 87 V(ConstantI) \ | 85 V(ConstantI) \ |
| 88 V(ConstantT) \ | 86 V(ConstantT) \ |
| 89 V(Context) \ | 87 V(Context) \ |
| 90 V(DeleteProperty) \ | 88 V(DeleteProperty) \ |
| 91 V(Deoptimize) \ | 89 V(Deoptimize) \ |
| 92 V(DivI) \ | 90 V(DivI) \ |
| 93 V(DoubleToI) \ | 91 V(DoubleToI) \ |
| 92 V(ExternalArrayLength) \ |
| 94 V(FixedArrayLength) \ | 93 V(FixedArrayLength) \ |
| 95 V(FunctionLiteral) \ | 94 V(FunctionLiteral) \ |
| 96 V(Gap) \ | 95 V(Gap) \ |
| 96 V(GetCachedArrayIndex) \ |
| 97 V(GlobalObject) \ | 97 V(GlobalObject) \ |
| 98 V(GlobalReceiver) \ | 98 V(GlobalReceiver) \ |
| 99 V(Goto) \ | 99 V(Goto) \ |
| 100 V(HasCachedArrayIndex) \ | 100 V(HasCachedArrayIndex) \ |
| 101 V(HasCachedArrayIndexAndBranch) \ | 101 V(HasCachedArrayIndexAndBranch) \ |
| 102 V(HasInstanceType) \ | 102 V(HasInstanceType) \ |
| 103 V(HasInstanceTypeAndBranch) \ | 103 V(HasInstanceTypeAndBranch) \ |
| 104 V(InstanceOf) \ | 104 V(InstanceOf) \ |
| 105 V(InstanceOfAndBranch) \ | 105 V(InstanceOfAndBranch) \ |
| 106 V(InstanceOfKnownGlobal) \ | 106 V(InstanceOfKnownGlobal) \ |
| 107 V(Integer32ToDouble) \ | 107 V(Integer32ToDouble) \ |
| 108 V(IsNull) \ | 108 V(IsNull) \ |
| 109 V(IsNullAndBranch) \ | 109 V(IsNullAndBranch) \ |
| 110 V(IsObject) \ | 110 V(IsObject) \ |
| 111 V(IsObjectAndBranch) \ | 111 V(IsObjectAndBranch) \ |
| 112 V(IsSmi) \ | 112 V(IsSmi) \ |
| 113 V(IsSmiAndBranch) \ | 113 V(IsSmiAndBranch) \ |
| 114 V(JSArrayLength) \ | 114 V(JSArrayLength) \ |
| 115 V(Label) \ | 115 V(Label) \ |
| 116 V(LazyBailout) \ | 116 V(LazyBailout) \ |
| 117 V(LoadContextSlot) \ | 117 V(LoadContextSlot) \ |
| 118 V(LoadElements) \ | 118 V(LoadElements) \ |
| 119 V(LoadExternalArrayPointer) \ |
| 119 V(LoadFunctionPrototype) \ | 120 V(LoadFunctionPrototype) \ |
| 120 V(LoadGlobal) \ | 121 V(LoadGlobal) \ |
| 121 V(LoadKeyedFastElement) \ | 122 V(LoadKeyedFastElement) \ |
| 122 V(LoadKeyedGeneric) \ | 123 V(LoadKeyedGeneric) \ |
| 123 V(LoadNamedField) \ | 124 V(LoadNamedField) \ |
| 124 V(LoadNamedGeneric) \ | 125 V(LoadNamedGeneric) \ |
| 125 V(LoadPixelArrayElement) \ | 126 V(LoadPixelArrayElement) \ |
| 126 V(LoadPixelArrayExternalPointer) \ | |
| 127 V(ModI) \ | 127 V(ModI) \ |
| 128 V(MulI) \ | 128 V(MulI) \ |
| 129 V(NumberTagD) \ | 129 V(NumberTagD) \ |
| 130 V(NumberTagI) \ | 130 V(NumberTagI) \ |
| 131 V(NumberUntagD) \ | 131 V(NumberUntagD) \ |
| 132 V(ObjectLiteral) \ | 132 V(ObjectLiteral) \ |
| 133 V(OsrEntry) \ | 133 V(OsrEntry) \ |
| 134 V(OuterContext) \ | 134 V(OuterContext) \ |
| 135 V(Parameter) \ | 135 V(Parameter) \ |
| 136 V(PixelArrayLength) \ | 136 V(Power) \ |
| 137 V(PushArgument) \ | 137 V(PushArgument) \ |
| 138 V(RegExpLiteral) \ | 138 V(RegExpLiteral) \ |
| 139 V(Return) \ | 139 V(Return) \ |
| 140 V(ShiftI) \ | 140 V(ShiftI) \ |
| 141 V(SmiTag) \ | 141 V(SmiTag) \ |
| 142 V(SmiUntag) \ | 142 V(SmiUntag) \ |
| 143 V(StackCheck) \ | 143 V(StackCheck) \ |
| 144 V(StoreContextSlot) \ | 144 V(StoreContextSlot) \ |
| 145 V(StoreGlobal) \ | 145 V(StoreGlobal) \ |
| 146 V(StoreKeyedFastElement) \ | 146 V(StoreKeyedFastElement) \ |
| 147 V(StoreKeyedGeneric) \ | 147 V(StoreKeyedGeneric) \ |
| 148 V(StoreNamedField) \ | 148 V(StoreNamedField) \ |
| 149 V(StoreNamedGeneric) \ | 149 V(StoreNamedGeneric) \ |
| 150 V(StorePixelArrayElement) \ |
| 150 V(StringCharCodeAt) \ | 151 V(StringCharCodeAt) \ |
| 152 V(StringCharFromCode) \ |
| 151 V(StringLength) \ | 153 V(StringLength) \ |
| 152 V(SubI) \ | 154 V(SubI) \ |
| 153 V(TaggedToI) \ | 155 V(TaggedToI) \ |
| 154 V(Throw) \ | 156 V(Throw) \ |
| 155 V(Typeof) \ | 157 V(Typeof) \ |
| 156 V(TypeofIs) \ | 158 V(TypeofIs) \ |
| 157 V(TypeofIsAndBranch) \ | 159 V(TypeofIsAndBranch) \ |
| 158 V(IsConstructCall) \ | 160 V(IsConstructCall) \ |
| 159 V(IsConstructCallAndBranch) \ | 161 V(IsConstructCallAndBranch) \ |
| 160 V(UnaryMathOperation) \ | 162 V(UnaryMathOperation) \ |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 } | 723 } |
| 722 | 724 |
| 723 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, | 725 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, |
| 724 "has-instance-type-and-branch") | 726 "has-instance-type-and-branch") |
| 725 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) | 727 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) |
| 726 | 728 |
| 727 virtual void PrintDataTo(StringStream* stream); | 729 virtual void PrintDataTo(StringStream* stream); |
| 728 }; | 730 }; |
| 729 | 731 |
| 730 | 732 |
| 733 class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> { |
| 734 public: |
| 735 explicit LGetCachedArrayIndex(LOperand* value) { |
| 736 inputs_[0] = value; |
| 737 } |
| 738 |
| 739 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") |
| 740 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) |
| 741 }; |
| 742 |
| 743 |
| 731 class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> { | 744 class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> { |
| 732 public: | 745 public: |
| 733 explicit LHasCachedArrayIndex(LOperand* value) { | 746 explicit LHasCachedArrayIndex(LOperand* value) { |
| 734 inputs_[0] = value; | 747 inputs_[0] = value; |
| 735 } | 748 } |
| 736 | 749 |
| 737 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index") | 750 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index") |
| 738 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex) | 751 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex) |
| 739 }; | 752 }; |
| 740 | 753 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 public: | 986 public: |
| 974 explicit LJSArrayLength(LOperand* value) { | 987 explicit LJSArrayLength(LOperand* value) { |
| 975 inputs_[0] = value; | 988 inputs_[0] = value; |
| 976 } | 989 } |
| 977 | 990 |
| 978 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length") | 991 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length") |
| 979 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength) | 992 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength) |
| 980 }; | 993 }; |
| 981 | 994 |
| 982 | 995 |
| 983 class LPixelArrayLength: public LTemplateInstruction<1, 1, 0> { | 996 class LExternalArrayLength: public LTemplateInstruction<1, 1, 0> { |
| 984 public: | 997 public: |
| 985 explicit LPixelArrayLength(LOperand* value) { | 998 explicit LExternalArrayLength(LOperand* value) { |
| 986 inputs_[0] = value; | 999 inputs_[0] = value; |
| 987 } | 1000 } |
| 988 | 1001 |
| 989 DECLARE_CONCRETE_INSTRUCTION(PixelArrayLength, "pixel-array-length") | 1002 DECLARE_CONCRETE_INSTRUCTION(ExternalArrayLength, "external-array-length") |
| 990 DECLARE_HYDROGEN_ACCESSOR(PixelArrayLength) | 1003 DECLARE_HYDROGEN_ACCESSOR(ExternalArrayLength) |
| 991 }; | 1004 }; |
| 992 | 1005 |
| 993 | 1006 |
| 994 class LFixedArrayLength: public LTemplateInstruction<1, 1, 0> { | 1007 class LFixedArrayLength: public LTemplateInstruction<1, 1, 0> { |
| 995 public: | 1008 public: |
| 996 explicit LFixedArrayLength(LOperand* value) { | 1009 explicit LFixedArrayLength(LOperand* value) { |
| 997 inputs_[0] = value; | 1010 inputs_[0] = value; |
| 998 } | 1011 } |
| 999 | 1012 |
| 1000 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length") | 1013 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length") |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 LAddI(LOperand* left, LOperand* right) { | 1052 LAddI(LOperand* left, LOperand* right) { |
| 1040 inputs_[0] = left; | 1053 inputs_[0] = left; |
| 1041 inputs_[1] = right; | 1054 inputs_[1] = right; |
| 1042 } | 1055 } |
| 1043 | 1056 |
| 1044 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i") | 1057 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i") |
| 1045 DECLARE_HYDROGEN_ACCESSOR(Add) | 1058 DECLARE_HYDROGEN_ACCESSOR(Add) |
| 1046 }; | 1059 }; |
| 1047 | 1060 |
| 1048 | 1061 |
| 1062 class LPower: public LTemplateInstruction<1, 2, 0> { |
| 1063 public: |
| 1064 LPower(LOperand* left, LOperand* right) { |
| 1065 inputs_[0] = left; |
| 1066 inputs_[1] = right; |
| 1067 } |
| 1068 |
| 1069 DECLARE_CONCRETE_INSTRUCTION(Power, "power") |
| 1070 DECLARE_HYDROGEN_ACCESSOR(Power) |
| 1071 }; |
| 1072 |
| 1073 |
| 1049 class LArithmeticD: public LTemplateInstruction<1, 2, 0> { | 1074 class LArithmeticD: public LTemplateInstruction<1, 2, 0> { |
| 1050 public: | 1075 public: |
| 1051 LArithmeticD(Token::Value op, LOperand* left, LOperand* right) | 1076 LArithmeticD(Token::Value op, LOperand* left, LOperand* right) |
| 1052 : op_(op) { | 1077 : op_(op) { |
| 1053 inputs_[0] = left; | 1078 inputs_[0] = left; |
| 1054 inputs_[1] = right; | 1079 inputs_[1] = right; |
| 1055 } | 1080 } |
| 1056 | 1081 |
| 1057 Token::Value op() const { return op_; } | 1082 Token::Value op() const { return op_; } |
| 1058 | 1083 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 class LLoadElements: public LTemplateInstruction<1, 1, 0> { | 1158 class LLoadElements: public LTemplateInstruction<1, 1, 0> { |
| 1134 public: | 1159 public: |
| 1135 explicit LLoadElements(LOperand* object) { | 1160 explicit LLoadElements(LOperand* object) { |
| 1136 inputs_[0] = object; | 1161 inputs_[0] = object; |
| 1137 } | 1162 } |
| 1138 | 1163 |
| 1139 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") | 1164 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") |
| 1140 }; | 1165 }; |
| 1141 | 1166 |
| 1142 | 1167 |
| 1143 class LLoadPixelArrayExternalPointer: public LTemplateInstruction<1, 1, 0> { | 1168 class LLoadExternalArrayPointer: public LTemplateInstruction<1, 1, 0> { |
| 1144 public: | 1169 public: |
| 1145 explicit LLoadPixelArrayExternalPointer(LOperand* object) { | 1170 explicit LLoadExternalArrayPointer(LOperand* object) { |
| 1146 inputs_[0] = object; | 1171 inputs_[0] = object; |
| 1147 } | 1172 } |
| 1148 | 1173 |
| 1149 DECLARE_CONCRETE_INSTRUCTION(LoadPixelArrayExternalPointer, | 1174 DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer, |
| 1150 "load-pixel-array-external-pointer") | 1175 "load-external-array-pointer") |
| 1151 }; | 1176 }; |
| 1152 | 1177 |
| 1153 | 1178 |
| 1154 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> { | 1179 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> { |
| 1155 public: | 1180 public: |
| 1156 LLoadKeyedFastElement(LOperand* elements, LOperand* key) { | 1181 LLoadKeyedFastElement(LOperand* elements, LOperand* key) { |
| 1157 inputs_[0] = elements; | 1182 inputs_[0] = elements; |
| 1158 inputs_[1] = key; | 1183 inputs_[1] = key; |
| 1159 } | 1184 } |
| 1160 | 1185 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1426 inputs_[0] = value; | 1451 inputs_[0] = value; |
| 1427 temps_[0] = temp1; | 1452 temps_[0] = temp1; |
| 1428 temps_[1] = temp2; | 1453 temps_[1] = temp2; |
| 1429 } | 1454 } |
| 1430 | 1455 |
| 1431 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") | 1456 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") |
| 1432 }; | 1457 }; |
| 1433 | 1458 |
| 1434 | 1459 |
| 1435 // Sometimes truncating conversion from a tagged value to an int32. | 1460 // Sometimes truncating conversion from a tagged value to an int32. |
| 1436 class LDoubleToI: public LTemplateInstruction<1, 1, 1> { | 1461 class LDoubleToI: public LTemplateInstruction<1, 1, 2> { |
| 1437 public: | 1462 public: |
| 1438 explicit LDoubleToI(LOperand* value, LOperand* temp1) { | 1463 LDoubleToI(LOperand* value, LOperand* temp1, LOperand* temp2) { |
| 1439 inputs_[0] = value; | 1464 inputs_[0] = value; |
| 1440 temps_[0] = temp1; | 1465 temps_[0] = temp1; |
| 1466 temps_[1] = temp2; |
| 1441 } | 1467 } |
| 1442 | 1468 |
| 1443 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") | 1469 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") |
| 1444 DECLARE_HYDROGEN_ACCESSOR(Change) | 1470 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 1445 | 1471 |
| 1446 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 1472 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
| 1447 }; | 1473 }; |
| 1448 | 1474 |
| 1449 | 1475 |
| 1450 // Truncating conversion from a tagged value to an int32. | 1476 // Truncating conversion from a tagged value to an int32. |
| 1451 class LTaggedToI: public LTemplateInstruction<1, 1, 1> { | 1477 class LTaggedToI: public LTemplateInstruction<1, 1, 3> { |
| 1452 public: | 1478 public: |
| 1453 LTaggedToI(LOperand* value, LOperand* temp) { | 1479 LTaggedToI(LOperand* value, |
| 1480 LOperand* temp1, |
| 1481 LOperand* temp2, |
| 1482 LOperand* temp3) { |
| 1454 inputs_[0] = value; | 1483 inputs_[0] = value; |
| 1455 temps_[0] = temp; | 1484 temps_[0] = temp1; |
| 1485 temps_[1] = temp2; |
| 1486 temps_[2] = temp3; |
| 1456 } | 1487 } |
| 1457 | 1488 |
| 1458 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") | 1489 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") |
| 1459 DECLARE_HYDROGEN_ACCESSOR(Change) | 1490 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 1460 | 1491 |
| 1461 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 1492 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
| 1462 }; | 1493 }; |
| 1463 | 1494 |
| 1464 | 1495 |
| 1465 class LSmiTag: public LTemplateInstruction<1, 1, 0> { | 1496 class LSmiTag: public LTemplateInstruction<1, 1, 0> { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1491 | 1522 |
| 1492 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") | 1523 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") |
| 1493 | 1524 |
| 1494 bool needs_check() const { return needs_check_; } | 1525 bool needs_check() const { return needs_check_; } |
| 1495 | 1526 |
| 1496 private: | 1527 private: |
| 1497 bool needs_check_; | 1528 bool needs_check_; |
| 1498 }; | 1529 }; |
| 1499 | 1530 |
| 1500 | 1531 |
| 1501 class LStoreNamed: public LTemplateInstruction<0, 2, 0> { | 1532 class LStoreNamedField: public LTemplateInstruction<0, 2, 0> { |
| 1502 public: | 1533 public: |
| 1503 LStoreNamed(LOperand* obj, LOperand* val) { | 1534 LStoreNamedField(LOperand* obj, LOperand* val) { |
| 1504 inputs_[0] = obj; | 1535 inputs_[0] = obj; |
| 1505 inputs_[1] = val; | 1536 inputs_[1] = val; |
| 1506 } | 1537 } |
| 1507 | 1538 |
| 1508 DECLARE_INSTRUCTION(StoreNamed) | 1539 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") |
| 1509 DECLARE_HYDROGEN_ACCESSOR(StoreNamed) | 1540 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField) |
| 1510 | 1541 |
| 1511 virtual void PrintDataTo(StringStream* stream); | 1542 virtual void PrintDataTo(StringStream* stream); |
| 1512 | 1543 |
| 1513 LOperand* object() { return inputs_[0]; } | 1544 LOperand* object() { return inputs_[0]; } |
| 1514 LOperand* value() { return inputs_[1]; } | 1545 LOperand* value() { return inputs_[1]; } |
| 1546 |
| 1515 Handle<Object> name() const { return hydrogen()->name(); } | 1547 Handle<Object> name() const { return hydrogen()->name(); } |
| 1516 }; | |
| 1517 | |
| 1518 | |
| 1519 class LStoreNamedField: public LStoreNamed { | |
| 1520 public: | |
| 1521 LStoreNamedField(LOperand* obj, LOperand* val) | |
| 1522 : LStoreNamed(obj, val) { } | |
| 1523 | |
| 1524 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") | |
| 1525 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField) | |
| 1526 | |
| 1527 bool is_in_object() { return hydrogen()->is_in_object(); } | 1548 bool is_in_object() { return hydrogen()->is_in_object(); } |
| 1528 int offset() { return hydrogen()->offset(); } | 1549 int offset() { return hydrogen()->offset(); } |
| 1529 bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); } | 1550 bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); } |
| 1530 Handle<Map> transition() const { return hydrogen()->transition(); } | 1551 Handle<Map> transition() const { return hydrogen()->transition(); } |
| 1531 }; | 1552 }; |
| 1532 | 1553 |
| 1533 | 1554 |
| 1534 class LStoreNamedGeneric: public LStoreNamed { | 1555 class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> { |
| 1535 public: | 1556 public: |
| 1536 LStoreNamedGeneric(LOperand* obj, LOperand* val) | 1557 LStoreNamedGeneric(LOperand* obj, LOperand* val) { |
| 1537 : LStoreNamed(obj, val) { } | 1558 inputs_[0] = obj; |
| 1559 inputs_[1] = val; |
| 1560 } |
| 1538 | 1561 |
| 1539 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") | 1562 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") |
| 1540 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) | 1563 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) |
| 1564 |
| 1565 virtual void PrintDataTo(StringStream* stream); |
| 1566 |
| 1567 LOperand* object() { return inputs_[0]; } |
| 1568 LOperand* value() { return inputs_[1]; } |
| 1569 Handle<Object> name() const { return hydrogen()->name(); } |
| 1541 }; | 1570 }; |
| 1542 | 1571 |
| 1543 | 1572 |
| 1544 class LStoreKeyed: public LTemplateInstruction<0, 3, 0> { | 1573 class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> { |
| 1545 public: | 1574 public: |
| 1546 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) { | 1575 LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) { |
| 1547 inputs_[0] = obj; | 1576 inputs_[0] = obj; |
| 1548 inputs_[1] = key; | 1577 inputs_[1] = key; |
| 1549 inputs_[2] = val; | 1578 inputs_[2] = val; |
| 1550 } | 1579 } |
| 1551 | 1580 |
| 1552 DECLARE_INSTRUCTION(StoreKeyed) | 1581 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement, |
| 1582 "store-keyed-fast-element") |
| 1583 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement) |
| 1553 | 1584 |
| 1554 virtual void PrintDataTo(StringStream* stream); | 1585 virtual void PrintDataTo(StringStream* stream); |
| 1555 | 1586 |
| 1556 LOperand* object() { return inputs_[0]; } | 1587 LOperand* object() { return inputs_[0]; } |
| 1557 LOperand* key() { return inputs_[1]; } | 1588 LOperand* key() { return inputs_[1]; } |
| 1558 LOperand* value() { return inputs_[2]; } | 1589 LOperand* value() { return inputs_[2]; } |
| 1559 }; | 1590 }; |
| 1560 | 1591 |
| 1561 | 1592 |
| 1562 class LStoreKeyedFastElement: public LStoreKeyed { | 1593 class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> { |
| 1563 public: | 1594 public: |
| 1564 LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) | 1595 LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* val) { |
| 1565 : LStoreKeyed(obj, key, val) {} | 1596 inputs_[0] = obj; |
| 1597 inputs_[1] = key; |
| 1598 inputs_[2] = val; |
| 1599 } |
| 1566 | 1600 |
| 1567 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement, | 1601 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") |
| 1568 "store-keyed-fast-element") | 1602 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) |
| 1569 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement) | 1603 |
| 1604 virtual void PrintDataTo(StringStream* stream); |
| 1605 |
| 1606 LOperand* object() { return inputs_[0]; } |
| 1607 LOperand* key() { return inputs_[1]; } |
| 1608 LOperand* value() { return inputs_[2]; } |
| 1570 }; | 1609 }; |
| 1571 | 1610 |
| 1611 class LStorePixelArrayElement: public LTemplateInstruction<0, 3, 0> { |
| 1612 public: |
| 1613 LStorePixelArrayElement(LOperand* external_pointer, |
| 1614 LOperand* key, |
| 1615 LOperand* val) { |
| 1616 inputs_[0] = external_pointer; |
| 1617 inputs_[1] = key; |
| 1618 inputs_[2] = val; |
| 1619 } |
| 1572 | 1620 |
| 1573 class LStoreKeyedGeneric: public LStoreKeyed { | 1621 DECLARE_CONCRETE_INSTRUCTION(StorePixelArrayElement, |
| 1574 public: | 1622 "store-pixel-array-element") |
| 1575 LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* val) | 1623 DECLARE_HYDROGEN_ACCESSOR(StorePixelArrayElement) |
| 1576 : LStoreKeyed(obj, key, val) { } | |
| 1577 | 1624 |
| 1578 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") | 1625 LOperand* external_pointer() { return inputs_[0]; } |
| 1626 LOperand* key() { return inputs_[1]; } |
| 1627 LOperand* value() { return inputs_[2]; } |
| 1579 }; | 1628 }; |
| 1580 | 1629 |
| 1581 | |
| 1582 class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> { | 1630 class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> { |
| 1583 public: | 1631 public: |
| 1584 LStringCharCodeAt(LOperand* string, LOperand* index) { | 1632 LStringCharCodeAt(LOperand* string, LOperand* index) { |
| 1585 inputs_[0] = string; | 1633 inputs_[0] = string; |
| 1586 inputs_[1] = index; | 1634 inputs_[1] = index; |
| 1587 } | 1635 } |
| 1588 | 1636 |
| 1589 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at") | 1637 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at") |
| 1590 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt) | 1638 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt) |
| 1591 | 1639 |
| 1592 LOperand* string() { return inputs_[0]; } | 1640 LOperand* string() { return inputs_[0]; } |
| 1593 LOperand* index() { return inputs_[1]; } | 1641 LOperand* index() { return inputs_[1]; } |
| 1594 }; | 1642 }; |
| 1595 | 1643 |
| 1596 | 1644 |
| 1645 class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> { |
| 1646 public: |
| 1647 explicit LStringCharFromCode(LOperand* char_code) { |
| 1648 inputs_[0] = char_code; |
| 1649 } |
| 1650 |
| 1651 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") |
| 1652 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) |
| 1653 |
| 1654 LOperand* char_code() { return inputs_[0]; } |
| 1655 }; |
| 1656 |
| 1657 |
| 1597 class LStringLength: public LTemplateInstruction<1, 1, 0> { | 1658 class LStringLength: public LTemplateInstruction<1, 1, 0> { |
| 1598 public: | 1659 public: |
| 1599 explicit LStringLength(LOperand* string) { | 1660 explicit LStringLength(LOperand* string) { |
| 1600 inputs_[0] = string; | 1661 inputs_[0] = string; |
| 1601 } | 1662 } |
| 1602 | 1663 |
| 1603 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length") | 1664 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length") |
| 1604 DECLARE_HYDROGEN_ACCESSOR(StringLength) | 1665 DECLARE_HYDROGEN_ACCESSOR(StringLength) |
| 1605 | 1666 |
| 1606 LOperand* string() { return inputs_[0]; } | 1667 LOperand* string() { return inputs_[0]; } |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1801 | 1862 |
| 1802 class LStackCheck: public LTemplateInstruction<0, 0, 0> { | 1863 class LStackCheck: public LTemplateInstruction<0, 0, 0> { |
| 1803 public: | 1864 public: |
| 1804 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") | 1865 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") |
| 1805 }; | 1866 }; |
| 1806 | 1867 |
| 1807 | 1868 |
| 1808 class LChunkBuilder; | 1869 class LChunkBuilder; |
| 1809 class LChunk: public ZoneObject { | 1870 class LChunk: public ZoneObject { |
| 1810 public: | 1871 public: |
| 1811 explicit LChunk(HGraph* graph); | 1872 explicit LChunk(CompilationInfo* info, HGraph* graph); |
| 1812 | 1873 |
| 1813 void AddInstruction(LInstruction* instruction, HBasicBlock* block); | 1874 void AddInstruction(LInstruction* instruction, HBasicBlock* block); |
| 1814 LConstantOperand* DefineConstantOperand(HConstant* constant); | 1875 LConstantOperand* DefineConstantOperand(HConstant* constant); |
| 1815 Handle<Object> LookupLiteral(LConstantOperand* operand) const; | 1876 Handle<Object> LookupLiteral(LConstantOperand* operand) const; |
| 1816 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; | 1877 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; |
| 1817 | 1878 |
| 1818 int GetNextSpillIndex(bool is_double); | 1879 int GetNextSpillIndex(bool is_double); |
| 1819 LOperand* GetNextSpillSlot(bool is_double); | 1880 LOperand* GetNextSpillSlot(bool is_double); |
| 1820 | 1881 |
| 1821 int ParameterAt(int index); | 1882 int ParameterAt(int index); |
| 1822 int GetParameterStackSlot(int index) const; | 1883 int GetParameterStackSlot(int index) const; |
| 1823 int spill_slot_count() const { return spill_slot_count_; } | 1884 int spill_slot_count() const { return spill_slot_count_; } |
| 1885 CompilationInfo* info() const { return info_; } |
| 1824 HGraph* graph() const { return graph_; } | 1886 HGraph* graph() const { return graph_; } |
| 1825 const ZoneList<LInstruction*>* instructions() const { return &instructions_; } | 1887 const ZoneList<LInstruction*>* instructions() const { return &instructions_; } |
| 1826 void AddGapMove(int index, LOperand* from, LOperand* to); | 1888 void AddGapMove(int index, LOperand* from, LOperand* to); |
| 1827 LGap* GetGapAt(int index) const; | 1889 LGap* GetGapAt(int index) const; |
| 1828 bool IsGapAt(int index) const; | 1890 bool IsGapAt(int index) const; |
| 1829 int NearestGapPos(int index) const; | 1891 int NearestGapPos(int index) const; |
| 1830 void MarkEmptyBlocks(); | 1892 void MarkEmptyBlocks(); |
| 1831 const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; } | 1893 const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; } |
| 1832 LLabel* GetLabel(int block_id) const { | 1894 LLabel* GetLabel(int block_id) const { |
| 1833 HBasicBlock* block = graph_->blocks()->at(block_id); | 1895 HBasicBlock* block = graph_->blocks()->at(block_id); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1850 const ZoneList<Handle<JSFunction> >* inlined_closures() const { | 1912 const ZoneList<Handle<JSFunction> >* inlined_closures() const { |
| 1851 return &inlined_closures_; | 1913 return &inlined_closures_; |
| 1852 } | 1914 } |
| 1853 | 1915 |
| 1854 void AddInlinedClosure(Handle<JSFunction> closure) { | 1916 void AddInlinedClosure(Handle<JSFunction> closure) { |
| 1855 inlined_closures_.Add(closure); | 1917 inlined_closures_.Add(closure); |
| 1856 } | 1918 } |
| 1857 | 1919 |
| 1858 private: | 1920 private: |
| 1859 int spill_slot_count_; | 1921 int spill_slot_count_; |
| 1922 CompilationInfo* info_; |
| 1860 HGraph* const graph_; | 1923 HGraph* const graph_; |
| 1861 ZoneList<LInstruction*> instructions_; | 1924 ZoneList<LInstruction*> instructions_; |
| 1862 ZoneList<LPointerMap*> pointer_maps_; | 1925 ZoneList<LPointerMap*> pointer_maps_; |
| 1863 ZoneList<Handle<JSFunction> > inlined_closures_; | 1926 ZoneList<Handle<JSFunction> > inlined_closures_; |
| 1864 }; | 1927 }; |
| 1865 | 1928 |
| 1866 | 1929 |
| 1867 class LChunkBuilder BASE_EMBEDDED { | 1930 class LChunkBuilder BASE_EMBEDDED { |
| 1868 public: | 1931 public: |
| 1869 LChunkBuilder(HGraph* graph, LAllocator* allocator) | 1932 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
| 1870 : chunk_(NULL), | 1933 : chunk_(NULL), |
| 1934 info_(info), |
| 1871 graph_(graph), | 1935 graph_(graph), |
| 1872 status_(UNUSED), | 1936 status_(UNUSED), |
| 1873 current_instruction_(NULL), | 1937 current_instruction_(NULL), |
| 1874 current_block_(NULL), | 1938 current_block_(NULL), |
| 1875 next_block_(NULL), | 1939 next_block_(NULL), |
| 1876 argument_count_(0), | 1940 argument_count_(0), |
| 1877 allocator_(allocator), | 1941 allocator_(allocator), |
| 1878 position_(RelocInfo::kNoPosition), | 1942 position_(RelocInfo::kNoPosition), |
| 1879 instruction_pending_deoptimization_environment_(NULL), | 1943 instruction_pending_deoptimization_environment_(NULL), |
| 1880 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } | 1944 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } |
| 1881 | 1945 |
| 1882 // Build the sequence for the graph. | 1946 // Build the sequence for the graph. |
| 1883 LChunk* Build(); | 1947 LChunk* Build(); |
| 1884 | 1948 |
| 1885 // Declare methods that deal with the individual node types. | 1949 // Declare methods that deal with the individual node types. |
| 1886 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 1950 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
| 1887 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 1951 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
| 1888 #undef DECLARE_DO | 1952 #undef DECLARE_DO |
| 1889 | 1953 |
| 1890 private: | 1954 private: |
| 1891 enum Status { | 1955 enum Status { |
| 1892 UNUSED, | 1956 UNUSED, |
| 1893 BUILDING, | 1957 BUILDING, |
| 1894 DONE, | 1958 DONE, |
| 1895 ABORTED | 1959 ABORTED |
| 1896 }; | 1960 }; |
| 1897 | 1961 |
| 1898 LChunk* chunk() const { return chunk_; } | 1962 LChunk* chunk() const { return chunk_; } |
| 1963 CompilationInfo* info() const { return info_; } |
| 1899 HGraph* graph() const { return graph_; } | 1964 HGraph* graph() const { return graph_; } |
| 1900 | 1965 |
| 1901 bool is_unused() const { return status_ == UNUSED; } | 1966 bool is_unused() const { return status_ == UNUSED; } |
| 1902 bool is_building() const { return status_ == BUILDING; } | 1967 bool is_building() const { return status_ == BUILDING; } |
| 1903 bool is_done() const { return status_ == DONE; } | 1968 bool is_done() const { return status_ == DONE; } |
| 1904 bool is_aborted() const { return status_ == ABORTED; } | 1969 bool is_aborted() const { return status_ == ABORTED; } |
| 1905 | 1970 |
| 1906 void Abort(const char* format, ...); | 1971 void Abort(const char* format, ...); |
| 1907 | 1972 |
| 1908 // Methods for getting operands for Use / Define / Temp. | 1973 // Methods for getting operands for Use / Define / Temp. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1995 | 2060 |
| 1996 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 2061 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
| 1997 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); | 2062 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); |
| 1998 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 2063 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
| 1999 LInstruction* DoArithmeticD(Token::Value op, | 2064 LInstruction* DoArithmeticD(Token::Value op, |
| 2000 HArithmeticBinaryOperation* instr); | 2065 HArithmeticBinaryOperation* instr); |
| 2001 LInstruction* DoArithmeticT(Token::Value op, | 2066 LInstruction* DoArithmeticT(Token::Value op, |
| 2002 HArithmeticBinaryOperation* instr); | 2067 HArithmeticBinaryOperation* instr); |
| 2003 | 2068 |
| 2004 LChunk* chunk_; | 2069 LChunk* chunk_; |
| 2070 CompilationInfo* info_; |
| 2005 HGraph* const graph_; | 2071 HGraph* const graph_; |
| 2006 Status status_; | 2072 Status status_; |
| 2007 HInstruction* current_instruction_; | 2073 HInstruction* current_instruction_; |
| 2008 HBasicBlock* current_block_; | 2074 HBasicBlock* current_block_; |
| 2009 HBasicBlock* next_block_; | 2075 HBasicBlock* next_block_; |
| 2010 int argument_count_; | 2076 int argument_count_; |
| 2011 LAllocator* allocator_; | 2077 LAllocator* allocator_; |
| 2012 int position_; | 2078 int position_; |
| 2013 LInstruction* instruction_pending_deoptimization_environment_; | 2079 LInstruction* instruction_pending_deoptimization_environment_; |
| 2014 int pending_deoptimization_ast_id_; | 2080 int pending_deoptimization_ast_id_; |
| 2015 | 2081 |
| 2016 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2082 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2017 }; | 2083 }; |
| 2018 | 2084 |
| 2019 #undef DECLARE_HYDROGEN_ACCESSOR | 2085 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2020 #undef DECLARE_INSTRUCTION | 2086 #undef DECLARE_INSTRUCTION |
| 2021 #undef DECLARE_CONCRETE_INSTRUCTION | 2087 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2022 | 2088 |
| 2023 } } // namespace v8::internal | 2089 } } // namespace v8::internal |
| 2024 | 2090 |
| 2025 #endif // V8_ARM_LITHIUM_ARM_H_ | 2091 #endif // V8_ARM_LITHIUM_ARM_H_ |
| OLD | NEW |