Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: src/x64/lithium-x64.h

Issue 6697023: Merge 6800:7180 from the bleeding edge branch to the experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 10 matching lines...) Expand all
67 V(CallKnownGlobal) \ 65 V(CallKnownGlobal) \
68 V(CallNamed) \ 66 V(CallNamed) \
69 V(CallNew) \ 67 V(CallNew) \
70 V(CallRuntime) \ 68 V(CallRuntime) \
71 V(CallStub) \ 69 V(CallStub) \
72 V(CheckFunction) \ 70 V(CheckFunction) \
73 V(CheckInstanceType) \ 71 V(CheckInstanceType) \
74 V(CheckMap) \ 72 V(CheckMap) \
75 V(CheckPrototypeMaps) \ 73 V(CheckPrototypeMaps) \
76 V(CheckSmi) \ 74 V(CheckSmi) \
75 V(ClassOfTest) \
76 V(ClassOfTestAndBranch) \
77 V(CmpID) \ 77 V(CmpID) \
78 V(CmpIDAndBranch) \ 78 V(CmpIDAndBranch) \
79 V(CmpJSObjectEq) \ 79 V(CmpJSObjectEq) \
80 V(CmpJSObjectEqAndBranch) \ 80 V(CmpJSObjectEqAndBranch) \
81 V(CmpMapAndBranch) \ 81 V(CmpMapAndBranch) \
82 V(CmpT) \ 82 V(CmpT) \
83 V(CmpTAndBranch) \ 83 V(CmpTAndBranch) \
84 V(ConstantD) \ 84 V(ConstantD) \
85 V(ConstantI) \ 85 V(ConstantI) \
86 V(ConstantT) \ 86 V(ConstantT) \
87 V(Context) \ 87 V(Context) \
88 V(DeleteProperty) \ 88 V(DeleteProperty) \
89 V(Deoptimize) \ 89 V(Deoptimize) \
90 V(DivI) \ 90 V(DivI) \
91 V(DoubleToI) \ 91 V(DoubleToI) \
92 V(ExternalArrayLength) \
93 V(FixedArrayLength) \
92 V(FunctionLiteral) \ 94 V(FunctionLiteral) \
93 V(Gap) \ 95 V(Gap) \
96 V(GetCachedArrayIndex) \
94 V(GlobalObject) \ 97 V(GlobalObject) \
95 V(GlobalReceiver) \ 98 V(GlobalReceiver) \
96 V(Goto) \ 99 V(Goto) \
97 V(FixedArrayLength) \ 100 V(HasInstanceType) \
101 V(HasInstanceTypeAndBranch) \
102 V(HasCachedArrayIndex) \
103 V(HasCachedArrayIndexAndBranch) \
98 V(InstanceOf) \ 104 V(InstanceOf) \
99 V(InstanceOfAndBranch) \ 105 V(InstanceOfAndBranch) \
100 V(InstanceOfKnownGlobal) \ 106 V(InstanceOfKnownGlobal) \
101 V(Integer32ToDouble) \ 107 V(Integer32ToDouble) \
102 V(IsNull) \ 108 V(IsNull) \
103 V(IsNullAndBranch) \ 109 V(IsNullAndBranch) \
104 V(IsObject) \ 110 V(IsObject) \
105 V(IsObjectAndBranch) \ 111 V(IsObjectAndBranch) \
106 V(IsSmi) \ 112 V(IsSmi) \
107 V(IsSmiAndBranch) \ 113 V(IsSmiAndBranch) \
108 V(JSArrayLength) \ 114 V(JSArrayLength) \
109 V(HasInstanceType) \
110 V(HasInstanceTypeAndBranch) \
111 V(HasCachedArrayIndex) \
112 V(HasCachedArrayIndexAndBranch) \
113 V(ClassOfTest) \
114 V(ClassOfTestAndBranch) \
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(LoadGlobal) \ 120 V(LoadGlobal) \
120 V(LoadKeyedFastElement) \ 121 V(LoadKeyedFastElement) \
121 V(LoadKeyedGeneric) \ 122 V(LoadKeyedGeneric) \
122 V(LoadNamedField) \ 123 V(LoadNamedField) \
123 V(LoadNamedGeneric) \ 124 V(LoadNamedGeneric) \
124 V(LoadFunctionPrototype) \ 125 V(LoadFunctionPrototype) \
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(Parameter) \ 135 V(Parameter) \
135 V(PixelArrayLength) \
136 V(Power) \ 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(StoreGlobal) \ 145 V(StoreGlobal) \
145 V(StoreKeyedFastElement) \ 146 V(StoreKeyedFastElement) \
146 V(StoreKeyedGeneric) \ 147 V(StoreKeyedGeneric) \
147 V(StoreNamedField) \ 148 V(StoreNamedField) \
148 V(StoreNamedGeneric) \ 149 V(StoreNamedGeneric) \
150 V(StorePixelArrayElement) \
151 V(StringCharCodeAt) \
152 V(StringCharFromCode) \
149 V(StringLength) \ 153 V(StringLength) \
150 V(SubI) \ 154 V(SubI) \
151 V(TaggedToI) \ 155 V(TaggedToI) \
152 V(Throw) \ 156 V(Throw) \
153 V(Typeof) \ 157 V(Typeof) \
154 V(TypeofIs) \ 158 V(TypeofIs) \
155 V(TypeofIsAndBranch) \ 159 V(TypeofIsAndBranch) \
156 V(IsConstructCall) \ 160 V(IsConstructCall) \
157 V(IsConstructCallAndBranch) \ 161 V(IsConstructCallAndBranch) \
158 V(UnaryMathOperation) \ 162 V(UnaryMathOperation) \
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 } 725 }
722 726
723 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, 727 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
724 "has-instance-type-and-branch") 728 "has-instance-type-and-branch")
725 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) 729 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
726 730
727 virtual void PrintDataTo(StringStream* stream); 731 virtual void PrintDataTo(StringStream* stream);
728 }; 732 };
729 733
730 734
735 class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
736 public:
737 explicit LGetCachedArrayIndex(LOperand* value) {
738 inputs_[0] = value;
739 }
740
741 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
742 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
743 };
744
745
731 class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> { 746 class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
732 public: 747 public:
733 explicit LHasCachedArrayIndex(LOperand* value) { 748 explicit LHasCachedArrayIndex(LOperand* value) {
734 inputs_[0] = value; 749 inputs_[0] = value;
735 } 750 }
736 751
737 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index") 752 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index")
738 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex) 753 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex)
739 }; 754 };
740 755
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 public: 991 public:
977 explicit LJSArrayLength(LOperand* value) { 992 explicit LJSArrayLength(LOperand* value) {
978 inputs_[0] = value; 993 inputs_[0] = value;
979 } 994 }
980 995
981 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length") 996 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length")
982 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength) 997 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength)
983 }; 998 };
984 999
985 1000
986 class LPixelArrayLength: public LTemplateInstruction<1, 1, 0> { 1001 class LExternalArrayLength: public LTemplateInstruction<1, 1, 0> {
987 public: 1002 public:
988 explicit LPixelArrayLength(LOperand* value) { 1003 explicit LExternalArrayLength(LOperand* value) {
989 inputs_[0] = value; 1004 inputs_[0] = value;
990 } 1005 }
991 1006
992 DECLARE_CONCRETE_INSTRUCTION(PixelArrayLength, "pixel-array-length") 1007 DECLARE_CONCRETE_INSTRUCTION(ExternalArrayLength, "external-array-length")
993 DECLARE_HYDROGEN_ACCESSOR(PixelArrayLength) 1008 DECLARE_HYDROGEN_ACCESSOR(ExternalArrayLength)
994 }; 1009 };
995 1010
996 1011
997 class LFixedArrayLength: public LTemplateInstruction<1, 1, 0> { 1012 class LFixedArrayLength: public LTemplateInstruction<1, 1, 0> {
998 public: 1013 public:
999 explicit LFixedArrayLength(LOperand* value) { 1014 explicit LFixedArrayLength(LOperand* value) {
1000 inputs_[0] = value; 1015 inputs_[0] = value;
1001 } 1016 }
1002 1017
1003 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length") 1018 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length")
1004 DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength) 1019 DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength)
1005 }; 1020 };
1006 1021
1007 1022
1008 class LValueOf: public LTemplateInstruction<1, 1, 1> { 1023 class LValueOf: public LTemplateInstruction<1, 1, 0> {
1009 public: 1024 public:
1010 LValueOf(LOperand* value, LOperand* temp) { 1025 explicit LValueOf(LOperand* value) {
1011 inputs_[0] = value; 1026 inputs_[0] = value;
1012 temps_[0] = temp;
1013 } 1027 }
1014 1028
1015 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") 1029 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
1016 DECLARE_HYDROGEN_ACCESSOR(ValueOf) 1030 DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1017 }; 1031 };
1018 1032
1019 1033
1020 class LThrow: public LTemplateInstruction<0, 1, 0> { 1034 class LThrow: public LTemplateInstruction<0, 1, 0> {
1021 public: 1035 public:
1022 explicit LThrow(LOperand* value) { 1036 explicit LThrow(LOperand* value) {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 class LLoadElements: public LTemplateInstruction<1, 1, 0> { 1162 class LLoadElements: public LTemplateInstruction<1, 1, 0> {
1149 public: 1163 public:
1150 explicit LLoadElements(LOperand* object) { 1164 explicit LLoadElements(LOperand* object) {
1151 inputs_[0] = object; 1165 inputs_[0] = object;
1152 } 1166 }
1153 1167
1154 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") 1168 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
1155 }; 1169 };
1156 1170
1157 1171
1158 class LLoadPixelArrayExternalPointer: public LTemplateInstruction<1, 1, 0> { 1172 class LLoadExternalArrayPointer: public LTemplateInstruction<1, 1, 0> {
1159 public: 1173 public:
1160 explicit LLoadPixelArrayExternalPointer(LOperand* object) { 1174 explicit LLoadExternalArrayPointer(LOperand* object) {
1161 inputs_[0] = object; 1175 inputs_[0] = object;
1162 } 1176 }
1163 1177
1164 DECLARE_CONCRETE_INSTRUCTION(LoadPixelArrayExternalPointer, 1178 DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer,
1165 "load-pixel-array-external-pointer") 1179 "load-external-array-pointer")
1166 }; 1180 };
1167 1181
1168 1182
1169 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> { 1183 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> {
1170 public: 1184 public:
1171 LLoadKeyedFastElement(LOperand* elements, LOperand* key) { 1185 LLoadKeyedFastElement(LOperand* elements, LOperand* key) {
1172 inputs_[0] = elements; 1186 inputs_[0] = elements;
1173 inputs_[1] = key; 1187 inputs_[1] = key;
1174 } 1188 }
1175 1189
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") 1253 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
1240 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) 1254 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
1241 1255
1242 LOperand* context() { return InputAt(0); } 1256 LOperand* context() { return InputAt(0); }
1243 int slot_index() { return hydrogen()->slot_index(); } 1257 int slot_index() { return hydrogen()->slot_index(); }
1244 1258
1245 virtual void PrintDataTo(StringStream* stream); 1259 virtual void PrintDataTo(StringStream* stream);
1246 }; 1260 };
1247 1261
1248 1262
1263 class LStoreContextSlot: public LTemplateInstruction<0, 2, 1> {
1264 public:
1265 LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) {
1266 inputs_[0] = context;
1267 inputs_[1] = value;
1268 temps_[0] = temp;
1269 }
1270
1271 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
1272 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
1273
1274 LOperand* context() { return InputAt(0); }
1275 LOperand* value() { return InputAt(1); }
1276 int slot_index() { return hydrogen()->slot_index(); }
1277 int needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
1278
1279 virtual void PrintDataTo(StringStream* stream);
1280 };
1281
1282
1249 class LPushArgument: public LTemplateInstruction<0, 1, 0> { 1283 class LPushArgument: public LTemplateInstruction<0, 1, 0> {
1250 public: 1284 public:
1251 explicit LPushArgument(LOperand* value) { 1285 explicit LPushArgument(LOperand* value) {
1252 inputs_[0] = value; 1286 inputs_[0] = value;
1253 } 1287 }
1254 1288
1255 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") 1289 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
1256 }; 1290 };
1257 1291
1258 1292
1259 class LContext: public LTemplateInstruction<1, 0, 0> { 1293 class LContext: public LTemplateInstruction<1, 0, 0> {
1260 public: 1294 public:
1261 DECLARE_CONCRETE_INSTRUCTION(Context, "context") 1295 DECLARE_CONCRETE_INSTRUCTION(Context, "context")
1262 }; 1296 };
1263 1297
1264 1298
1299 class LOuterContext: public LTemplateInstruction<1, 1, 0> {
1300 public:
1301 explicit LOuterContext(LOperand* context) {
1302 inputs_[0] = context;
1303 }
1304
1305 DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
1306
1307 LOperand* context() { return InputAt(0); }
1308 };
1309
1310
1265 class LGlobalObject: public LTemplateInstruction<1, 0, 0> { 1311 class LGlobalObject: public LTemplateInstruction<1, 0, 0> {
1266 public: 1312 public:
1267 DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object") 1313 DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
1268 }; 1314 };
1269 1315
1270 1316
1271 class LGlobalReceiver: public LTemplateInstruction<1, 0, 0> { 1317 class LGlobalReceiver: public LTemplateInstruction<1, 0, 0> {
1272 public: 1318 public:
1273 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver") 1319 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
1274 }; 1320 };
(...skipping 13 matching lines...) Expand all
1288 1334
1289 class LCallKeyed: public LTemplateInstruction<1, 1, 0> { 1335 class LCallKeyed: public LTemplateInstruction<1, 1, 0> {
1290 public: 1336 public:
1291 explicit LCallKeyed(LOperand* key) { 1337 explicit LCallKeyed(LOperand* key) {
1292 inputs_[0] = key; 1338 inputs_[0] = key;
1293 } 1339 }
1294 1340
1295 DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed") 1341 DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
1296 DECLARE_HYDROGEN_ACCESSOR(CallKeyed) 1342 DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
1297 1343
1344 LOperand* key() { return inputs_[0]; }
1345
1298 virtual void PrintDataTo(StringStream* stream); 1346 virtual void PrintDataTo(StringStream* stream);
1299 1347
1300 int arity() const { return hydrogen()->argument_count() - 1; } 1348 int arity() const { return hydrogen()->argument_count() - 1; }
1301 }; 1349 };
1302 1350
1303 1351
1304 class LCallNamed: public LTemplateInstruction<1, 0, 0> { 1352 class LCallNamed: public LTemplateInstruction<1, 0, 0> {
1305 public: 1353 public:
1306 DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named") 1354 DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
1307 DECLARE_HYDROGEN_ACCESSOR(CallNamed) 1355 DECLARE_HYDROGEN_ACCESSOR(CallNamed)
1308 1356
1309 virtual void PrintDataTo(StringStream* stream); 1357 virtual void PrintDataTo(StringStream* stream);
1310 1358
1311 Handle<String> name() const { return hydrogen()->name(); } 1359 Handle<String> name() const { return hydrogen()->name(); }
1312 int arity() const { return hydrogen()->argument_count() - 1; } 1360 int arity() const { return hydrogen()->argument_count() - 1; }
1313 }; 1361 };
1314 1362
1315 1363
1316 class LCallFunction: public LTemplateInstruction<1, 0, 0> { 1364 class LCallFunction: public LTemplateInstruction<1, 0, 0> {
1317 public: 1365 public:
1366 LCallFunction() {}
1367
1318 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function") 1368 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
1319 DECLARE_HYDROGEN_ACCESSOR(CallFunction) 1369 DECLARE_HYDROGEN_ACCESSOR(CallFunction)
1320 1370
1321 int arity() const { return hydrogen()->argument_count() - 2; } 1371 int arity() const { return hydrogen()->argument_count() - 2; }
1322 }; 1372 };
1323 1373
1324 1374
1325 class LCallGlobal: public LTemplateInstruction<1, 0, 0> { 1375 class LCallGlobal: public LTemplateInstruction<1, 0, 0> {
1326 public: 1376 public:
1327 DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global") 1377 DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 explicit LNumberTagD(LOperand* value, LOperand* temp) { 1446 explicit LNumberTagD(LOperand* value, LOperand* temp) {
1397 inputs_[0] = value; 1447 inputs_[0] = value;
1398 temps_[0] = temp; 1448 temps_[0] = temp;
1399 } 1449 }
1400 1450
1401 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") 1451 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
1402 }; 1452 };
1403 1453
1404 1454
1405 // Sometimes truncating conversion from a tagged value to an int32. 1455 // Sometimes truncating conversion from a tagged value to an int32.
1406 class LDoubleToI: public LTemplateInstruction<1, 1, 1> { 1456 class LDoubleToI: public LTemplateInstruction<1, 1, 0> {
1407 public: 1457 public:
1408 LDoubleToI(LOperand* value, LOperand* temp) { 1458 explicit LDoubleToI(LOperand* value) {
1409 inputs_[0] = value; 1459 inputs_[0] = value;
1410 temps_[0] = temp;
1411 } 1460 }
1412 1461
1413 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") 1462 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
1414 DECLARE_HYDROGEN_ACCESSOR(Change) 1463 DECLARE_HYDROGEN_ACCESSOR(Change)
1415 1464
1416 bool truncating() { return hydrogen()->CanTruncateToInt32(); } 1465 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1417 }; 1466 };
1418 1467
1419 1468
1420 // Truncating conversion from a tagged value to an int32. 1469 // Truncating conversion from a tagged value to an int32.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 1510
1462 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") 1511 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
1463 1512
1464 bool needs_check() const { return needs_check_; } 1513 bool needs_check() const { return needs_check_; }
1465 1514
1466 private: 1515 private:
1467 bool needs_check_; 1516 bool needs_check_;
1468 }; 1517 };
1469 1518
1470 1519
1471 class LStoreNamed: public LTemplateInstruction<0, 2, 1> { 1520 class LStoreNamedField: public LTemplateInstruction<0, 2, 1> {
1472 public: 1521 public:
1473 LStoreNamed(LOperand* obj, LOperand* val) { 1522 LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) {
1474 inputs_[0] = obj; 1523 inputs_[0] = object;
1475 inputs_[1] = val; 1524 inputs_[1] = value;
1476 }
1477
1478 DECLARE_INSTRUCTION(StoreNamed)
1479 DECLARE_HYDROGEN_ACCESSOR(StoreNamed)
1480
1481 virtual void PrintDataTo(StringStream* stream);
1482
1483 LOperand* object() { return inputs_[0]; }
1484 LOperand* value() { return inputs_[1]; }
1485 Handle<Object> name() const { return hydrogen()->name(); }
1486 };
1487
1488
1489 class LStoreNamedField: public LStoreNamed {
1490 public:
1491 LStoreNamedField(LOperand* obj, LOperand* val, LOperand* temp)
1492 : LStoreNamed(obj, val) {
1493 temps_[0] = temp; 1525 temps_[0] = temp;
1494 } 1526 }
1495 1527
1496 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") 1528 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
1497 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField) 1529 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
1498 1530
1531 virtual void PrintDataTo(StringStream* stream);
1532
1533 LOperand* object() { return inputs_[0]; }
1534 LOperand* value() { return inputs_[1]; }
1535
1536 Handle<Object> name() const { return hydrogen()->name(); }
1499 bool is_in_object() { return hydrogen()->is_in_object(); } 1537 bool is_in_object() { return hydrogen()->is_in_object(); }
1500 int offset() { return hydrogen()->offset(); } 1538 int offset() { return hydrogen()->offset(); }
1501 bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); } 1539 bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
1502 Handle<Map> transition() const { return hydrogen()->transition(); } 1540 Handle<Map> transition() const { return hydrogen()->transition(); }
1503 }; 1541 };
1504 1542
1505 1543
1506 class LStoreNamedGeneric: public LStoreNamed { 1544 class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> {
1507 public: 1545 public:
1508 LStoreNamedGeneric(LOperand* obj, LOperand* val) 1546 LStoreNamedGeneric(LOperand* object, LOperand* value) {
1509 : LStoreNamed(obj, val) { } 1547 inputs_[0] = object;
1548 inputs_[1] = value;
1549 }
1510 1550
1511 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") 1551 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
1512 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) 1552 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
1553
1554 virtual void PrintDataTo(StringStream* stream);
1555
1556 LOperand* object() { return inputs_[0]; }
1557 LOperand* value() { return inputs_[1]; }
1558 Handle<Object> name() const { return hydrogen()->name(); }
1513 }; 1559 };
1514 1560
1515 1561
1516 class LStoreKeyed: public LTemplateInstruction<0, 3, 0> { 1562 class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> {
1517 public: 1563 public:
1518 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) { 1564 LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) {
1519 inputs_[0] = obj; 1565 inputs_[0] = obj;
1520 inputs_[1] = key; 1566 inputs_[1] = key;
1521 inputs_[2] = val; 1567 inputs_[2] = val;
1522 } 1568 }
1523 1569
1524 DECLARE_INSTRUCTION(StoreKeyed) 1570 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
1571 "store-keyed-fast-element")
1572 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
1525 1573
1526 virtual void PrintDataTo(StringStream* stream); 1574 virtual void PrintDataTo(StringStream* stream);
1527 1575
1528 LOperand* object() { return inputs_[0]; } 1576 LOperand* object() { return inputs_[0]; }
1529 LOperand* key() { return inputs_[1]; } 1577 LOperand* key() { return inputs_[1]; }
1530 LOperand* value() { return inputs_[2]; } 1578 LOperand* value() { return inputs_[2]; }
1531 }; 1579 };
1532 1580
1533 1581
1534 class LStoreKeyedFastElement: public LStoreKeyed { 1582 class LStorePixelArrayElement: public LTemplateInstruction<0, 3, 0> {
1535 public: 1583 public:
1536 LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) 1584 LStorePixelArrayElement(LOperand* external_pointer,
1537 : LStoreKeyed(obj, key, val) {} 1585 LOperand* key,
1586 LOperand* val) {
1587 inputs_[0] = external_pointer;
1588 inputs_[1] = key;
1589 inputs_[2] = val;
1590 }
1538 1591
1539 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement, 1592 DECLARE_CONCRETE_INSTRUCTION(StorePixelArrayElement,
1540 "store-keyed-fast-element") 1593 "store-pixel-array-element")
1541 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement) 1594 DECLARE_HYDROGEN_ACCESSOR(StorePixelArrayElement)
1595
1596 LOperand* external_pointer() { return inputs_[0]; }
1597 LOperand* key() { return inputs_[1]; }
1598 LOperand* value() { return inputs_[2]; }
1542 }; 1599 };
1543 1600
1544 1601
1545 class LStoreKeyedGeneric: public LStoreKeyed { 1602 class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> {
1546 public: 1603 public:
1547 LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* val) 1604 LStoreKeyedGeneric(LOperand* object, LOperand* key, LOperand* value) {
1548 : LStoreKeyed(obj, key, val) { } 1605 inputs_[0] = object;
1606 inputs_[1] = key;
1607 inputs_[2] = value;
1608 }
1549 1609
1550 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") 1610 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
1611
1612 virtual void PrintDataTo(StringStream* stream);
1613
1614 LOperand* object() { return inputs_[0]; }
1615 LOperand* key() { return inputs_[1]; }
1616 LOperand* value() { return inputs_[2]; }
1617 };
1618
1619
1620 class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> {
1621 public:
1622 LStringCharCodeAt(LOperand* string, LOperand* index) {
1623 inputs_[0] = string;
1624 inputs_[1] = index;
1625 }
1626
1627 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
1628 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
1629
1630 LOperand* string() { return inputs_[0]; }
1631 LOperand* index() { return inputs_[1]; }
1632 };
1633
1634
1635 class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> {
1636 public:
1637 explicit LStringCharFromCode(LOperand* char_code) {
1638 inputs_[0] = char_code;
1639 }
1640
1641 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
1642 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
1643
1644 LOperand* char_code() { return inputs_[0]; }
1551 }; 1645 };
1552 1646
1553 1647
1554 class LStringLength: public LTemplateInstruction<1, 1, 0> { 1648 class LStringLength: public LTemplateInstruction<1, 1, 0> {
1555 public: 1649 public:
1556 explicit LStringLength(LOperand* string) { 1650 explicit LStringLength(LOperand* string) {
1557 inputs_[0] = string; 1651 inputs_[0] = string;
1558 } 1652 }
1559 1653
1560 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length") 1654 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length")
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1757 1851
1758 class LStackCheck: public LTemplateInstruction<0, 0, 0> { 1852 class LStackCheck: public LTemplateInstruction<0, 0, 0> {
1759 public: 1853 public:
1760 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") 1854 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
1761 }; 1855 };
1762 1856
1763 1857
1764 class LChunkBuilder; 1858 class LChunkBuilder;
1765 class LChunk: public ZoneObject { 1859 class LChunk: public ZoneObject {
1766 public: 1860 public:
1767 explicit LChunk(HGraph* graph) 1861 explicit LChunk(CompilationInfo* info, HGraph* graph)
1768 : spill_slot_count_(0), 1862 : spill_slot_count_(0),
1863 info_(info),
1769 graph_(graph), 1864 graph_(graph),
1770 instructions_(32), 1865 instructions_(32),
1771 pointer_maps_(8), 1866 pointer_maps_(8),
1772 inlined_closures_(1) { } 1867 inlined_closures_(1) { }
1773 1868
1774 void AddInstruction(LInstruction* instruction, HBasicBlock* block); 1869 void AddInstruction(LInstruction* instruction, HBasicBlock* block);
1775 LConstantOperand* DefineConstantOperand(HConstant* constant); 1870 LConstantOperand* DefineConstantOperand(HConstant* constant);
1776 Handle<Object> LookupLiteral(LConstantOperand* operand) const; 1871 Handle<Object> LookupLiteral(LConstantOperand* operand) const;
1777 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; 1872 Representation LookupLiteralRepresentation(LConstantOperand* operand) const;
1778 1873
1779 int GetNextSpillIndex(bool is_double); 1874 int GetNextSpillIndex(bool is_double);
1780 LOperand* GetNextSpillSlot(bool is_double); 1875 LOperand* GetNextSpillSlot(bool is_double);
1781 1876
1782 int ParameterAt(int index); 1877 int ParameterAt(int index);
1783 int GetParameterStackSlot(int index) const; 1878 int GetParameterStackSlot(int index) const;
1784 int spill_slot_count() const { return spill_slot_count_; } 1879 int spill_slot_count() const { return spill_slot_count_; }
1880 CompilationInfo* info() const { return info_; }
1785 HGraph* graph() const { return graph_; } 1881 HGraph* graph() const { return graph_; }
1786 const ZoneList<LInstruction*>* instructions() const { return &instructions_; } 1882 const ZoneList<LInstruction*>* instructions() const { return &instructions_; }
1787 void AddGapMove(int index, LOperand* from, LOperand* to); 1883 void AddGapMove(int index, LOperand* from, LOperand* to);
1788 LGap* GetGapAt(int index) const; 1884 LGap* GetGapAt(int index) const;
1789 bool IsGapAt(int index) const; 1885 bool IsGapAt(int index) const;
1790 int NearestGapPos(int index) const; 1886 int NearestGapPos(int index) const;
1791 void MarkEmptyBlocks(); 1887 void MarkEmptyBlocks();
1792 const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; } 1888 const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; }
1793 LLabel* GetLabel(int block_id) const { 1889 LLabel* GetLabel(int block_id) const {
1794 HBasicBlock* block = graph_->blocks()->at(block_id); 1890 HBasicBlock* block = graph_->blocks()->at(block_id);
(...skipping 16 matching lines...) Expand all
1811 const ZoneList<Handle<JSFunction> >* inlined_closures() const { 1907 const ZoneList<Handle<JSFunction> >* inlined_closures() const {
1812 return &inlined_closures_; 1908 return &inlined_closures_;
1813 } 1909 }
1814 1910
1815 void AddInlinedClosure(Handle<JSFunction> closure) { 1911 void AddInlinedClosure(Handle<JSFunction> closure) {
1816 inlined_closures_.Add(closure); 1912 inlined_closures_.Add(closure);
1817 } 1913 }
1818 1914
1819 private: 1915 private:
1820 int spill_slot_count_; 1916 int spill_slot_count_;
1917 CompilationInfo* info_;
1821 HGraph* const graph_; 1918 HGraph* const graph_;
1822 ZoneList<LInstruction*> instructions_; 1919 ZoneList<LInstruction*> instructions_;
1823 ZoneList<LPointerMap*> pointer_maps_; 1920 ZoneList<LPointerMap*> pointer_maps_;
1824 ZoneList<Handle<JSFunction> > inlined_closures_; 1921 ZoneList<Handle<JSFunction> > inlined_closures_;
1825 }; 1922 };
1826 1923
1827 1924
1828 class LChunkBuilder BASE_EMBEDDED { 1925 class LChunkBuilder BASE_EMBEDDED {
1829 public: 1926 public:
1830 LChunkBuilder(HGraph* graph, LAllocator* allocator) 1927 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
1831 : chunk_(NULL), 1928 : chunk_(NULL),
1929 info_(info),
1832 graph_(graph), 1930 graph_(graph),
1833 status_(UNUSED), 1931 status_(UNUSED),
1834 current_instruction_(NULL), 1932 current_instruction_(NULL),
1835 current_block_(NULL), 1933 current_block_(NULL),
1836 next_block_(NULL), 1934 next_block_(NULL),
1837 argument_count_(0), 1935 argument_count_(0),
1838 allocator_(allocator), 1936 allocator_(allocator),
1839 position_(RelocInfo::kNoPosition), 1937 position_(RelocInfo::kNoPosition),
1840 instruction_pending_deoptimization_environment_(NULL), 1938 instruction_pending_deoptimization_environment_(NULL),
1841 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } 1939 pending_deoptimization_ast_id_(AstNode::kNoNumber) { }
1842 1940
1843 // Build the sequence for the graph. 1941 // Build the sequence for the graph.
1844 LChunk* Build(); 1942 LChunk* Build();
1845 1943
1846 // Declare methods that deal with the individual node types. 1944 // Declare methods that deal with the individual node types.
1847 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); 1945 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
1848 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) 1946 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
1849 #undef DECLARE_DO 1947 #undef DECLARE_DO
1850 1948
1851 private: 1949 private:
1852 enum Status { 1950 enum Status {
1853 UNUSED, 1951 UNUSED,
1854 BUILDING, 1952 BUILDING,
1855 DONE, 1953 DONE,
1856 ABORTED 1954 ABORTED
1857 }; 1955 };
1858 1956
1859 LChunk* chunk() const { return chunk_; } 1957 LChunk* chunk() const { return chunk_; }
1958 CompilationInfo* info() const { return info_; }
1860 HGraph* graph() const { return graph_; } 1959 HGraph* graph() const { return graph_; }
1861 1960
1862 bool is_unused() const { return status_ == UNUSED; } 1961 bool is_unused() const { return status_ == UNUSED; }
1863 bool is_building() const { return status_ == BUILDING; } 1962 bool is_building() const { return status_ == BUILDING; }
1864 bool is_done() const { return status_ == DONE; } 1963 bool is_done() const { return status_ == DONE; }
1865 bool is_aborted() const { return status_ == ABORTED; } 1964 bool is_aborted() const { return status_ == ABORTED; }
1866 1965
1867 void Abort(const char* format, ...); 1966 void Abort(const char* format, ...);
1868 1967
1869 // Methods for getting operands for Use / Define / Temp. 1968 // Methods for getting operands for Use / Define / Temp.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 2055
1957 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); 2056 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
1958 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); 2057 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr);
1959 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); 2058 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
1960 LInstruction* DoArithmeticD(Token::Value op, 2059 LInstruction* DoArithmeticD(Token::Value op,
1961 HArithmeticBinaryOperation* instr); 2060 HArithmeticBinaryOperation* instr);
1962 LInstruction* DoArithmeticT(Token::Value op, 2061 LInstruction* DoArithmeticT(Token::Value op,
1963 HArithmeticBinaryOperation* instr); 2062 HArithmeticBinaryOperation* instr);
1964 2063
1965 LChunk* chunk_; 2064 LChunk* chunk_;
2065 CompilationInfo* info_;
1966 HGraph* const graph_; 2066 HGraph* const graph_;
1967 Status status_; 2067 Status status_;
1968 HInstruction* current_instruction_; 2068 HInstruction* current_instruction_;
1969 HBasicBlock* current_block_; 2069 HBasicBlock* current_block_;
1970 HBasicBlock* next_block_; 2070 HBasicBlock* next_block_;
1971 int argument_count_; 2071 int argument_count_;
1972 LAllocator* allocator_; 2072 LAllocator* allocator_;
1973 int position_; 2073 int position_;
1974 LInstruction* instruction_pending_deoptimization_environment_; 2074 LInstruction* instruction_pending_deoptimization_environment_;
1975 int pending_deoptimization_ast_id_; 2075 int pending_deoptimization_ast_id_;
1976 2076
1977 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2077 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
1978 }; 2078 };
1979 2079
1980 #undef DECLARE_HYDROGEN_ACCESSOR 2080 #undef DECLARE_HYDROGEN_ACCESSOR
1981 #undef DECLARE_INSTRUCTION 2081 #undef DECLARE_INSTRUCTION
1982 #undef DECLARE_CONCRETE_INSTRUCTION 2082 #undef DECLARE_CONCRETE_INSTRUCTION
1983 2083
1984 } } // namespace v8::int 2084 } } // namespace v8::int
1985 2085
1986 #endif // V8_X64_LITHIUM_X64_H_ 2086 #endif // V8_X64_LITHIUM_X64_H_
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698