OLD | NEW |
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 // TODO(rmcilroy): Remove this define after this flag is turned on globally | 5 // TODO(rmcilroy): Remove this define after this flag is turned on globally |
6 #define V8_IMMINENT_DEPRECATION_WARNINGS | 6 #define V8_IMMINENT_DEPRECATION_WARNINGS |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 {"function f(a) { \"use strict\"; return a.name; }\nf({name : \"test\"})", | 905 {"function f(a) { \"use strict\"; return a.name; }\nf({name : \"test\"})", |
906 0, | 906 0, |
907 2, | 907 2, |
908 5, | 908 5, |
909 { | 909 { |
910 B(LoadICStrict), A(1, 2), U8(0), U8(vector->GetIndex(slot1)), // | 910 B(LoadICStrict), A(1, 2), U8(0), U8(vector->GetIndex(slot1)), // |
911 B(Return), // | 911 B(Return), // |
912 }, | 912 }, |
913 1, | 913 1, |
914 {"name"}}, | 914 {"name"}}, |
915 { | 915 {"function f(a, b) { \"use strict\"; return a[b]; }\n" |
916 "function f(a, b) { \"use strict\"; return a[b]; }\n" | 916 "f({arg : \"test\"}, \"arg\")", |
917 "f({arg : \"test\"}, \"arg\")", | 917 0, |
918 0, | 918 3, |
919 3, | 919 6, |
920 6, | 920 { |
921 { | 921 B(Ldar), A(2, 3), // |
922 B(Ldar), A(2, 3), // | 922 B(KeyedLoadICStrict), A(1, 3), U8(vector->GetIndex(slot1)), // |
923 B(KeyedLoadICStrict), A(1, 3), U8(vector->GetIndex(slot1)), // | 923 B(Return), // |
924 B(Return), // | 924 }, |
925 }, | 925 0}, |
926 0}, | 926 {"function f(a) {\n" |
927 { | 927 " var b;\n" REPEAT_127(SPACE, " b = a.name; ") " return a.name; }\n" |
928 "function f(a) {\n" | 928 "f({name : \"test\"})\n", |
929 " var b;\n" | 929 1 * kPointerSize, |
930 REPEAT_127(SPACE, " b = a.name; ") | 930 2, |
931 " return a.name; }\n" | 931 767, |
932 "f({name : \"test\"})\n", | 932 { |
933 1 * kPointerSize, | 933 REPEAT_127(COMMA, // |
934 2, | 934 B(LoadICSloppy), A(1, 2), U8(0), |
935 769, | 935 U8((wide_idx_1 += 2)), // |
936 { | 936 B(Star), R(0)), // |
937 REPEAT_127(COMMA, // | 937 B(LoadICSloppy), |
938 B(LoadICSloppy), A(1, 2), U8(0), U8((wide_idx_1 += 2)), // | 938 A(1, 2), U8(0), U8(wide_idx_1 + 2), // |
939 B(Star), R(0)), // | 939 B(Return), // |
940 B(LoadICSloppyWide), A(1, 2), U16(0), U16(wide_idx_1 + 2), // | 940 }, |
941 B(Return), // | 941 1, |
942 }, | 942 {"name"}}, |
943 1, | 943 {"function f(a) {\n" |
944 {"name"}}, | 944 " 'use strict'; var b;\n" REPEAT_127( |
945 { | 945 SPACE, " b = a.name; ") " return a.name; }\n" |
946 "function f(a) {\n" | 946 "f({name : \"test\"})\n", |
947 " 'use strict'; var b;\n" | 947 1 * kPointerSize, |
948 REPEAT_127(SPACE, " b = a.name; ") | 948 2, |
949 " return a.name; }\n" | 949 767, |
950 "f({name : \"test\"})\n", | 950 { |
951 1 * kPointerSize, | 951 REPEAT_127(COMMA, // |
952 2, | 952 B(LoadICStrict), A(1, 2), U8(0), |
953 769, | 953 U8((wide_idx_2 += 2)), // |
954 { | 954 B(Star), R(0)), // |
955 REPEAT_127(COMMA, // | 955 B(LoadICStrict), |
956 B(LoadICStrict), A(1, 2), U8(0), U8((wide_idx_2 += 2)), // | 956 A(1, 2), U8(0), U8(wide_idx_2 + 2), // |
957 B(Star), R(0)), // | 957 B(Return), // |
958 B(LoadICStrictWide), A(1, 2), U16(0), U16(wide_idx_2 + 2), // | 958 }, |
959 B(Return), // | 959 1, |
960 }, | 960 {"name"}}, |
961 1, | 961 {"function f(a, b) {\n" |
962 {"name"}}, | 962 " var c;\n" REPEAT_127(SPACE, |
963 { | 963 " c = a[b]; ") " return a[b]; }\n" |
964 "function f(a, b) {\n" | 964 "f({name : \"test\"}, \"name\")\n", |
965 " var c;\n" | 965 1 * kPointerSize, |
966 REPEAT_127(SPACE, " c = a[b]; ") | 966 3, |
967 " return a[b]; }\n" | 967 895, |
968 "f({name : \"test\"}, \"name\")\n", | 968 { |
969 1 * kPointerSize, | 969 REPEAT_127(COMMA, // |
970 3, | 970 B(Ldar), A(2, 3), // |
971 896, | 971 B(KeyedLoadICSloppy), A(1, 3), U8((wide_idx_3 += 2)), // |
972 { | 972 B(Star), R(0)), // |
973 REPEAT_127(COMMA, // | 973 B(Ldar), |
974 B(Ldar), A(2, 3), // | 974 A(2, 3), // |
975 B(KeyedLoadICSloppy), A(1, 3), U8((wide_idx_3 += 2)), // | 975 B(KeyedLoadICSloppy), A(1, 3), U8(wide_idx_3 + 2), // |
976 B(Star), R(0)), // | 976 B(Return), // |
977 B(Ldar), A(2, 3), // | 977 }}, |
978 B(KeyedLoadICSloppyWide), A(1, 3), U16(wide_idx_3 + 2), // | 978 {"function f(a, b) {\n" |
979 B(Return), // | 979 " 'use strict'; var c;\n" REPEAT_127( |
980 }}, | 980 SPACE, " c = a[b]; ") " return a[b]; }\n" |
981 { | 981 "f({name : \"test\"}, \"name\")\n", |
982 "function f(a, b) {\n" | 982 1 * kPointerSize, |
983 " 'use strict'; var c;\n" | 983 3, |
984 REPEAT_127(SPACE, " c = a[b]; ") | 984 895, |
985 " return a[b]; }\n" | 985 { |
986 "f({name : \"test\"}, \"name\")\n", | 986 REPEAT_127(COMMA, // |
987 1 * kPointerSize, | 987 B(Ldar), A(2, 3), // |
988 3, | 988 B(KeyedLoadICStrict), A(1, 3), U8((wide_idx_4 += 2)), // |
989 896, | 989 B(Star), R(0)), // |
990 { | 990 B(Ldar), |
991 REPEAT_127(COMMA, // | 991 A(2, 3), // |
992 B(Ldar), A(2, 3), // | 992 B(KeyedLoadICStrict), A(1, 3), U8(wide_idx_4 + 2), // |
993 B(KeyedLoadICStrict), A(1, 3), U8((wide_idx_4 += 2)), // | 993 B(Return), // |
994 B(Star), R(0)), // | 994 }}, |
995 B(Ldar), A(2, 3), // | 995 }; |
996 B(KeyedLoadICStrictWide), A(1, 3), U16(wide_idx_4 + 2), // | |
997 B(Return), // | |
998 }}, | |
999 }; | |
1000 for (size_t i = 0; i < arraysize(snippets); i++) { | 996 for (size_t i = 0; i < arraysize(snippets); i++) { |
1001 Handle<BytecodeArray> bytecode_array = | 997 Handle<BytecodeArray> bytecode_array = |
1002 helper.MakeBytecode(snippets[i].code_snippet, helper.kFunctionName); | 998 helper.MakeBytecode(snippets[i].code_snippet, helper.kFunctionName); |
1003 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 999 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
1004 } | 1000 } |
1005 } | 1001 } |
1006 | 1002 |
1007 | 1003 |
1008 TEST(PropertyStores) { | 1004 TEST(PropertyStores) { |
1009 InitializedHandleScope handle_scope; | 1005 InitializedHandleScope handle_scope; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 B(LdaUndefined), // | 1042 B(LdaUndefined), // |
1047 B(Return), // | 1043 B(Return), // |
1048 }, | 1044 }, |
1049 2, | 1045 2, |
1050 {"key", "val"}}, | 1046 {"key", "val"}}, |
1051 {"function f(a) { a[100] = \"val\"; }\nf({100 : \"test\"})", | 1047 {"function f(a) { a[100] = \"val\"; }\nf({100 : \"test\"})", |
1052 kPointerSize, | 1048 kPointerSize, |
1053 2, | 1049 2, |
1054 12, | 1050 12, |
1055 { | 1051 { |
1056 B(LdaSmi8), U8(100), // | 1052 B(LdaSmi8), U8(100), // |
1057 B(Star), R(0), // | 1053 B(Star), R(0), // |
1058 B(LdaConstant), U8(0), // | 1054 B(LdaConstant), U8(0), // |
1059 B(KeyedStoreICSloppy), A(1, 2), R(0), // | 1055 B(KeyedStoreICSloppy), A(1, 2), R(0), // |
1060 U8(vector->GetIndex(slot1)), // | 1056 U8(vector->GetIndex(slot1)), // |
1061 B(LdaUndefined), // | 1057 B(LdaUndefined), // |
1062 B(Return), // | 1058 B(Return), // |
1063 }, | 1059 }, |
1064 1, | 1060 1, |
1065 {"val"}}, | 1061 {"val"}}, |
1066 {"function f(a, b) { a[b] = \"val\"; }\nf({arg : \"test\"}, \"arg\")", | 1062 {"function f(a, b) { a[b] = \"val\"; }\nf({arg : \"test\"}, \"arg\")", |
1067 0, | 1063 0, |
1068 3, | 1064 3, |
1069 8, | 1065 8, |
1070 { | 1066 { |
1071 B(LdaConstant), U8(0), // | 1067 B(LdaConstant), U8(0), // |
1072 B(KeyedStoreICSloppy), A(1, 3), A(2, 3), // | 1068 B(KeyedStoreICSloppy), A(1, 3), A(2, 3), // |
1073 U8(vector->GetIndex(slot1)), // | 1069 U8(vector->GetIndex(slot1)), // |
1074 B(LdaUndefined), // | 1070 B(LdaUndefined), // |
1075 B(Return), // | 1071 B(Return), // |
1076 }, | 1072 }, |
1077 1, | 1073 1, |
1078 {"val"}}, | 1074 {"val"}}, |
1079 {"function f(a) { a.name = a[-124]; }\n" | 1075 {"function f(a) { a.name = a[-124]; }\n" |
1080 "f({\"-124\" : \"test\", name : 123 })", | 1076 "f({\"-124\" : \"test\", name : 123 })", |
1081 0, | 1077 0, |
1082 2, | 1078 2, |
1083 11, | 1079 11, |
1084 { | 1080 { |
1085 B(LdaSmi8), U8(-124), // | 1081 B(LdaSmi8), U8(-124), // |
(...skipping 16 matching lines...) Expand all Loading... |
1102 B(Return), // | 1098 B(Return), // |
1103 }, | 1099 }, |
1104 2, | 1100 2, |
1105 {"name", "val"}}, | 1101 {"name", "val"}}, |
1106 {"function f(a, b) { \"use strict\"; a[b] = \"val\"; }\n" | 1102 {"function f(a, b) { \"use strict\"; a[b] = \"val\"; }\n" |
1107 "f({arg : \"test\"}, \"arg\")", | 1103 "f({arg : \"test\"}, \"arg\")", |
1108 0, | 1104 0, |
1109 3, | 1105 3, |
1110 8, | 1106 8, |
1111 { | 1107 { |
1112 B(LdaConstant), U8(0), // | 1108 B(LdaConstant), U8(0), // |
1113 B(KeyedStoreICStrict), A(1, 3), A(2, 3), // | 1109 B(KeyedStoreICStrict), A(1, 3), A(2, 3), // |
1114 U8(vector->GetIndex(slot1)), // | 1110 U8(vector->GetIndex(slot1)), // |
1115 B(LdaUndefined), // | 1111 B(LdaUndefined), // |
1116 B(Return), // | 1112 B(Return), // |
1117 }, | 1113 }, |
1118 1, | 1114 1, |
1119 {"val"}}, | 1115 {"val"}}, |
1120 {"function f(a) {\n" | 1116 {"function f(a) {\n" REPEAT_127(SPACE, |
1121 REPEAT_127(SPACE, " a.name = 1; ") | 1117 " a.name = 1; ") " a.name = 2; }\n" |
1122 " a.name = 2; }\n" | 1118 "f({name : \"test\"})\n", |
1123 "f({name : \"test\"})\n", | |
1124 0, | 1119 0, |
1125 2, | 1120 2, |
1126 772, | 1121 770, |
1127 { | 1122 { |
1128 REPEAT_127(COMMA, // | 1123 REPEAT_127(COMMA, // |
1129 B(LdaSmi8), U8(1), // | 1124 B(LdaSmi8), U8(1), // |
1130 B(StoreICSloppy), A(1, 2), U8(0), U8((wide_idx_1 += 2))), // | 1125 B(StoreICSloppy), A(1, 2), U8(0), |
1131 B(LdaSmi8), U8(2), // | 1126 U8((wide_idx_1 += 2))), // |
1132 B(StoreICSloppyWide), A(1, 2), U16(0), U16(wide_idx_1 + 2), // | 1127 B(LdaSmi8), |
1133 B(LdaUndefined), // | 1128 U8(2), // |
1134 B(Return), // | 1129 B(StoreICSloppy), A(1, 2), U8(0), U8(wide_idx_1 + 2), // |
| 1130 B(LdaUndefined), // |
| 1131 B(Return), // |
1135 }, | 1132 }, |
1136 1, | 1133 1, |
1137 {"name"}}, | 1134 {"name"}}, |
1138 {"function f(a) {\n" | 1135 {"function f(a) {\n" |
1139 "'use strict';\n" | 1136 "'use strict';\n" REPEAT_127(SPACE, |
1140 REPEAT_127(SPACE, " a.name = 1; ") | 1137 " a.name = 1; ") " a.name = 2; }\n" |
1141 " a.name = 2; }\n" | 1138 "f({name : \"test\"})\n", |
1142 "f({name : \"test\"})\n", | |
1143 0, | 1139 0, |
1144 2, | 1140 2, |
1145 772, | 1141 770, |
1146 { | 1142 { |
1147 REPEAT_127(COMMA, // | 1143 REPEAT_127(COMMA, // |
1148 B(LdaSmi8), U8(1), // | 1144 B(LdaSmi8), U8(1), // |
1149 B(StoreICStrict), A(1, 2), U8(0), U8((wide_idx_2 += 2))), // | 1145 B(StoreICStrict), A(1, 2), U8(0), |
1150 B(LdaSmi8), U8(2), // | 1146 U8((wide_idx_2 += 2))), // |
1151 B(StoreICStrictWide), A(1, 2), U16(0), U16(wide_idx_2 + 2), // | 1147 B(LdaSmi8), |
1152 B(LdaUndefined), // | 1148 U8(2), // |
1153 B(Return), // | 1149 B(StoreICStrict), A(1, 2), U8(0), U8(wide_idx_2 + 2), // |
| 1150 B(LdaUndefined), // |
| 1151 B(Return), // |
1154 }, | 1152 }, |
1155 1, | 1153 1, |
1156 {"name"}}, | 1154 {"name"}}, |
1157 {"function f(a, b) {\n" | 1155 {"function f(a, b) {\n" REPEAT_127( |
1158 REPEAT_127(SPACE, " a[b] = 1; ") | 1156 SPACE, " a[b] = 1; ") " a[b] = 2; }\n" |
1159 " a[b] = 2; }\n" | 1157 "f({name : \"test\"})\n", |
1160 "f({name : \"test\"})\n", | |
1161 0, | 1158 0, |
1162 3, | 1159 3, |
1163 771, | 1160 770, |
1164 { | 1161 { |
1165 REPEAT_127(COMMA, // | 1162 REPEAT_127(COMMA, // |
1166 B(LdaSmi8), U8(1), // | 1163 B(LdaSmi8), U8(1), // |
1167 B(KeyedStoreICSloppy), A(1, 3), A(2, 3), // | 1164 B(KeyedStoreICSloppy), A(1, 3), A(2, 3), // |
1168 U8((wide_idx_3 += 2))), // | 1165 U8((wide_idx_3 += 2))), // |
1169 B(LdaSmi8), U8(2), // | 1166 B(LdaSmi8), |
1170 B(KeyedStoreICSloppyWide), A(1, 3), A(2, 3), // | 1167 U8(2), // |
1171 U16(wide_idx_3 + 2), // | 1168 B(KeyedStoreICSloppy), A(1, 3), A(2, 3), // |
1172 B(LdaUndefined), // | 1169 U8(wide_idx_3 + 2), // |
1173 B(Return), // | 1170 B(LdaUndefined), // |
| 1171 B(Return), // |
1174 }}, | 1172 }}, |
1175 {"function f(a, b) {\n" | 1173 {"function f(a, b) {\n" |
1176 "'use strict';\n" | 1174 "'use strict';\n" REPEAT_127(SPACE, |
1177 REPEAT_127(SPACE, " a[b] = 1; ") | 1175 " a[b] = 1; ") " a[b] = 2; }\n" |
1178 " a[b] = 2; }\n" | 1176 "f({name : \"test\"})\n", |
1179 "f({name : \"test\"})\n", | |
1180 0, | 1177 0, |
1181 3, | 1178 3, |
1182 771, | 1179 770, |
1183 { | 1180 { |
1184 REPEAT_127(COMMA, // | 1181 REPEAT_127(COMMA, // |
1185 B(LdaSmi8), U8(1), // | 1182 B(LdaSmi8), U8(1), // |
1186 B(KeyedStoreICStrict), A(1, 3), A(2, 3), // | 1183 B(KeyedStoreICStrict), A(1, 3), A(2, 3), // |
1187 U8((wide_idx_4 += 2))), // | 1184 U8((wide_idx_4 += 2))), // |
1188 B(LdaSmi8), U8(2), // | 1185 B(LdaSmi8), |
1189 B(KeyedStoreICStrictWide), A(1, 3), A(2, 3), // | 1186 U8(2), // |
1190 U16(wide_idx_4 + 2), // | 1187 B(KeyedStoreICStrict), A(1, 3), A(2, 3), // |
1191 B(LdaUndefined), // | 1188 U8(wide_idx_4 + 2), // |
1192 B(Return), // | 1189 B(LdaUndefined), // |
| 1190 B(Return), // |
1193 }}}; | 1191 }}}; |
1194 for (size_t i = 0; i < arraysize(snippets); i++) { | 1192 for (size_t i = 0; i < arraysize(snippets); i++) { |
1195 Handle<BytecodeArray> bytecode_array = | 1193 Handle<BytecodeArray> bytecode_array = |
1196 helper.MakeBytecode(snippets[i].code_snippet, helper.kFunctionName); | 1194 helper.MakeBytecode(snippets[i].code_snippet, helper.kFunctionName); |
1197 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 1195 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
1198 } | 1196 } |
1199 } | 1197 } |
1200 | 1198 |
1201 | 1199 |
1202 #define FUNC_ARG "new (function Obj() { this.func = function() { return; }})()" | 1200 #define FUNC_ARG "new (function Obj() { this.func = function() { return; }})()" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 B(Ldar), A(2, 3), // | 1261 B(Ldar), A(2, 3), // |
1264 B(Add), A(2, 3), // | 1262 B(Add), A(2, 3), // |
1265 B(Star), R(2), // | 1263 B(Star), R(2), // |
1266 B(Ldar), A(2, 3), // | 1264 B(Ldar), A(2, 3), // |
1267 B(Star), R(3), // | 1265 B(Star), R(3), // |
1268 B(Call), R(0), R(1), U8(2), U8(vector->GetIndex(slot1)), // | 1266 B(Call), R(0), R(1), U8(2), U8(vector->GetIndex(slot1)), // |
1269 B(Return), // | 1267 B(Return), // |
1270 }, | 1268 }, |
1271 1, | 1269 1, |
1272 {"func"}}, | 1270 {"func"}}, |
1273 {"function f(a) {\n" | 1271 {"function f(a) {\n" REPEAT_127( |
1274 REPEAT_127(SPACE, " a.func;\n") | 1272 SPACE, " a.func;\n") " return a.func(); }\nf(" FUNC_ARG ")", |
1275 " return a.func(); }\nf(" FUNC_ARG ")", | |
1276 2 * kPointerSize, | 1273 2 * kPointerSize, |
1277 2, | 1274 2, |
1278 528, | 1275 526, |
1279 { | 1276 { |
1280 REPEAT_127(COMMA, // | 1277 REPEAT_127(COMMA, // |
1281 B(LoadICSloppy), A(1, 2), U8(0), U8((wide_idx += 2))), // | 1278 B(LoadICSloppy), A(1, 2), U8(0), U8((wide_idx += 2))), // |
1282 B(Ldar), A(1, 2), // | 1279 B(Ldar), |
1283 B(Star), R(1), // | 1280 A(1, 2), // |
1284 B(LoadICSloppyWide), R(1), U16(0), U16(wide_idx + 4), // | 1281 B(Star), R(1), // |
1285 B(Star), R(0), // | 1282 B(LoadICSloppyWide), R(1), U16(0), U16(wide_idx + 4), // |
1286 B(CallWide), R(0), R(1), U16(0), U16(wide_idx + 2), // | 1283 B(Star), R(0), // |
1287 B(Return), // | 1284 B(Call), R(0), R(1), U8(0), U8(wide_idx + 2), // |
| 1285 B(Return), // |
1288 }, | 1286 }, |
1289 1, | 1287 1, |
1290 {"func"}}, | 1288 {"func"}}, |
1291 }; | 1289 }; |
1292 for (size_t i = 0; i < arraysize(snippets); i++) { | 1290 for (size_t i = 0; i < arraysize(snippets); i++) { |
1293 Handle<BytecodeArray> bytecode_array = | 1291 Handle<BytecodeArray> bytecode_array = |
1294 helper.MakeBytecode(snippets[i].code_snippet, helper.kFunctionName); | 1292 helper.MakeBytecode(snippets[i].code_snippet, helper.kFunctionName); |
1295 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 1293 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
1296 } | 1294 } |
1297 } | 1295 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1346 {"a = 1;\nfunction f() { return a; }\nf()", | 1344 {"a = 1;\nfunction f() { return a; }\nf()", |
1347 0, | 1345 0, |
1348 1, | 1346 1, |
1349 4, | 1347 4, |
1350 { | 1348 { |
1351 B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot)), // | 1349 B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot)), // |
1352 B(Return) // | 1350 B(Return) // |
1353 }, | 1351 }, |
1354 1, | 1352 1, |
1355 {"a"}}, | 1353 {"a"}}, |
1356 {"a = 1; function f(b) {\n" | 1354 {"a = 1; function f(b) {\n" REPEAT_127( |
1357 REPEAT_127(SPACE, "b.name; ") | 1355 SPACE, "b.name; ") " return a; }\nf({name: 1});", |
1358 " return a; }\nf({name: 1});", | |
1359 0, | 1356 0, |
1360 2, | 1357 2, |
1361 514, | 1358 512, |
1362 { | 1359 { |
1363 REPEAT_127(COMMA, // | 1360 REPEAT_127(COMMA, // |
1364 B(LoadICSloppy), A(1, 2), U8(0), U8(wide_idx_1 += 2)), // | 1361 B(LoadICSloppy), A(1, 2), U8(0), U8(wide_idx_1 += 2)), // |
1365 B(LdaGlobalSloppyWide), U16(1), U16(wide_idx_1 + 2), // | 1362 B(LdaGlobalSloppy), |
1366 B(Return), // | 1363 U8(1), U8(wide_idx_1 + 2), // |
| 1364 B(Return), // |
1367 }, | 1365 }, |
1368 2, | 1366 2, |
1369 {"name", "a"}}, | 1367 {"name", "a"}}, |
1370 {"a = 1; function f(b) {\n" | 1368 {"a = 1; function f(b) {\n" |
1371 " 'use strict';\n" | 1369 " 'use strict';\n" REPEAT_127(SPACE, |
1372 REPEAT_127(SPACE, "b.name; ") | 1370 "b.name; ") " return a; }\nf({name: 1});", |
1373 " return a; }\nf({name: 1});", | |
1374 0, | 1371 0, |
1375 2, | 1372 2, |
1376 514, | 1373 512, |
1377 { | 1374 { |
1378 REPEAT_127(COMMA, // | 1375 REPEAT_127(COMMA, // |
1379 B(LoadICStrict), A(1, 2), U8(0), U8(wide_idx_2 += 2)), // | 1376 B(LoadICStrict), A(1, 2), U8(0), U8(wide_idx_2 += 2)), // |
1380 B(LdaGlobalStrictWide), U16(1), U16(wide_idx_2 + 2), // | 1377 B(LdaGlobalStrict), |
1381 B(Return), // | 1378 U8(1), U8(wide_idx_2 + 2), // |
| 1379 B(Return), // |
1382 }, | 1380 }, |
1383 2, | 1381 2, |
1384 {"name", "a"}}, | 1382 {"name", "a"}}, |
1385 }; | 1383 }; |
1386 | 1384 |
1387 for (size_t i = 0; i < arraysize(snippets); i++) { | 1385 for (size_t i = 0; i < arraysize(snippets); i++) { |
1388 Handle<BytecodeArray> bytecode_array = | 1386 Handle<BytecodeArray> bytecode_array = |
1389 helper.MakeBytecode(snippets[i].code_snippet, "f"); | 1387 helper.MakeBytecode(snippets[i].code_snippet, "f"); |
1390 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 1388 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
1391 } | 1389 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 1, | 1447 1, |
1450 7, | 1448 7, |
1451 { | 1449 { |
1452 B(LdaSmi8), U8(2), // | 1450 B(LdaSmi8), U8(2), // |
1453 B(StaGlobalSloppy), U8(0), U8(vector->GetIndex(slot)), // | 1451 B(StaGlobalSloppy), U8(0), U8(vector->GetIndex(slot)), // |
1454 B(LdaUndefined), // | 1452 B(LdaUndefined), // |
1455 B(Return) // | 1453 B(Return) // |
1456 }, | 1454 }, |
1457 1, | 1455 1, |
1458 {"a"}}, | 1456 {"a"}}, |
1459 {"a = 1; function f(b) {\n" | 1457 {"a = 1; function f(b) {\n" REPEAT_127( |
1460 REPEAT_127(SPACE, "b.name; ") | 1458 SPACE, "b.name; ") " a = 2; }\nf({name: 1});", |
1461 " a = 2; }\nf({name: 1});", | |
1462 0, | 1459 0, |
1463 2, | 1460 2, |
1464 517, | 1461 515, |
1465 { | 1462 { |
1466 REPEAT_127(COMMA, // | 1463 REPEAT_127(COMMA, // |
1467 B(LoadICSloppy), A(1, 2), U8(0), U8(wide_idx_1 += 2)), // | 1464 B(LoadICSloppy), A(1, 2), U8(0), U8(wide_idx_1 += 2)), // |
1468 B(LdaSmi8), U8(2), // | 1465 B(LdaSmi8), |
1469 B(StaGlobalSloppyWide), U16(1), U16(wide_idx_1 + 2), // | 1466 U8(2), // |
1470 B(LdaUndefined), // | 1467 B(StaGlobalSloppy), U8(1), U8(wide_idx_1 + 2), // |
1471 B(Return), // | 1468 B(LdaUndefined), // |
| 1469 B(Return), // |
1472 }, | 1470 }, |
1473 2, | 1471 2, |
1474 {"name", "a"}}, | 1472 {"name", "a"}}, |
1475 {"a = 1; function f(b) {\n" | 1473 {"a = 1; function f(b) {\n" |
1476 " 'use strict';\n" | 1474 " 'use strict';\n" REPEAT_127(SPACE, |
1477 REPEAT_127(SPACE, "b.name; ") | 1475 "b.name; ") " a = 2; }\nf({name: 1});", |
1478 " a = 2; }\nf({name: 1});", | |
1479 0, | 1476 0, |
1480 2, | 1477 2, |
1481 517, | 1478 515, |
1482 { | 1479 { |
1483 REPEAT_127(COMMA, // | 1480 REPEAT_127(COMMA, // |
1484 B(LoadICStrict), A(1, 2), U8(0), U8(wide_idx_2 += 2)), // | 1481 B(LoadICStrict), A(1, 2), U8(0), U8(wide_idx_2 += 2)), // |
1485 B(LdaSmi8), U8(2), // | 1482 B(LdaSmi8), |
1486 B(StaGlobalStrictWide), U16(1), U16(wide_idx_2 + 2), // | 1483 U8(2), // |
1487 B(LdaUndefined), // | 1484 B(StaGlobalStrict), U8(1), U8(wide_idx_2 + 2), // |
1488 B(Return), // | 1485 B(LdaUndefined), // |
| 1486 B(Return), // |
1489 }, | 1487 }, |
1490 2, | 1488 2, |
1491 {"name", "a"}}, | 1489 {"name", "a"}}, |
1492 }; | 1490 }; |
1493 | 1491 |
1494 for (size_t i = 0; i < arraysize(snippets); i++) { | 1492 for (size_t i = 0; i < arraysize(snippets); i++) { |
1495 Handle<BytecodeArray> bytecode_array = | 1493 Handle<BytecodeArray> bytecode_array = |
1496 helper.MakeBytecode(snippets[i].code_snippet, "f"); | 1494 helper.MakeBytecode(snippets[i].code_snippet, "f"); |
1497 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 1495 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
1498 } | 1496 } |
(...skipping 1893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3392 B(Star), R(2), // | 3390 B(Star), R(2), // |
3393 B(CallRuntime), U16(Runtime::kDeclareGlobals), R(1), U8(2), // | 3391 B(CallRuntime), U16(Runtime::kDeclareGlobals), R(1), U8(2), // |
3394 B(LdaConstant), U8(1), // | 3392 B(LdaConstant), U8(1), // |
3395 B(Star), R(1), // | 3393 B(Star), R(1), // |
3396 B(LdaZero), // | 3394 B(LdaZero), // |
3397 B(Star), R(2), // | 3395 B(Star), R(2), // |
3398 B(LdaConstant), U8(2), // | 3396 B(LdaConstant), U8(2), // |
3399 B(CreateObjectLiteral), U8(0), U8(has_function_flags), // | 3397 B(CreateObjectLiteral), U8(0), U8(has_function_flags), // |
3400 B(Star), R(4), // | 3398 B(Star), R(4), // |
3401 B(CreateClosure), U8(4), U8(1), // | 3399 B(CreateClosure), U8(4), U8(1), // |
3402 B(StoreICSloppy), R(4), U8(3), U8(5), // | 3400 B(StoreICSloppy), R(4), U8(3), U8(3), // |
3403 B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1), // | 3401 B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1), // |
3404 B(Ldar), R(4), // | 3402 B(Ldar), R(4), // |
3405 B(Star), R(3), // | 3403 B(Star), R(3), // |
3406 B(CallRuntime), U16(Runtime::kInitializeVarGlobal), R(1), U8(3), // | 3404 B(CallRuntime), U16(Runtime::kInitializeVarGlobal), R(1), U8(3), // |
3407 B(LdaUndefined), // | 3405 B(LdaUndefined), // |
3408 B(Return), // | 3406 B(Return), // |
3409 }, | 3407 }, |
3410 5, | 3408 5, |
3411 {InstanceType::FIXED_ARRAY_TYPE, | 3409 {InstanceType::FIXED_ARRAY_TYPE, |
3412 InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE, | 3410 InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE, |
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5460 for (size_t i = 0; i < arraysize(snippets); i++) { | 5458 for (size_t i = 0; i < arraysize(snippets); i++) { |
5461 Handle<BytecodeArray> bytecode_array = | 5459 Handle<BytecodeArray> bytecode_array = |
5462 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); | 5460 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); |
5463 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 5461 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
5464 } | 5462 } |
5465 } | 5463 } |
5466 | 5464 |
5467 } // namespace interpreter | 5465 } // namespace interpreter |
5468 } // namespace internal | 5466 } // namespace internal |
5469 } // namespace v8 | 5467 } // namespace v8 |
OLD | NEW |