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

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

Issue 2642743002: Revert [TypeFeedbackVector] Root literal arrays in function literal slots (Closed)
Patch Set: Altered test for wasm. Created 3 years, 11 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 | « test/cctest/test-feedback-vector.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 --expose-gc
6
7 // Make sure literals are strongly rooted and safe from weak-code deopts.
8
9 (function() {
10 function foo() {
11 var a = { y: 0 };
12 a.y = 1;
13 return a;
14 }
15
16 foo();
17 foo();
18 %OptimizeFunctionOnNextCall(foo);
19 foo();
20 gc();
21 assertOptimized(foo);
22 })();
23
24
25 (function() {
26 function hot(o) {
27 return o.x + o.y;
28 }
29 function mapPlus(a, y) {
30 return a.map(x => hot({x, y}));
31 }
32
33 var a = [1, 2, 3];
34 print(mapPlus(a, 1));
35 print(mapPlus(a, 2));
36 %OptimizeFunctionOnNextCall(hot);
37 print(mapPlus(a, 3));
38 gc(); // BOOOM!
39 assertOptimized(hot);
40 print(mapPlus(a, 4));
41 })();
42
43 // Verify that we can handle the creation of a new script, where the
44 // code is cached and the feedback vector has to be re-created.
45 (function() {
46 var sopen = "function wrapper() { ";
47 var s1 = "function foo() { return bar(5); } ";
48 var s2 = "foo(); foo(); %OptimizeFunctionOnNextCall(foo); foo(); ";
49 var sclose = "} wrapper(); ";
50 var s = sopen + s1 + s2 + sclose;
51 function bar(i) { return i + 3 };
52
53 for (var i = 0; i < 4; i++) {
54 eval(s);
55 }
56 })();
OLDNEW
« no previous file with comments | « test/cctest/test-feedback-vector.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698