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

Unified Diff: test/cctest/test-cpu-profiler.cc

Issue 2369043002: Remove decision by Turbofan OSR to optimize on next call (Closed)
Patch Set: fix build on mips Created 4 years, 3 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/runtime-compiler.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-cpu-profiler.cc
diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc
index 23524598fa576251351b04523a3b8bbe5b6f3b7a..6134632be205b5933360f03b04a74b03703b7265 100644
--- a/test/cctest/test-cpu-profiler.cc
+++ b/test/cctest/test-cpu-profiler.cc
@@ -1023,6 +1023,7 @@ TEST(BoundFunctionCall) {
// This tests checks distribution of the samples through the source lines.
static void TickLines(bool optimize) {
+ if (!optimize) i::FLAG_crankshaft = false;
CcTest::InitializeVM();
LocalContext env;
i::FLAG_allow_natives_syntax = true;
@@ -1032,10 +1033,13 @@ static void TickLines(bool optimize) {
i::HandleScope scope(isolate);
i::EmbeddedVector<char, 512> script;
+ i::EmbeddedVector<char, 64> optimize_call;
const char* func_name = "func";
- const char* opt_func =
- optimize ? "%OptimizeFunctionOnNextCall" : "%NeverOptimizeFunction";
+ if (optimize) {
+ i::SNPrintF(optimize_call, "%%OptimizeFunctionOnNextCall(%s);\n",
+ func_name);
+ }
i::SNPrintF(script,
"function %s() {\n"
" var n = 0;\n"
@@ -1045,10 +1049,10 @@ static void TickLines(bool optimize) {
" n += m * m * m;\n"
" }\n"
"}\n"
- "%s();"
- "%s(%s);\n"
+ "%s();\n"
+ "%s"
"%s();\n",
- func_name, func_name, opt_func, func_name, func_name);
+ func_name, func_name, optimize_call.start(), func_name);
CompileRun(script.start());
« no previous file with comments | « src/runtime/runtime-compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698