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

Side by Side Diff: test/mjsunit/regress/regress-crbug-729573-1.js

Issue 2931483003: [deoptimizer] Teach the Deoptimizer about bound functions. (Closed)
Patch Set: Add moar test covfefe Created 3 years, 6 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/deoptimizer.cc ('k') | test/mjsunit/regress/regress-crbug-729573-2.js » ('j') | 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 2017 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
6
7 (function() {
8 function foo() {
9 var a = foo.bind(this);
10 %DeoptimizeNow();
11 if (!a) return a;
12 return 0;
13 }
14
15 assertEquals(0, foo());
16 assertEquals(0, foo());
17 %OptimizeFunctionOnNextCall(foo);
18 assertEquals(0, foo());
19 })();
20
21 (function() {
22 "use strict";
23
24 function foo() {
25 var a = foo.bind(this);
26 %DeoptimizeNow();
27 if (!a) return a;
28 return 0;
29 }
30
31 assertEquals(0, foo());
32 assertEquals(0, foo());
33 %OptimizeFunctionOnNextCall(foo);
34 assertEquals(0, foo());
35 })();
36
37 (function() {
38 function foo() {
39 var a = foo.bind(this);
40 %DeoptimizeNow();
41 if (!a) return a;
42 return 0;
43 }
44 foo.prototype = {custom: "prototype"};
45
46 assertEquals(0, foo());
47 assertEquals(0, foo());
48 %OptimizeFunctionOnNextCall(foo);
49 assertEquals(0, foo());
50 })();
51
52 (function() {
53 "use strict";
54
55 function foo() {
56 var a = foo.bind(this);
57 %DeoptimizeNow();
58 if (!a) return a;
59 return 0;
60 }
61 foo.prototype = {custom: "prototype"};
62
63 assertEquals(0, foo());
64 assertEquals(0, foo());
65 %OptimizeFunctionOnNextCall(foo);
66 assertEquals(0, foo());
67 })();
OLDNEW
« no previous file with comments | « src/deoptimizer.cc ('k') | test/mjsunit/regress/regress-crbug-729573-2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698