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

Side by Side Diff: test/mjsunit/compiler/inline-accessors1.js

Issue 2902533003: [turbofan] Add support for inlining accessors into try-blocks. (Closed)
Patch Set: Address feedback. Created 3 years, 7 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/mjsunit/compiler/inline-accessors.js ('k') | test/mjsunit/compiler/inline-accessors2.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 class O {
9 get x() {
10 return 1;
11 }
12 }
13 var o = new O;
14
15 function foo(o) {
16 try {
17 return o.x;
18 } catch (e) {
19 return 0;
20 }
21 }
22
23 assertEquals(1, foo(o));
24 assertEquals(1, foo(o));
25 %OptimizeFunctionOnNextCall(foo);
26 assertEquals(1, foo(o));
27 })();
28
29 (function() {
30 class O {
31 get x() {
32 %DeoptimizeFunction(foo);
33 return 1;
34 }
35 }
36 var o = new O;
37
38 function foo(o) {
39 try {
40 return o.x;
41 } catch (e) {
42 return 0;
43 }
44 }
45
46 assertEquals(1, foo(o));
47 assertEquals(1, foo(o));
48 %OptimizeFunctionOnNextCall(foo);
49 assertEquals(1, foo(o));
50 })();
51
52 (function() {
53 function bar(x) {
54 throw x;
55 }
56
57 class O {
58 get x() {
59 %DeoptimizeFunction(foo);
60 return bar("x");
61 }
62 }
63 var o = new O;
64
65 function foo(o) {
66 try {
67 return o.x;
68 } catch (e) {
69 return 0;
70 }
71 }
72
73 assertEquals(0, foo(o));
74 assertEquals(0, foo(o));
75 %OptimizeFunctionOnNextCall(foo);
76 assertEquals(0, foo(o));
77 })();
OLDNEW
« no previous file with comments | « test/mjsunit/compiler/inline-accessors.js ('k') | test/mjsunit/compiler/inline-accessors2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698