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

Unified Diff: src/runtime.cc

Issue 19807002: Turn on parallel recompilation for tests that assert optimization status. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix small details. no logic change. Created 7 years, 5 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.h ('k') | test/mjsunit/allocation-site-info.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 4c8e6a41874b6c6fdc7886ec4fb3ad5744028ca2..47d5989903be26b16853b6bda953327f3cf48528 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -8441,15 +8441,21 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NeverOptimizeFunction) {
}
-RUNTIME_FUNCTION(MaybeObject*, Runtime_CompleteOptimization) {
+RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) {
HandleScope scope(isolate);
- ASSERT(args.length() == 1);
+ RUNTIME_ASSERT(args.length() == 1 || args.length() == 2);
+ if (!V8::UseCrankshaft()) {
+ return Smi::FromInt(4); // 4 == "never".
+ }
+ bool sync_with_compiler_thread = true;
+ if (args.length() == 2) {
+ CONVERT_ARG_HANDLE_CHECKED(String, sync, 1);
+ if (sync->IsOneByteEqualTo(STATIC_ASCII_VECTOR("no sync"))) {
+ sync_with_compiler_thread = false;
+ }
+ }
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
- if (FLAG_parallel_recompilation && V8::UseCrankshaft()) {
- // While function is in optimization pipeline, it is marked accordingly.
- // Note that if the debugger is activated during parallel recompilation,
- // the function will be marked with the lazy-recompile builtin, which is
- // not related to parallel recompilation.
+ if (FLAG_parallel_recompilation && sync_with_compiler_thread) {
while (function->IsMarkedForParallelRecompilation() ||
function->IsInRecompileQueue() ||
function->IsMarkedForInstallingRecompiledCode()) {
@@ -8457,22 +8463,6 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CompleteOptimization) {
OS::Sleep(50);
}
}
- return isolate->heap()->undefined_value();
-}
-
-
-RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) {
- HandleScope scope(isolate);
- ASSERT(args.length() == 1);
- if (!V8::UseCrankshaft()) {
- return Smi::FromInt(4); // 4 == "never".
- }
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
- if (FLAG_parallel_recompilation) {
- if (function->IsMarkedForLazyRecompilation()) {
- return Smi::FromInt(5); // 5 == "parallel recompilation".
- }
- }
if (FLAG_always_opt) {
// We may have always opt, but that is more best-effort than a real
// promise, so we still say "no" if it is not optimized.
« no previous file with comments | « src/runtime.h ('k') | test/mjsunit/allocation-site-info.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698