Skip to content
Permalink
Browse files

[vm/bytecode] Enable optimized compilation if running with interpreter

Also, reset usage counter after unoptimized compilation in background
so that function can be optimized.

Change-Id: I7b0fff0bc800345237822b31b176691e8cd132eb
Reviewed-on: https://dart-review.googlesource.com/c/84044
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
  • Loading branch information...
alexmarkov authored and commit-bot@chromium.org committed Nov 9, 2018
1 parent 1c1e013 commit d74f272d78fedd9efe1bd5baee047400f7bbf3f6
Showing with 5 additions and 1 deletion.
  1. +5 −0 runtime/vm/compiler/jit/compiler.cc
  2. +0 −1 runtime/vm/dart.cc
@@ -678,6 +678,11 @@ RawCode* CompileParsedFunctionHelper::FinalizeCompilation(
function.set_unoptimized_code(code);
function.AttachCode(code);
function.SetWasCompiled(true);
if (function.IsOptimizable() && (function.usage_counter() < 0)) {
// While doing compilation in background, usage counter is set
// to INT_MIN. Reset counter so that function can be optimized further.
function.SetUsageCounter(0);
}
}
if (parsed_function()->HasDeferredPrefixes()) {
ASSERT(!FLAG_load_deferred_eagerly);
@@ -150,7 +150,6 @@ char* Dart::Init(const uint8_t* vm_isolate_snapshot,
#endif // defined(TARGET_OS_WINDOWS)

FLAG_use_field_guards = false;
FLAG_optimization_counter_threshold = -1;
}

FrameLayout::Init();

0 comments on commit d74f272

Please sign in to comment.
You can’t perform that action at this time.