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

Unified Diff: test/cctest/test-deoptimization.cc

Issue 159783002: Re-optimize faster after making a pretenuring decision. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime-profiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-deoptimization.cc
diff --git a/test/cctest/test-deoptimization.cc b/test/cctest/test-deoptimization.cc
index dbbb3edb097d4fc7fc202b93c51611993778e926..05728a58b7e8ec022718085aea8facd358018883 100644
--- a/test/cctest/test-deoptimization.cc
+++ b/test/cctest/test-deoptimization.cc
@@ -695,3 +695,27 @@ TEST(DeoptimizeLoadICStoreICNested) {
CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value());
}
+
+
+TEST(ReoptimizeInstantly) {
+ i::FLAG_allow_natives_syntax = true;
+ i::FLAG_concurrent_recompilation = false;
+ if (!CcTest::i_isolate()->use_crankshaft()) return;
+ LocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+
+ CompileRun(
+ "function f(x) {"
+ " return x;"
+ "};"
+ "f(0); f(0); f(0);"
+ "%OptimizeFunctionOnNextCall(f);"
+ "f(0);");
+ Handle<JSFunction> function = GetJSFunction(env->Global(), "f");
+ CHECK(function->IsOptimized());
+ function->code()->set_marked_for_instant_optimization(true);
+ CompileRun("%DeoptimizeFunction(f);");
+ CHECK(!function->IsOptimized());
+ CompileRun("f(0);");
+ CHECK(function->IsOptimized());
+}
« no previous file with comments | « src/runtime-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698