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

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

Issue 6821009: Introduce runtime function %OptimizeFunctionOnNextCall to manually trigger optimization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/regress/regress-1210.js ('k') | test/mjsunit/regress/regress-1237.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // Check that %NewObjectFromBound looks at correct frame for inlined function. 49 // Check that %NewObjectFromBound looks at correct frame for inlined function.
50 function ff(x) { } 50 function ff(x) { }
51 function h(z2, y2) { 51 function h(z2, y2) {
52 var local_z = z2 >> 1; 52 var local_z = z2 >> 1;
53 ff(local_z); 53 ff(local_z);
54 var local_y = y2 >> 1; 54 var local_y = y2 >> 1;
55 ff(local_y); 55 ff(local_y);
56 return f(local_y, local_z); /* f should be inlined into h */ 56 return f(local_y, local_z); /* f should be inlined into h */
57 } 57 }
58 58
59 for (var i = 0; i < 100000; i++) f(2, 3); 59 for (var i = 0; i < 5; i++) f(2, 3);
60 %OptimizeFunctionOnNextCall(f);
61 f(2, 3);
60 62
61 for (var i = 0; i < 100000; i++) g(3, 2); 63 for (var i = 0; i < 5; i++) g(3, 2);
64 %OptimizeFunctionOnNextCall(g);
65 g(3, 2);
62 66
63 for (var i = 0; i < 100000; i++) h(6, 4); 67 for (var i = 0; i < 5; i++) h(6, 4);
68 %OptimizeFunctionOnNextCall(h);
69 h(6, 4);
64 70
65 // Check that %_IsConstructCall returns correct value when inlined 71 // Check that %_IsConstructCall returns correct value when inlined
66 var NON_CONSTRUCT_MARKER = {}; 72 var NON_CONSTRUCT_MARKER = {};
67 var CONSTRUCT_MARKER = {}; 73 var CONSTRUCT_MARKER = {};
68 function baz() { 74 function baz() {
69 return (!%_IsConstructCall()) ? NON_CONSTRUCT_MARKER : CONSTRUCT_MARKER; 75 return (!%_IsConstructCall()) ? NON_CONSTRUCT_MARKER : CONSTRUCT_MARKER;
70 } 76 }
71 77
72 function bar(x, y, z) { 78 function bar(x, y, z) {
73 var non_construct = baz(); /* baz should be inlined */ 79 var non_construct = baz(); /* baz should be inlined */
74 assertEquals(non_construct, NON_CONSTRUCT_MARKER); 80 assertEquals(non_construct, NON_CONSTRUCT_MARKER);
75 var construct = new baz(); 81 var construct = new baz();
76 assertEquals(construct, CONSTRUCT_MARKER); 82 assertEquals(construct, CONSTRUCT_MARKER);
77 } 83 }
78 84
79 for (var i = 0; i < 100000; i++) new bar(1, 2, 3); 85 for (var i = 0; i < 5; i++) new bar(1, 2, 3);
86 %OptimizeFunctionOnNextCall(bar);
87 bar(1, 2, 3);
OLDNEW
« no previous file with comments | « test/mjsunit/regress/regress-1210.js ('k') | test/mjsunit/regress/regress-1237.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698