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

Side by Side Diff: test/mjsunit/regress/regress-5205.js

Issue 2158443002: [turbofan] Fix deopt point for [[ToObject]] lazy bailout. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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/full-codegen/full-codegen.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
(Empty)
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
3 // found in the LICENSE file.
4
5 // Flags: --allow-natives-syntax --gc-global
6
7 (function TestGCDuringToObjectForWith() {
8 function f(o) {
9 if (o == 'warmup') { return g() }
10 with (o) { return x }
11 }
12 function g() {
13 // Only a marker function serving as weak embedded object.
14 }
15
16 // Warm up 'f' so that weak embedded object 'g' will be used.
17 f('warmup');
18 f('warmup');
19 g = null;
20
21 // Test that 'f' behaves correctly unoptimized.
22 assertEquals(23, f({ x:23 }));
23 assertEquals(42, f({ x:42 }));
24
25 // Test that 'f' behaves correctly optimized.
26 %OptimizeFunctionOnNextCall(f);
27 assertEquals(65, f({ x:65 }));
28
29 // Test that 'f' behaves correctly on numbers.
30 Number.prototype.x = 99;
31 assertEquals(99, f(0));
32
33 // Make sure the next [[ToObject]] allocation triggers GC. This in turn will
34 // deoptimize 'f' because it has the weak embedded object 'g' in the code.
35 %SetAllocationTimeout(1000, 1, false);
36 assertEquals(99, f(0));
37 })();
OLDNEW
« no previous file with comments | « src/full-codegen/full-codegen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698