| 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 21 matching lines...) Expand all Loading... |
| 32 #include "lithium-allocator.h" | 32 #include "lithium-allocator.h" |
| 33 #include "lithium.h" | 33 #include "lithium.h" |
| 34 #include "safepoint-table.h" | 34 #include "safepoint-table.h" |
| 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 | |
| 43 // Type hierarchy: | |
| 44 // | |
| 45 // LInstruction | |
| 46 // LTemplateInstruction | |
| 47 // LControlInstruction | |
| 48 // LBranch | |
| 49 // LClassOfTestAndBranch | |
| 50 // LCmpJSObjectEqAndBranch | |
| 51 // LCmpIDAndBranch | |
| 52 // LHasCachedArrayIndexAndBranch | |
| 53 // LHasInstanceTypeAndBranch | |
| 54 // LInstanceOfAndBranch | |
| 55 // LIsNullAndBranch | |
| 56 // LIsObjectAndBranch | |
| 57 // LIsSmiAndBranch | |
| 58 // LTypeofIsAndBranch | |
| 59 // LAccessArgumentsAt | |
| 60 // LArgumentsElements | |
| 61 // LArgumentsLength | |
| 62 // LAddI | |
| 63 // LApplyArguments | |
| 64 // LArithmeticD | |
| 65 // LArithmeticT | |
| 66 // LBitI | |
| 67 // LBoundsCheck | |
| 68 // LCmpID | |
| 69 // LCmpJSObjectEq | |
| 70 // LCmpT | |
| 71 // LDivI | |
| 72 // LInstanceOf | |
| 73 // LInstanceOfKnownGlobal | |
| 74 // LLoadKeyedFastElement | |
| 75 // LLoadKeyedGeneric | |
| 76 // LModI | |
| 77 // LMulI | |
| 78 // LPower | |
| 79 // LShiftI | |
| 80 // LSubI | |
| 81 // LCallConstantFunction | |
| 82 // LCallFunction | |
| 83 // LCallGlobal | |
| 84 // LCallKeyed | |
| 85 // LCallKnownGlobal | |
| 86 // LCallNamed | |
| 87 // LCallRuntime | |
| 88 // LCallStub | |
| 89 // LConstant | |
| 90 // LConstantD | |
| 91 // LConstantI | |
| 92 // LConstantT | |
| 93 // LDeoptimize | |
| 94 // LFunctionLiteral | |
| 95 // LGap | |
| 96 // LLabel | |
| 97 // LGlobalObject | |
| 98 // LGlobalReceiver | |
| 99 // LGoto | |
| 100 // LLazyBailout | |
| 101 // LLoadGlobal | |
| 102 // LCheckPrototypeMaps | |
| 103 // LLoadContextSlot | |
| 104 // LArrayLiteral | |
| 105 // LObjectLiteral | |
| 106 // LRegExpLiteral | |
| 107 // LOsrEntry | |
| 108 // LParameter | |
| 109 // LRegExpConstructResult | |
| 110 // LStackCheck | |
| 111 // LStoreKeyed | |
| 112 // LStoreKeyedFastElement | |
| 113 // LStoreKeyedGeneric | |
| 114 // LStoreNamed | |
| 115 // LStoreNamedField | |
| 116 // LStoreNamedGeneric | |
| 117 // LStringCharCodeAt | |
| 118 // LBitNotI | |
| 119 // LCallNew | |
| 120 // LCheckFunction | |
| 121 // LCheckPrototypeMaps | |
| 122 // LCheckInstanceType | |
| 123 // LCheckMap | |
| 124 // LCheckSmi | |
| 125 // LClassOfTest | |
| 126 // LDeleteProperty | |
| 127 // LDoubleToI | |
| 128 // LFixedArrayLength | |
| 129 // LHasCachedArrayIndex | |
| 130 // LHasInstanceType | |
| 131 // LInteger32ToDouble | |
| 132 // LIsNull | |
| 133 // LIsObject | |
| 134 // LIsSmi | |
| 135 // LJSArrayLength | |
| 136 // LLoadNamedField | |
| 137 // LLoadNamedGeneric | |
| 138 // LLoadFunctionPrototype | |
| 139 // LNumberTagD | |
| 140 // LNumberTagI | |
| 141 // LPushArgument | |
| 142 // LReturn | |
| 143 // LSmiTag | |
| 144 // LStoreGlobal | |
| 145 // LStringLength | |
| 146 // LTaggedToI | |
| 147 // LThrow | |
| 148 // LTypeof | |
| 149 // LTypeofIs | |
| 150 // LUnaryMathOperation | |
| 151 // LValueOf | |
| 152 // LUnknownOSRValue | |
| 153 | |
| 154 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ | 42 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ |
| 155 V(ControlInstruction) \ | 43 V(ControlInstruction) \ |
| 156 V(Constant) \ | 44 V(Constant) \ |
| 157 V(Call) \ | 45 V(Call) \ |
| 158 V(StoreKeyed) \ | 46 V(StoreKeyed) \ |
| 159 V(StoreNamed) \ | 47 V(StoreNamed) \ |
| 160 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) | 48 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) |
| 161 | 49 |
| 162 | 50 |
| 163 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ | 51 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ |
| (...skipping 16 matching lines...) Expand all Loading... |
| 180 V(CallKnownGlobal) \ | 68 V(CallKnownGlobal) \ |
| 181 V(CallNamed) \ | 69 V(CallNamed) \ |
| 182 V(CallNew) \ | 70 V(CallNew) \ |
| 183 V(CallRuntime) \ | 71 V(CallRuntime) \ |
| 184 V(CallStub) \ | 72 V(CallStub) \ |
| 185 V(CheckFunction) \ | 73 V(CheckFunction) \ |
| 186 V(CheckInstanceType) \ | 74 V(CheckInstanceType) \ |
| 187 V(CheckMap) \ | 75 V(CheckMap) \ |
| 188 V(CheckPrototypeMaps) \ | 76 V(CheckPrototypeMaps) \ |
| 189 V(CheckSmi) \ | 77 V(CheckSmi) \ |
| 78 V(ClassOfTest) \ |
| 79 V(ClassOfTestAndBranch) \ |
| 190 V(CmpID) \ | 80 V(CmpID) \ |
| 191 V(CmpIDAndBranch) \ | 81 V(CmpIDAndBranch) \ |
| 192 V(CmpJSObjectEq) \ | 82 V(CmpJSObjectEq) \ |
| 193 V(CmpJSObjectEqAndBranch) \ | 83 V(CmpJSObjectEqAndBranch) \ |
| 194 V(CmpMapAndBranch) \ | 84 V(CmpMapAndBranch) \ |
| 195 V(CmpT) \ | 85 V(CmpT) \ |
| 196 V(CmpTAndBranch) \ | 86 V(CmpTAndBranch) \ |
| 197 V(ConstantD) \ | 87 V(ConstantD) \ |
| 198 V(ConstantI) \ | 88 V(ConstantI) \ |
| 199 V(ConstantT) \ | 89 V(ConstantT) \ |
| 90 V(Context) \ |
| 200 V(DeleteProperty) \ | 91 V(DeleteProperty) \ |
| 201 V(Deoptimize) \ | 92 V(Deoptimize) \ |
| 202 V(DivI) \ | 93 V(DivI) \ |
| 203 V(DoubleToI) \ | 94 V(DoubleToI) \ |
| 204 V(FixedArrayLength) \ | 95 V(FixedArrayLength) \ |
| 205 V(FunctionLiteral) \ | 96 V(FunctionLiteral) \ |
| 206 V(Gap) \ | 97 V(Gap) \ |
| 207 V(GlobalObject) \ | 98 V(GlobalObject) \ |
| 208 V(GlobalReceiver) \ | 99 V(GlobalReceiver) \ |
| 209 V(Goto) \ | 100 V(Goto) \ |
| 101 V(HasCachedArrayIndex) \ |
| 102 V(HasCachedArrayIndexAndBranch) \ |
| 103 V(HasInstanceType) \ |
| 104 V(HasInstanceTypeAndBranch) \ |
| 210 V(InstanceOf) \ | 105 V(InstanceOf) \ |
| 211 V(InstanceOfAndBranch) \ | 106 V(InstanceOfAndBranch) \ |
| 212 V(InstanceOfKnownGlobal) \ | 107 V(InstanceOfKnownGlobal) \ |
| 213 V(Integer32ToDouble) \ | 108 V(Integer32ToDouble) \ |
| 214 V(IsNull) \ | 109 V(IsNull) \ |
| 215 V(IsNullAndBranch) \ | 110 V(IsNullAndBranch) \ |
| 216 V(IsObject) \ | 111 V(IsObject) \ |
| 217 V(IsObjectAndBranch) \ | 112 V(IsObjectAndBranch) \ |
| 218 V(IsSmi) \ | 113 V(IsSmi) \ |
| 219 V(IsSmiAndBranch) \ | 114 V(IsSmiAndBranch) \ |
| 220 V(JSArrayLength) \ | 115 V(JSArrayLength) \ |
| 221 V(HasInstanceType) \ | |
| 222 V(HasInstanceTypeAndBranch) \ | |
| 223 V(HasCachedArrayIndex) \ | |
| 224 V(HasCachedArrayIndexAndBranch) \ | |
| 225 V(ClassOfTest) \ | |
| 226 V(ClassOfTestAndBranch) \ | |
| 227 V(Label) \ | 116 V(Label) \ |
| 228 V(LazyBailout) \ | 117 V(LazyBailout) \ |
| 229 V(LoadContextSlot) \ | 118 V(LoadContextSlot) \ |
| 230 V(LoadElements) \ | 119 V(LoadElements) \ |
| 120 V(LoadFunctionPrototype) \ |
| 231 V(LoadGlobal) \ | 121 V(LoadGlobal) \ |
| 232 V(LoadKeyedFastElement) \ | 122 V(LoadKeyedFastElement) \ |
| 233 V(LoadKeyedGeneric) \ | 123 V(LoadKeyedGeneric) \ |
| 234 V(LoadNamedField) \ | 124 V(LoadNamedField) \ |
| 235 V(LoadNamedGeneric) \ | 125 V(LoadNamedGeneric) \ |
| 236 V(LoadFunctionPrototype) \ | |
| 237 V(ModI) \ | 126 V(ModI) \ |
| 238 V(MulI) \ | 127 V(MulI) \ |
| 239 V(NumberTagD) \ | 128 V(NumberTagD) \ |
| 240 V(NumberTagI) \ | 129 V(NumberTagI) \ |
| 241 V(NumberUntagD) \ | 130 V(NumberUntagD) \ |
| 242 V(ObjectLiteral) \ | 131 V(ObjectLiteral) \ |
| 243 V(OsrEntry) \ | 132 V(OsrEntry) \ |
| 133 V(OuterContext) \ |
| 244 V(Parameter) \ | 134 V(Parameter) \ |
| 245 V(PushArgument) \ | 135 V(PushArgument) \ |
| 246 V(RegExpLiteral) \ | 136 V(RegExpLiteral) \ |
| 247 V(Return) \ | 137 V(Return) \ |
| 248 V(ShiftI) \ | 138 V(ShiftI) \ |
| 249 V(SmiTag) \ | 139 V(SmiTag) \ |
| 250 V(SmiUntag) \ | 140 V(SmiUntag) \ |
| 251 V(StackCheck) \ | 141 V(StackCheck) \ |
| 142 V(StoreContextSlot) \ |
| 252 V(StoreGlobal) \ | 143 V(StoreGlobal) \ |
| 253 V(StoreKeyedFastElement) \ | 144 V(StoreKeyedFastElement) \ |
| 254 V(StoreKeyedGeneric) \ | 145 V(StoreKeyedGeneric) \ |
| 255 V(StoreNamedField) \ | 146 V(StoreNamedField) \ |
| 256 V(StoreNamedGeneric) \ | 147 V(StoreNamedGeneric) \ |
| 257 V(SubI) \ | |
| 258 V(StringCharCodeAt) \ | 148 V(StringCharCodeAt) \ |
| 259 V(StringLength) \ | 149 V(StringLength) \ |
| 150 V(SubI) \ |
| 260 V(TaggedToI) \ | 151 V(TaggedToI) \ |
| 261 V(Throw) \ | 152 V(Throw) \ |
| 262 V(Typeof) \ | 153 V(Typeof) \ |
| 263 V(TypeofIs) \ | 154 V(TypeofIs) \ |
| 264 V(TypeofIsAndBranch) \ | 155 V(TypeofIsAndBranch) \ |
| 265 V(UnaryMathOperation) \ | 156 V(UnaryMathOperation) \ |
| 266 V(UnknownOSRValue) \ | 157 V(UnknownOSRValue) \ |
| 267 V(ValueOf) | 158 V(ValueOf) |
| 268 | 159 |
| 269 | 160 |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1259 LStoreGlobal(LOperand* value, LOperand* temp) { | 1150 LStoreGlobal(LOperand* value, LOperand* temp) { |
| 1260 inputs_[0] = value; | 1151 inputs_[0] = value; |
| 1261 temps_[0] = temp; | 1152 temps_[0] = temp; |
| 1262 } | 1153 } |
| 1263 | 1154 |
| 1264 DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global") | 1155 DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global") |
| 1265 DECLARE_HYDROGEN_ACCESSOR(StoreGlobal) | 1156 DECLARE_HYDROGEN_ACCESSOR(StoreGlobal) |
| 1266 }; | 1157 }; |
| 1267 | 1158 |
| 1268 | 1159 |
| 1269 class LLoadContextSlot: public LTemplateInstruction<1, 0, 0> { | 1160 class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> { |
| 1270 public: | 1161 public: |
| 1162 explicit LLoadContextSlot(LOperand* context) { |
| 1163 inputs_[0] = context; |
| 1164 } |
| 1165 |
| 1271 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") | 1166 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") |
| 1272 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) | 1167 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) |
| 1273 | 1168 |
| 1274 int context_chain_length() { return hydrogen()->context_chain_length(); } | 1169 LOperand* context() { return InputAt(0); } |
| 1275 int slot_index() { return hydrogen()->slot_index(); } | 1170 int slot_index() { return hydrogen()->slot_index(); } |
| 1276 | 1171 |
| 1277 virtual void PrintDataTo(StringStream* stream); | 1172 virtual void PrintDataTo(StringStream* stream); |
| 1278 }; | 1173 }; |
| 1174 |
| 1175 |
| 1176 class LStoreContextSlot: public LTemplateInstruction<0, 2, 0> { |
| 1177 public: |
| 1178 LStoreContextSlot(LOperand* context, LOperand* value) { |
| 1179 inputs_[0] = context; |
| 1180 inputs_[1] = value; |
| 1181 } |
| 1182 |
| 1183 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot") |
| 1184 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot) |
| 1185 |
| 1186 LOperand* context() { return InputAt(0); } |
| 1187 LOperand* value() { return InputAt(1); } |
| 1188 int slot_index() { return hydrogen()->slot_index(); } |
| 1189 int needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); } |
| 1190 |
| 1191 virtual void PrintDataTo(StringStream* stream); |
| 1192 }; |
| 1279 | 1193 |
| 1280 | 1194 |
| 1281 class LPushArgument: public LTemplateInstruction<0, 1, 0> { | 1195 class LPushArgument: public LTemplateInstruction<0, 1, 0> { |
| 1282 public: | 1196 public: |
| 1283 explicit LPushArgument(LOperand* value) { | 1197 explicit LPushArgument(LOperand* value) { |
| 1284 inputs_[0] = value; | 1198 inputs_[0] = value; |
| 1285 } | 1199 } |
| 1286 | 1200 |
| 1287 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") | 1201 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") |
| 1288 }; | 1202 }; |
| 1289 | 1203 |
| 1290 | 1204 |
| 1291 class LGlobalObject: public LTemplateInstruction<1, 0, 0> { | 1205 class LContext: public LTemplateInstruction<1, 0, 0> { |
| 1292 public: | 1206 public: |
| 1293 DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object") | 1207 DECLARE_CONCRETE_INSTRUCTION(Context, "context") |
| 1294 }; | 1208 }; |
| 1295 | 1209 |
| 1296 | 1210 |
| 1297 class LGlobalReceiver: public LTemplateInstruction<1, 0, 0> { | 1211 class LOuterContext: public LTemplateInstruction<1, 1, 0> { |
| 1298 public: | 1212 public: |
| 1299 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver") | 1213 explicit LOuterContext(LOperand* context) { |
| 1214 inputs_[0] = context; |
| 1215 } |
| 1216 |
| 1217 DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context") |
| 1218 |
| 1219 LOperand* context() { return InputAt(0); } |
| 1300 }; | 1220 }; |
| 1301 | 1221 |
| 1302 | 1222 |
| 1223 class LGlobalObject: public LTemplateInstruction<1, 1, 0> { |
| 1224 public: |
| 1225 explicit LGlobalObject(LOperand* context) { |
| 1226 inputs_[0] = context; |
| 1227 } |
| 1228 |
| 1229 DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object") |
| 1230 |
| 1231 LOperand* context() { return InputAt(0); } |
| 1232 }; |
| 1233 |
| 1234 |
| 1235 class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> { |
| 1236 public: |
| 1237 explicit LGlobalReceiver(LOperand* global_object) { |
| 1238 inputs_[0] = global_object; |
| 1239 } |
| 1240 |
| 1241 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver") |
| 1242 |
| 1243 LOperand* global() { return InputAt(0); } |
| 1244 }; |
| 1245 |
| 1246 |
| 1303 class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> { | 1247 class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> { |
| 1304 public: | 1248 public: |
| 1305 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function") | 1249 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function") |
| 1306 DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction) | 1250 DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction) |
| 1307 | 1251 |
| 1308 virtual void PrintDataTo(StringStream* stream); | 1252 virtual void PrintDataTo(StringStream* stream); |
| 1309 | 1253 |
| 1310 Handle<JSFunction> function() { return hydrogen()->function(); } | 1254 Handle<JSFunction> function() { return hydrogen()->function(); } |
| 1311 int arity() const { return hydrogen()->argument_count() - 1; } | 1255 int arity() const { return hydrogen()->argument_count() - 1; } |
| 1312 }; | 1256 }; |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1995 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 1939 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 1996 }; | 1940 }; |
| 1997 | 1941 |
| 1998 #undef DECLARE_HYDROGEN_ACCESSOR | 1942 #undef DECLARE_HYDROGEN_ACCESSOR |
| 1999 #undef DECLARE_INSTRUCTION | 1943 #undef DECLARE_INSTRUCTION |
| 2000 #undef DECLARE_CONCRETE_INSTRUCTION | 1944 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2001 | 1945 |
| 2002 } } // namespace v8::internal | 1946 } } // namespace v8::internal |
| 2003 | 1947 |
| 2004 #endif // V8_ARM_LITHIUM_ARM_H_ | 1948 #endif // V8_ARM_LITHIUM_ARM_H_ |
| OLD | NEW |