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

Unified Diff: runtime/vm/compiler.cc

Issue 1401413002: Move no_callback_scope_depth_ and cha_ from isolate -> thread (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Spelling fix Created 5 years, 2 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 | « runtime/vm/base_isolate.h ('k') | runtime/vm/dart_api_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 6de6b0cb3d2d1b688f1e047f73c487b32e2fcf6e..5d683ce5aa8c39bb29773d98e8b7566a00e9adb5 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -64,6 +64,7 @@ DEFINE_FLAG(bool, use_inlining, true, "Enable call-site inlining");
DEFINE_FLAG(bool, verify_compiler, false,
"Enable compiler verification assertions");
+DECLARE_FLAG(bool, background_compilation);
DECLARE_FLAG(bool, load_deferred_eagerly);
DECLARE_FLAG(bool, trace_failed_optimization_attempts);
DECLARE_FLAG(bool, trace_inlining_intervals);
@@ -1161,6 +1162,10 @@ RawError* Compiler::CompileOptimizedFunction(Thread* thread,
TIMELINE_FUNCTION_COMPILATION_DURATION(thread,
"OptimizedFunction", function);
+ // Optimization must happen in non-mutator/Dart thread if background
+ // compilation is on.
+ ASSERT(!FLAG_background_compilation ||
+ !thread->isolate()->MutatorThreadIsCurrentThread());
CompilationPipeline* pipeline =
CompilationPipeline::New(thread->zone(), function);
return CompileFunctionHelper(pipeline, function, true, osr_id);
@@ -1471,19 +1476,13 @@ void BackgroundCompiler::Run() {
Function& function = Function::Handle();
function = RemoveOrNull();
while (!function.IsNull()) {
- if (true) {
- // Debugging printing
- THR_Print("Background compilation: %s\n",
- function.ToQualifiedCString());
- } else {
- const Error& error = Error::Handle(
- Compiler::CompileOptimizedFunction(thread, function));
- // TODO(srdjan): We do not expect errors while compiling optimized
- // code, any errors should have been caught when compiling
- // unotpimized code.
- // If it still happens mark function as not optimizable.
- ASSERT(error.IsNull());
- }
+ const Error& error = Error::Handle(
+ Compiler::CompileOptimizedFunction(thread, function));
+ // TODO(srdjan): We do not expect errors while compiling optimized
+ // code, any errors should have been caught when compiling
+ // unoptimized code.
+ // If it still happens mark function as not optimizable.
+ ASSERT(error.IsNull());
function = RemoveOrNull();
}
}
« no previous file with comments | « runtime/vm/base_isolate.h ('k') | runtime/vm/dart_api_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698