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

Side by Side Diff: test/mjsunit/strong-rooted-literals.js

Issue 2504153002: [TypeFeedbackVector] Root literal arrays in function literals slots (Closed)
Patch Set: REBASE. Created 3 years, 12 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
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 --expose-gc
6
7 // Make sure literals are strongly rooted and safe from weak-code deopts.
8 (function() {
9 function foo() {
10 var a = { y: 0 };
11 a.y = 1;
12 return a;
13 }
14
15 foo();
16 foo();
17 %OptimizeFunctionOnNextCall(foo);
18 foo();
19 gc();
20 assertOptimized(foo);
21 })();
22
23
24 (function() {
25 function hot(o) {
26 return o.x + o.y;
27 }
28 function mapPlus(a, y) {
29 return a.map(x => hot({x, y}));
30 }
31
32 var a = [1, 2, 3];
33 print(mapPlus(a, 1));
34 print(mapPlus(a, 2));
35 %OptimizeFunctionOnNextCall(hot);
36 print(mapPlus(a, 3));
37 gc(); // BOOOM!
38 assertOptimized(hot);
39 print(mapPlus(a, 4));
40 })();
OLDNEW
« no previous file with comments | « test/cctest/test-heap-profiler.cc ('k') | test/unittests/compiler/js-create-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698