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

Side by Side Diff: test/mjsunit/fixed-context-shapes-when-recompiling.js

Issue 2388183003: PreParsing inner functions: Fix declaration-only variables. (Closed)
Patch Set: flag off Created 4 years, 2 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
« no previous file with comments | « src/parsing/preparser.cc ('k') | 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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 // Flags: --min-preparse-length 1 --allow-natives-syntax 5 // Flags: --min-preparse-length 1 --allow-natives-syntax
6 6
7 // Test that the information on which variables to allocate in context doesn't 7 // Test that the information on which variables to allocate in context doesn't
8 // change when recompiling. 8 // change when recompiling.
9 9
10 (function TestVarInInnerFunction() { 10 (function TestVarInInnerFunction() {
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 } 244 }
245 for (var i = 0; i < 3; ++i) { 245 for (var i = 0; i < 3; ++i) {
246 if (i == 1) { 246 if (i == 1) {
247 %OptimizeOsr(); 247 %OptimizeOsr();
248 } 248 }
249 assertEquals(1, a); 249 assertEquals(1, a);
250 assertEquals(2, b); 250 assertEquals(2, b);
251 assertEquals(3, c); 251 assertEquals(3, c);
252 } 252 }
253 })(); 253 })();
254
255 // A cluster of similar tests where the inner function only declares a variable
256 // whose name clashes with an outer function variable name, but doesn't use it.
257 (function TestRegress650969_1() {
258 for (var i = 0; i < 3; ++i) {
259 if (i == 1) {
260 %OptimizeOsr();
261 }
262 var a;
263 function inner() {
264 var a;
265 }
266 }
267 })();
268
269 (function TestRegress650969_2() {
270 for (var i = 0; i < 3; ++i) {
271 if (i == 1) {
272 %OptimizeOsr();
273 }
274 var a;
275 function inner() {
276 var a = 6;
277 }
278 }
279 })();
280
281 (function TestRegress650969_3() {
282 for (var i = 0; i < 3; ++i) {
283 if (i == 1) {
284 %OptimizeOsr();
285 }
286 var a;
287 function inner() {
288 var a, b;
289 }
290 }
291 })();
292
293 (function TestRegress650969_4() {
294 for (var i = 0; i < 3; ++i) {
295 if (i == 1) {
296 %OptimizeOsr();
297 }
298 var a;
299 function inner() {
300 var a = 6, b;
301 }
302 }
303 })();
304
305 (function TestRegress650969_5() {
306 for (var i = 0; i < 3; ++i) {
307 if (i == 1) {
308 %OptimizeOsr();
309 }
310 var a;
311 function inner() {
312 let a;
313 }
314 }
315 })();
316
317 (function TestRegress650969_6() {
318 for (var i = 0; i < 3; ++i) {
319 if (i == 1) {
320 %OptimizeOsr();
321 }
322 var a;
323 function inner() {
324 let a = 6;
325 }
326 }
327 })();
328
329 (function TestRegress650969_7() {
330 for (var i = 0; i < 3; ++i) {
331 if (i == 1) {
332 %OptimizeOsr();
333 }
334 var a;
335 function inner() {
336 let a, b;
337 }
338 }
339 })();
340
341 (function TestRegress650969_8() {
342 for (var i = 0; i < 3; ++i) {
343 if (i == 1) {
344 %OptimizeOsr();
345 }
346 var a;
347 function inner() {
348 let a = 6, b;
349 }
350 }
351 })();
352
353 (function TestRegress650969_9() {
354 for (var i = 0; i < 3; ++i) {
355 if (i == 1) {
356 %OptimizeOsr();
357 }
358 var a;
359 function inner(a) {
360 }
361 }
362 })();
OLDNEW
« no previous file with comments | « src/parsing/preparser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698