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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 286363006: Add flag —enable-debugger (default true) in order to disable debugger single stepping code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
« no previous file with comments | « no previous file | runtime/vm/stub_code_ia32.cc » ('j') | runtime/vm/stub_code_ia32.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 36530)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -42,7 +42,9 @@
DECLARE_FLAG(bool, enable_type_checks);
DECLARE_FLAG(bool, warning_as_error);
DECLARE_FLAG(bool, silent_warnings);
+DECLARE_FLAG(int, optimization_counter_threshold);
+DECLARE_FLAG(bool, enable_debugger);
// TODO(srdjan): Allow compiler to add constants as they are encountered in
// the compilation.
@@ -999,7 +1001,7 @@
// statements for which there is no associated source position.
const Function& function = owner()->parsed_function()->function();
if ((node->token_pos() != Scanner::kNoSourcePos) &&
- !function.is_native()) {
+ !function.is_native() && FLAG_enable_debugger) {
AddInstruction(new DebugStepCheckInstr(node->token_pos(),
PcDescriptors::kReturn));
}
@@ -3108,8 +3110,10 @@
// call.
if (node->value()->IsLiteralNode() ||
node->value()->IsLoadLocalNode()) {
- AddInstruction(new DebugStepCheckInstr(node->token_pos(),
- PcDescriptors::kRuntimeCall));
+ if (FLAG_enable_debugger) {
+ AddInstruction(new DebugStepCheckInstr(node->token_pos(),
+ PcDescriptors::kRuntimeCall));
+ }
}
ValueGraphVisitor for_value(owner());
@@ -3166,14 +3170,16 @@
dst_name);
}
- store_value = Bind(BuildStoreExprTemp(store_value));
- GuardFieldInstr* guard =
- new GuardFieldInstr(store_value,
- node->field(),
- Isolate::Current()->GetNextDeoptId());
- AddInstruction(guard);
+ if (FLAG_optimization_counter_threshold >= 0) {
+ store_value = Bind(BuildStoreExprTemp(store_value));
+ GuardFieldInstr* guard =
+ new GuardFieldInstr(store_value,
+ node->field(),
+ Isolate::Current()->GetNextDeoptId());
+ AddInstruction(guard);
+ store_value = Bind(BuildLoadExprTemp());
+ }
- store_value = Bind(BuildLoadExprTemp());
StoreInstanceFieldInstr* store =
new StoreInstanceFieldInstr(node->field(),
for_instance.value(),
@@ -3519,12 +3525,15 @@
!function.is_native()) {
// Always allocate CheckOverflowInstr so that deopt-ids match regardless
// if we inline or not.
- CheckStackOverflowInstr* check =
- new CheckStackOverflowInstr(function.token_pos(), 0);
- // If we are inlining don't actually attach the stack check. We must still
- // create the stack check in order to allocate a deopt id.
- if (!owner()->IsInlining()) {
- AddInstruction(check);
+ if (!function.IsImplicitGetterFunction() &&
+ !function.IsImplicitSetterFunction()) {
+ CheckStackOverflowInstr* check =
+ new CheckStackOverflowInstr(function.token_pos(), 0);
+ // If we are inlining don't actually attach the stack check. We must still
+ // create the stack check in order to allocate a deopt id.
+ if (!owner()->IsInlining()) {
+ AddInstruction(check);
+ }
}
}
« no previous file with comments | « no previous file | runtime/vm/stub_code_ia32.cc » ('j') | runtime/vm/stub_code_ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698