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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 1149713002: With --noopt run unoptimized code through optimizer, more optimizations can be done later. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Cleanup Created 5 years, 7 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
Index: runtime/vm/flow_graph_compiler.cc
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index ae31c415a40a9e13c5b5fd7f7be16c903418a41b..fc9e0cb215cc22d7f2f83e266d8aaad013c5148d 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -8,6 +8,7 @@
#include "vm/bit_vector.h"
#include "vm/cha.h"
+#include "vm/compiler.h"
#include "vm/dart_entry.h"
#include "vm/debugger.h"
#include "vm/deopt_instructions.h"
@@ -54,7 +55,6 @@ DECLARE_FLAG(int, reoptimization_counter_threshold);
DECLARE_FLAG(int, stacktrace_every);
DECLARE_FLAG(charp, stacktrace_filter);
DECLARE_FLAG(bool, support_debugger);
-DECLARE_FLAG(bool, use_cha);
DECLARE_FLAG(bool, use_field_guards);
DECLARE_FLAG(bool, use_osr);
DECLARE_FLAG(bool, warn_on_javascript_compatibility);
@@ -70,6 +70,8 @@ static void NooptModeHandler(bool value) {
FLAG_support_debugger = false;
FLAG_ic_range_profiling = false;
FLAG_collect_code = false;
+ Compiler::set_always_optimize(true);
+ Compiler::set_guess_other_cid(false);
}
}
@@ -206,7 +208,6 @@ void FlowGraphCompiler::InitCompiler() {
const ICData* ic_data = NULL;
if (current->IsInstanceCall()) {
ic_data = current->AsInstanceCall()->ic_data();
- ASSERT(ic_data != NULL);
}
if ((ic_data != NULL) && (ic_data->NumberOfUsedChecks() == 0)) {
may_reoptimize_ = true;
@@ -846,6 +847,8 @@ Label* FlowGraphCompiler::AddDeoptStub(intptr_t deopt_id,
return &intrinsic_slow_path_label_;
}
+ // No deoptimization allowed when 'always_optimize' is set.
+ ASSERT(!Compiler::always_optimize());
ASSERT(is_optimizing_);
CompilerDeoptInfoWithStub* stub =
new CompilerDeoptInfoWithStub(deopt_id,
@@ -881,6 +884,10 @@ void FlowGraphCompiler::FinalizePcDescriptors(const Code& code) {
RawArray* FlowGraphCompiler::CreateDeoptInfo(Assembler* assembler) {
+ // No deopt information if we 'always_optimize' (no deoptimization allowed).
+ if (Compiler::always_optimize()) {
+ return Array::empty_array().raw();
+ }
// For functions with optional arguments, all incoming arguments are copied
// to spill slots. The deoptimization environment does not track them.
const Function& function = parsed_function().function();

Powered by Google App Engine
This is Rietveld 408576698