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

Side by Side Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 1546923002: [Interpreter] Fixes tests for wide bytecodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/interpreter/bytecode-array-iterator.h" 8 #include "src/interpreter/bytecode-array-iterator.h"
9 #include "src/interpreter/bytecode-generator.h" 9 #include "src/interpreter/bytecode-generator.h"
10 #include "src/interpreter/interpreter.h" 10 #include "src/interpreter/interpreter.h"
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 0, 918 0,
919 3, 919 3,
920 6, 920 6,
921 { 921 {
922 B(Ldar), A(2, 3), // 922 B(Ldar), A(2, 3), //
923 B(KeyedLoadICStrict), A(1, 3), U8(vector->GetIndex(slot1)), // 923 B(KeyedLoadICStrict), A(1, 3), U8(vector->GetIndex(slot1)), //
924 B(Return), // 924 B(Return), //
925 }, 925 },
926 0}, 926 0},
927 {"function f(a) {\n" 927 {"function f(a) {\n"
928 " var b;\n" REPEAT_127(SPACE, " b = a.name; ") " return a.name; }\n" 928 " var b;\n"
929 "f({name : \"test\"})\n", 929 "b = a.name;"
930 REPEAT_127(SPACE, " b = a.name; ")
931 " return a.name; }\n"
932 "f({name : \"test\"})\n",
930 1 * kPointerSize, 933 1 * kPointerSize,
931 2, 934 2,
932 767, 935 775,
933 { 936 {
934 REPEAT_127(COMMA, // 937 B(LoadICSloppy), A(1, 2), U8(0), U8(wide_idx_1 += 2), //
935 B(LoadICSloppy), A(1, 2), U8(0), 938 B(Star), R(0), //
936 U8((wide_idx_1 += 2)), // 939 REPEAT_127(COMMA, //
937 B(Star), R(0)), // 940 B(LoadICSloppy), A(1, 2), U8(0), //
938 B(LoadICSloppy), 941 U8((wide_idx_1 += 2)), //
939 A(1, 2), U8(0), U8(wide_idx_1 + 2), // 942 B(Star), R(0)), //
940 B(Return), // 943 B(LoadICSloppyWide), A(1, 2), U16(0), U16(wide_idx_1 + 2), //
944 B(Return), //
941 }, 945 },
942 1, 946 1,
943 {"name"}}, 947 {"name"}},
944 {"function f(a) {\n" 948 {"function f(a) {\n"
945 " 'use strict'; var b;\n" REPEAT_127( 949 " 'use strict'; var b;\n"
946 SPACE, " b = a.name; ") " return a.name; }\n" 950 " b = a.name;\n"
947 "f({name : \"test\"})\n", 951 REPEAT_127(SPACE, " b = a.name; ")
952 " return a.name; }\n"
953 "f({name : \"test\"})\n",
948 1 * kPointerSize, 954 1 * kPointerSize,
949 2, 955 2,
950 767, 956 775,
951 { 957 {
952 REPEAT_127(COMMA, // 958 B(LoadICStrict), A(1, 2), U8(0), U8((wide_idx_2 += 2)), //
953 B(LoadICStrict), A(1, 2), U8(0), 959 B(Star), R(0), //
954 U8((wide_idx_2 += 2)), // 960 REPEAT_127(COMMA, //
955 B(Star), R(0)), // 961 B(LoadICStrict), A(1, 2), U8(0), //
956 B(LoadICStrict), 962 U8((wide_idx_2 += 2)), //
957 A(1, 2), U8(0), U8(wide_idx_2 + 2), // 963 B(Star), R(0)), //
958 B(Return), // 964 B(LoadICStrictWide), A(1, 2), U16(0), U16(wide_idx_2 + 2), //
965 B(Return), //
959 }, 966 },
960 1, 967 1,
961 {"name"}}, 968 {"name"}},
962 {"function f(a, b) {\n" 969 {"function f(a, b) {\n"
963 " var c;\n" REPEAT_127(SPACE, 970 " var c;\n"
964 " c = a[b]; ") " return a[b]; }\n" 971 " c = a[b];"
965 "f({name : \"test\"}, \"name\")\n", 972 REPEAT_127(SPACE, " c = a[b]; ")
973 " return a[b]; }\n"
974 "f({name : \"test\"}, \"name\")\n",
966 1 * kPointerSize, 975 1 * kPointerSize,
967 3, 976 3,
968 895, 977 903,
969 { 978 {
979 B(Ldar), A(2, 3), //
980 B(KeyedLoadICSloppy), A(1, 3), U8((wide_idx_3 += 2)), //
981 B(Star), R(0), //
970 REPEAT_127(COMMA, // 982 REPEAT_127(COMMA, //
971 B(Ldar), A(2, 3), // 983 B(Ldar), A(2, 3), //
972 B(KeyedLoadICSloppy), A(1, 3), U8((wide_idx_3 += 2)), // 984 B(KeyedLoadICSloppy), A(1, 3), U8((wide_idx_3 += 2)), //
973 B(Star), R(0)), // 985 B(Star), R(0)), //
974 B(Ldar), 986 B(Ldar), A(2, 3), //
975 A(2, 3), // 987 B(KeyedLoadICSloppyWide), A(1, 3), U16(wide_idx_3 + 2), //
976 B(KeyedLoadICSloppy), A(1, 3), U8(wide_idx_3 + 2), // 988 B(Return), //
977 B(Return), //
978 }}, 989 }},
979 {"function f(a, b) {\n" 990 {"function f(a, b) {\n"
980 " 'use strict'; var c;\n" REPEAT_127( 991 " 'use strict'; var c;\n"
981 SPACE, " c = a[b]; ") " return a[b]; }\n" 992 " c = a[b];"
982 "f({name : \"test\"}, \"name\")\n", 993 REPEAT_127(SPACE, " c = a[b]; ")
994 " return a[b]; }\n"
995 "f({name : \"test\"}, \"name\")\n",
983 1 * kPointerSize, 996 1 * kPointerSize,
984 3, 997 3,
985 895, 998 903,
986 { 999 {
1000 B(Ldar), A(2, 3), //
1001 B(KeyedLoadICStrict), A(1, 3), U8((wide_idx_4 += 2)), //
1002 B(Star), R(0), //
987 REPEAT_127(COMMA, // 1003 REPEAT_127(COMMA, //
988 B(Ldar), A(2, 3), // 1004 B(Ldar), A(2, 3), //
989 B(KeyedLoadICStrict), A(1, 3), U8((wide_idx_4 += 2)), // 1005 B(KeyedLoadICStrict), A(1, 3), U8((wide_idx_4 += 2)), //
990 B(Star), R(0)), // 1006 B(Star), R(0)), //
991 B(Ldar), 1007 B(Ldar), A(2, 3), //
992 A(2, 3), // 1008 B(KeyedLoadICStrictWide), A(1, 3), U16(wide_idx_4 + 2), //
993 B(KeyedLoadICStrict), A(1, 3), U8(wide_idx_4 + 2), // 1009 B(Return), //
994 B(Return), //
995 }}, 1010 }},
996 }; 1011 };
997 for (size_t i = 0; i < arraysize(snippets); i++) { 1012 for (size_t i = 0; i < arraysize(snippets); i++) {
998 Handle<BytecodeArray> bytecode_array = 1013 Handle<BytecodeArray> bytecode_array =
999 helper.MakeBytecode(snippets[i].code_snippet, helper.kFunctionName); 1014 helper.MakeBytecode(snippets[i].code_snippet, helper.kFunctionName);
1000 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 1015 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
1001 } 1016 }
1002 } 1017 }
1003 1018
1004 1019
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 8, 1122 8,
1108 { 1123 {
1109 B(LdaConstant), U8(0), // 1124 B(LdaConstant), U8(0), //
1110 B(KeyedStoreICStrict), A(1, 3), A(2, 3), // 1125 B(KeyedStoreICStrict), A(1, 3), A(2, 3), //
1111 U8(vector->GetIndex(slot1)), // 1126 U8(vector->GetIndex(slot1)), //
1112 B(LdaUndefined), // 1127 B(LdaUndefined), //
1113 B(Return), // 1128 B(Return), //
1114 }, 1129 },
1115 1, 1130 1,
1116 {"val"}}, 1131 {"val"}},
1117 {"function f(a) {\n" REPEAT_127(SPACE, 1132 {"function f(a) {\n"
1118 " a.name = 1; ") " a.name = 2; }\n" 1133 "a.name = 1;"
1119 "f({name : \"test\"})\n", 1134 REPEAT_127(SPACE, " a.name = 1; ")
1135 " a.name = 2; }\n"
1136 "f({name : \"test\"})\n",
1120 0, 1137 0,
1121 2, 1138 2,
1122 770, 1139 778,
1123 { 1140 {
1124 REPEAT_127(COMMA, // 1141 B(LdaSmi8), U8(1), //
1125 B(LdaSmi8), U8(1), // 1142 B(StoreICSloppy), A(1, 2), U8(0), U8((wide_idx_1 += 2)), //
1126 B(StoreICSloppy), A(1, 2), U8(0), 1143 REPEAT_127(COMMA, //
1127 U8((wide_idx_1 += 2))), // 1144 B(LdaSmi8), U8(1), //
1128 B(LdaSmi8), 1145 B(StoreICSloppy), A(1, 2), U8(0), //
1129 U8(2), // 1146 U8((wide_idx_1 += 2))), //
1130 B(StoreICSloppy), A(1, 2), U8(0), U8(wide_idx_1 + 2), // 1147 B(LdaSmi8), U8(2), //
1131 B(LdaUndefined), // 1148 B(StoreICSloppyWide), A(1, 2), U16(0), U16(wide_idx_1 + 2), //
1132 B(Return), // 1149 B(LdaUndefined), //
1150 B(Return), //
1133 }, 1151 },
1134 1, 1152 1,
1135 {"name"}}, 1153 {"name"}},
1136 {"function f(a) {\n" 1154 {"function f(a) {\n"
1137 "'use strict';\n" REPEAT_127(SPACE, 1155 " 'use strict';\n"
1138 " a.name = 1; ") " a.name = 2; }\n" 1156 " a.name = 1;"
1139 "f({name : \"test\"})\n", 1157 REPEAT_127(SPACE, " a.name = 1; ")
1158 " a.name = 2; }\n"
1159 "f({name : \"test\"})\n",
1140 0, 1160 0,
1141 2, 1161 2,
1142 770, 1162 778,
1143 { 1163 {
1144 REPEAT_127(COMMA, // 1164 B(LdaSmi8), U8(1), //
1145 B(LdaSmi8), U8(1), // 1165 B(StoreICStrict), A(1, 2), U8(0), U8(wide_idx_2 += 2), //
1146 B(StoreICStrict), A(1, 2), U8(0), 1166 REPEAT_127(COMMA, //
1147 U8((wide_idx_2 += 2))), // 1167 B(LdaSmi8), U8(1), //
1148 B(LdaSmi8), 1168 B(StoreICStrict), A(1, 2), U8(0), //
1149 U8(2), // 1169 U8((wide_idx_2 += 2))), //
1150 B(StoreICStrict), A(1, 2), U8(0), U8(wide_idx_2 + 2), // 1170 B(LdaSmi8), U8(2), //
1151 B(LdaUndefined), // 1171 B(StoreICStrictWide), A(1, 2), U16(0), U16(wide_idx_2 + 2), //
1152 B(Return), // 1172 B(LdaUndefined), //
1173 B(Return), //
1153 }, 1174 },
1154 1, 1175 1,
1155 {"name"}}, 1176 {"name"}},
1156 {"function f(a, b) {\n" REPEAT_127( 1177 {"function f(a, b) {\n"
1157 SPACE, " a[b] = 1; ") " a[b] = 2; }\n" 1178 " a[b] = 1;"
1158 "f({name : \"test\"})\n", 1179 REPEAT_127(SPACE, " a[b] = 1; ")
1180 " a[b] = 2; }\n"
1181 "f({name : \"test\"})\n",
1159 0, 1182 0,
1160 3, 1183 3,
1161 770, 1184 777,
1162 { 1185 {
1163 REPEAT_127(COMMA, // 1186 B(LdaSmi8), U8(1), //
1164 B(LdaSmi8), U8(1), // 1187 B(KeyedStoreICSloppy), A(1, 3), A(2, 3), U8(wide_idx_3 += 2), //
1165 B(KeyedStoreICSloppy), A(1, 3), A(2, 3), // 1188 REPEAT_127(COMMA, //
1166 U8((wide_idx_3 += 2))), // 1189 B(LdaSmi8), U8(1), //
1167 B(LdaSmi8), 1190 B(KeyedStoreICSloppy), A(1, 3), A(2, 3), //
1168 U8(2), // 1191 U8((wide_idx_3 += 2))), //
1169 B(KeyedStoreICSloppy), A(1, 3), A(2, 3), // 1192 B(LdaSmi8), U8(2), //
1170 U8(wide_idx_3 + 2), // 1193 B(KeyedStoreICSloppyWide), A(1, 3), A(2, 3), U16(wide_idx_3 + 2), //
1171 B(LdaUndefined), // 1194 B(LdaUndefined), //
1172 B(Return), // 1195 B(Return), //
1173 }}, 1196 }},
1174 {"function f(a, b) {\n" 1197 {"function f(a, b) {\n"
1175 "'use strict';\n" REPEAT_127(SPACE, 1198 " 'use strict';\n"
1176 " a[b] = 1; ") " a[b] = 2; }\n" 1199 " a[b] = 1;"
1177 "f({name : \"test\"})\n", 1200 REPEAT_127(SPACE, " a[b] = 1; ")
1201 " a[b] = 2; }\n"
1202 "f({name : \"test\"})\n",
1178 0, 1203 0,
1179 3, 1204 3,
1180 770, 1205 777,
1181 { 1206 {
1182 REPEAT_127(COMMA, // 1207 B(LdaSmi8), U8(1), //
1183 B(LdaSmi8), U8(1), // 1208 B(KeyedStoreICStrict), A(1, 3), A(2, 3), U8(wide_idx_4 += 2), //
1184 B(KeyedStoreICStrict), A(1, 3), A(2, 3), // 1209 REPEAT_127(COMMA, //
1185 U8((wide_idx_4 += 2))), // 1210 B(LdaSmi8), U8(1), //
1186 B(LdaSmi8), 1211 B(KeyedStoreICStrict), A(1, 3), A(2, 3), //
1187 U8(2), // 1212 U8((wide_idx_4 += 2))), //
1188 B(KeyedStoreICStrict), A(1, 3), A(2, 3), // 1213 B(LdaSmi8), U8(2), //
1189 U8(wide_idx_4 + 2), // 1214 B(KeyedStoreICStrictWide), A(1, 3), A(2, 3), U16(wide_idx_4 + 2), //
1190 B(LdaUndefined), // 1215 B(LdaUndefined), //
1191 B(Return), // 1216 B(Return), //
1192 }}}; 1217 }}};
1193 for (size_t i = 0; i < arraysize(snippets); i++) { 1218 for (size_t i = 0; i < arraysize(snippets); i++) {
1194 Handle<BytecodeArray> bytecode_array = 1219 Handle<BytecodeArray> bytecode_array =
1195 helper.MakeBytecode(snippets[i].code_snippet, helper.kFunctionName); 1220 helper.MakeBytecode(snippets[i].code_snippet, helper.kFunctionName);
1196 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 1221 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
1197 } 1222 }
1198 } 1223 }
1199 1224
1200 1225
1201 #define FUNC_ARG "new (function Obj() { this.func = function() { return; }})()" 1226 #define FUNC_ARG "new (function Obj() { this.func = function() { return; }})()"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 B(Ldar), A(2, 3), // 1287 B(Ldar), A(2, 3), //
1263 B(Add), A(2, 3), // 1288 B(Add), A(2, 3), //
1264 B(Star), R(2), // 1289 B(Star), R(2), //
1265 B(Ldar), A(2, 3), // 1290 B(Ldar), A(2, 3), //
1266 B(Star), R(3), // 1291 B(Star), R(3), //
1267 B(Call), R(0), R(1), U8(2), U8(vector->GetIndex(slot1)), // 1292 B(Call), R(0), R(1), U8(2), U8(vector->GetIndex(slot1)), //
1268 B(Return), // 1293 B(Return), //
1269 }, 1294 },
1270 1, 1295 1,
1271 {"func"}}, 1296 {"func"}},
1272 {"function f(a) {\n" REPEAT_127( 1297 {"function f(a) {\n"
1273 SPACE, " a.func;\n") " return a.func(); }\nf(" FUNC_ARG ")", 1298 " a.func;\n"
1299 REPEAT_127(SPACE, " a.func;\n")
1300 " return a.func(); }\nf(" FUNC_ARG ")",
1274 2 * kPointerSize, 1301 2 * kPointerSize,
1275 2, 1302 2,
1276 526, 1303 532,
1277 { 1304 {
1305 B(LoadICSloppy), A(1, 2), U8(0), U8(wide_idx += 2), //
1278 REPEAT_127(COMMA, // 1306 REPEAT_127(COMMA, //
1279 B(LoadICSloppy), A(1, 2), U8(0), U8((wide_idx += 2))), // 1307 B(LoadICSloppy), A(1, 2), U8(0), U8((wide_idx += 2))), //
1280 B(Ldar), 1308 B(Ldar), A(1, 2), //
1281 A(1, 2), // 1309 B(Star), R(1), //
1282 B(Star), R(1), // 1310 B(LoadICSloppyWide), R(1), U16(0), U16(wide_idx + 4), //
1283 B(LoadICSloppyWide), R(1), U16(0), U16(wide_idx + 4), // 1311 B(Star), R(0), //
1284 B(Star), R(0), // 1312 B(CallWide), R(0), R(1), U16(0), U16(wide_idx + 2), //
1285 B(Call), R(0), R(1), U8(0), U8(wide_idx + 2), // 1313 B(Return), //
1286 B(Return), //
1287 }, 1314 },
1288 1, 1315 1,
1289 {"func"}}, 1316 {"func"}},
1290 }; 1317 };
1291 for (size_t i = 0; i < arraysize(snippets); i++) { 1318 for (size_t i = 0; i < arraysize(snippets); i++) {
1292 Handle<BytecodeArray> bytecode_array = 1319 Handle<BytecodeArray> bytecode_array =
1293 helper.MakeBytecode(snippets[i].code_snippet, helper.kFunctionName); 1320 helper.MakeBytecode(snippets[i].code_snippet, helper.kFunctionName);
1294 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 1321 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
1295 } 1322 }
1296 } 1323 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 {"a = 1;\nfunction f() { return a; }\nf()", 1372 {"a = 1;\nfunction f() { return a; }\nf()",
1346 0, 1373 0,
1347 1, 1374 1,
1348 4, 1375 4,
1349 { 1376 {
1350 B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot)), // 1377 B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot)), //
1351 B(Return) // 1378 B(Return) //
1352 }, 1379 },
1353 1, 1380 1,
1354 {"a"}}, 1381 {"a"}},
1355 {"a = 1; function f(b) {\n" REPEAT_127( 1382 {"a = 1;"
1356 SPACE, "b.name; ") " return a; }\nf({name: 1});", 1383 "function f(b) {\n"
1384 " b.name;\n"
1385 REPEAT_127(SPACE, "b.name; ")
1386 " return a;"
1387 "}\nf({name: 1});",
1357 0, 1388 0,
1358 2, 1389 2,
1359 512, 1390 518,
1360 { 1391 {
1392 B(LoadICSloppy), A(1, 2), U8(0), U8(wide_idx_1 += 2), //
1361 REPEAT_127(COMMA, // 1393 REPEAT_127(COMMA, //
1362 B(LoadICSloppy), A(1, 2), U8(0), U8(wide_idx_1 += 2)), // 1394 B(LoadICSloppy), A(1, 2), U8(0), U8(wide_idx_1 += 2)), //
1363 B(LdaGlobalSloppy), 1395 B(LdaGlobalSloppyWide), U16(1), U16(wide_idx_1 + 2), //
1364 U8(1), U8(wide_idx_1 + 2), // 1396 B(Return), //
1365 B(Return), //
1366 }, 1397 },
1367 2, 1398 2,
1368 {"name", "a"}}, 1399 {"name", "a"}},
1369 {"a = 1; function f(b) {\n" 1400 {"a = 1;"
1370 " 'use strict';\n" REPEAT_127(SPACE, 1401 "function f(b) {\n"
1371 "b.name; ") " return a; }\nf({name: 1});", 1402 " 'use strict';\n"
1403 " b.name\n"
1404 REPEAT_127(SPACE, "b.name; ")
1405 " return a;"
1406 "}\nf({name: 1});",
1372 0, 1407 0,
1373 2, 1408 2,
1374 512, 1409 518,
1375 { 1410 {
1411 B(LoadICStrict), A(1, 2), U8(0), U8(wide_idx_2 += 2), //
1376 REPEAT_127(COMMA, // 1412 REPEAT_127(COMMA, //
1377 B(LoadICStrict), A(1, 2), U8(0), U8(wide_idx_2 += 2)), // 1413 B(LoadICStrict), A(1, 2), U8(0), U8(wide_idx_2 += 2)), //
1378 B(LdaGlobalStrict), 1414 B(LdaGlobalStrictWide), U16(1), U16(wide_idx_2 + 2), //
1379 U8(1), U8(wide_idx_2 + 2), // 1415 B(Return), //
1380 B(Return), //
1381 }, 1416 },
1382 2, 1417 2,
1383 {"name", "a"}}, 1418 {"name", "a"}},
1384 }; 1419 };
1385 1420
1386 for (size_t i = 0; i < arraysize(snippets); i++) { 1421 for (size_t i = 0; i < arraysize(snippets); i++) {
1387 Handle<BytecodeArray> bytecode_array = 1422 Handle<BytecodeArray> bytecode_array =
1388 helper.MakeBytecode(snippets[i].code_snippet, "f"); 1423 helper.MakeBytecode(snippets[i].code_snippet, "f");
1389 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 1424 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
1390 } 1425 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 1, 1483 1,
1449 7, 1484 7,
1450 { 1485 {
1451 B(LdaSmi8), U8(2), // 1486 B(LdaSmi8), U8(2), //
1452 B(StaGlobalSloppy), U8(0), U8(vector->GetIndex(slot)), // 1487 B(StaGlobalSloppy), U8(0), U8(vector->GetIndex(slot)), //
1453 B(LdaUndefined), // 1488 B(LdaUndefined), //
1454 B(Return) // 1489 B(Return) //
1455 }, 1490 },
1456 1, 1491 1,
1457 {"a"}}, 1492 {"a"}},
1458 {"a = 1; function f(b) {\n" REPEAT_127( 1493 {"a = 1;"
1459 SPACE, "b.name; ") " a = 2; }\nf({name: 1});", 1494 "function f(b) {"
1495 " b.name;\n"
1496 REPEAT_127(SPACE, "b.name; ")
1497 " a = 2; }\n"
1498 "f({name: 1});",
1460 0, 1499 0,
1461 2, 1500 2,
1462 515, 1501 521,
1463 { 1502 {
1503 B(LoadICSloppy), A(1, 2), U8(0), U8(wide_idx_1 += 2), //
1464 REPEAT_127(COMMA, // 1504 REPEAT_127(COMMA, //
1465 B(LoadICSloppy), A(1, 2), U8(0), U8(wide_idx_1 += 2)), // 1505 B(LoadICSloppy), A(1, 2), U8(0), U8(wide_idx_1 += 2)), //
1466 B(LdaSmi8), 1506 B(LdaSmi8), U8(2), //
1467 U8(2), // 1507 B(StaGlobalSloppyWide), U16(1), U16(wide_idx_1 + 2), //
1468 B(StaGlobalSloppy), U8(1), U8(wide_idx_1 + 2), // 1508 B(LdaUndefined), //
1469 B(LdaUndefined), // 1509 B(Return), //
1470 B(Return), //
1471 }, 1510 },
1472 2, 1511 2,
1473 {"name", "a"}}, 1512 {"name", "a"}},
1474 {"a = 1; function f(b) {\n" 1513 {"a = 1;"
1475 " 'use strict';\n" REPEAT_127(SPACE, 1514 "function f(b) {\n"
1476 "b.name; ") " a = 2; }\nf({name: 1});", 1515 " 'use strict';\n"
1516 " b.name;\n"
1517 REPEAT_127(SPACE, "b.name; ")
1518 " a = 2; }\n"
1519 "f({name: 1});",
1477 0, 1520 0,
1478 2, 1521 2,
1479 515, 1522 521,
1480 { 1523 {
1524 B(LoadICStrict), A(1, 2), U8(0), U8(wide_idx_2 += 2), //
1481 REPEAT_127(COMMA, // 1525 REPEAT_127(COMMA, //
1482 B(LoadICStrict), A(1, 2), U8(0), U8(wide_idx_2 += 2)), // 1526 B(LoadICStrict), A(1, 2), U8(0), U8(wide_idx_2 += 2)), //
1483 B(LdaSmi8), 1527 B(LdaSmi8), U8(2), //
1484 U8(2), // 1528 B(StaGlobalStrictWide), U16(1), U16(wide_idx_2 + 2), //
1485 B(StaGlobalStrict), U8(1), U8(wide_idx_2 + 2), // 1529 B(LdaUndefined), //
1486 B(LdaUndefined), // 1530 B(Return), //
1487 B(Return), //
1488 }, 1531 },
1489 2, 1532 2,
1490 {"name", "a"}}, 1533 {"name", "a"}},
1491 }; 1534 };
1492 1535
1493 for (size_t i = 0; i < arraysize(snippets); i++) { 1536 for (size_t i = 0; i < arraysize(snippets); i++) {
1494 Handle<BytecodeArray> bytecode_array = 1537 Handle<BytecodeArray> bytecode_array =
1495 helper.MakeBytecode(snippets[i].code_snippet, "f"); 1538 helper.MakeBytecode(snippets[i].code_snippet, "f");
1496 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 1539 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
1497 } 1540 }
(...skipping 4292 matching lines...) Expand 10 before | Expand all | Expand 10 after
5790 // inside eval. 5833 // inside eval.
5791 Handle<BytecodeArray> bytecode_array = 5834 Handle<BytecodeArray> bytecode_array =
5792 helper.MakeBytecode(script.c_str(), "t", "f"); 5835 helper.MakeBytecode(script.c_str(), "t", "f");
5793 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 5836 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
5794 } 5837 }
5795 } 5838 }
5796 5839
5797 } // namespace interpreter 5840 } // namespace interpreter
5798 } // namespace internal 5841 } // namespace internal
5799 } // namespace v8 5842 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698