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

Unified Diff: runtime/vm/compiler.cc

Issue 1211273011: Added full deferred loading semantic to precompiled/--noopt/eager-loading code (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: c Created 5 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 | « runtime/vm/compiler.h ('k') | runtime/vm/flow_graph_compiler.cc » ('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 0afc45813509a49f7106d445eb780a16de7f87aa..9e15de30e65fa0aa6cc060939f774b4b83cbb05d 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, load_deferred_eagerly);
DECLARE_FLAG(bool, trace_failed_optimization_attempts);
DECLARE_FLAG(bool, trace_inlining_intervals);
DECLARE_FLAG(bool, trace_irregexp);
@@ -71,6 +72,7 @@ DECLARE_FLAG(bool, trace_patching);
bool Compiler::always_optimize_ = false;
+bool Compiler::allow_recompilation_ = true;
// TODO(zerny): Factor out unoptimizing/optimizing pipelines and remove
@@ -788,6 +790,7 @@ static bool CompileParsedFunctionHelper(CompilationPipeline* pipeline,
ASSERT(CodePatcher::CodeIsPatchable(code));
}
if (parsed_function->HasDeferredPrefixes()) {
+ ASSERT(!FLAG_load_deferred_eagerly);
ZoneGrowableArray<const LibraryPrefix*>* prefixes =
parsed_function->deferred_prefixes();
for (intptr_t i = 0; i < prefixes->length(); i++) {
@@ -972,6 +975,11 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline,
const Function& function,
bool optimized,
intptr_t osr_id) {
+ // Check that we optimize if 'Compiler::always_optimize()' is set to true,
+ // except if the function is marked as not optimizable.
+ ASSERT(!function.IsOptimizable() ||
+ !Compiler::always_optimize() || optimized);
+ ASSERT(Compiler::allow_recompilation() || !function.HasCode());
LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
Thread* const thread = Thread::Current();
« no previous file with comments | « runtime/vm/compiler.h ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698