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

Unified Diff: test/mjsunit/compiler/simple-deopt.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/compiler/regress-stacktrace-methods.js ('k') | test/mjsunit/compiler/simple-inlining.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/simple-deopt.js
diff --git a/test/mjsunit/compiler/simple-deopt.js b/test/mjsunit/compiler/simple-deopt.js
index 8befd9f6e9bb0d0fbe2a7c883bb2b55f0581df32..7f985acc7673f3213ec3e6a8008338d84f35c96e 100644
--- a/test/mjsunit/compiler/simple-deopt.js
+++ b/test/mjsunit/compiler/simple-deopt.js
@@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// Flags: --allow-natives-syntax
+
function f(x) {
return ~x;
}
@@ -59,7 +61,9 @@ obj.g = g;
function k(o) {
return o.g();
}
-for (var i = 0; i < 1000000; i++) k(obj);
+for (var i = 0; i < 5; i++) k(obj);
+%OptimizeFunctionOnNextCall(k);
+k(obj);
assertEquals(42, k(obj));
assertEquals(87, k({g: function() { return 87; }}));
@@ -88,9 +92,11 @@ assertEquals('lit[42]', LiteralToStack(42));
var str = "abc";
var r;
function CallCharAt(n) { return str.charAt(n); }
-for (var i = 0; i < 1000000; i++) {
+for (var i = 0; i < 5; i++) {
r = CallCharAt(0);
}
+%OptimizeFunctionOnNextCall(CallCharAt);
+r = CallCharAt(0);
assertEquals("a", r);
« no previous file with comments | « test/mjsunit/compiler/regress-stacktrace-methods.js ('k') | test/mjsunit/compiler/simple-inlining.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698