Chromium Code Reviews| Index: runtime/vm/flow_graph_builder.cc |
| =================================================================== |
| --- runtime/vm/flow_graph_builder.cc (revision 45524) |
| +++ runtime/vm/flow_graph_builder.cc (working copy) |
| @@ -35,6 +35,7 @@ |
| "Eliminate type checks when allowed by static type analysis."); |
| DEFINE_FLAG(bool, print_ast, false, "Print abstract syntax tree."); |
| DEFINE_FLAG(bool, print_scopes, false, "Print scopes of local variables."); |
| +DEFINE_FLAG(bool, support_debugger, true, "Emit code needed for debugging"); |
|
hausner
2015/05/05 15:59:15
Would be nice to use the --debug command line opti
srdjan
2015/05/06 21:02:54
This flag should not be used by user, the flag wil
|
| DEFINE_FLAG(bool, trace_type_check_elimination, false, |
| "Trace type check elimination at compile time."); |
| @@ -1042,7 +1043,8 @@ |
| // No debugger check is done in native functions or for return |
| // statements for which there is no associated source position. |
| const Function& function = owner()->function(); |
| - if ((node->token_pos() != Scanner::kNoSourcePos) && !function.is_native()) { |
| + if (FLAG_support_debugger && |
| + (node->token_pos() != Scanner::kNoSourcePos) && !function.is_native()) { |
| AddInstruction(new(Z) DebugStepCheckInstr(node->token_pos(), |
| RawPcDescriptors::kRuntimeCall)); |
| } |
| @@ -3438,14 +3440,16 @@ |
| // a safe point for the debugger to stop, add an explicit stub |
| // call. Exception: don't do this when assigning to or from internal |
| // variables, or for generated code that has no source position. |
| - if ((node->value()->IsLiteralNode() || |
| - (node->value()->IsLoadLocalNode() && |
| - !node->value()->AsLoadLocalNode()->local().IsInternal()) || |
| - node->value()->IsClosureNode()) && |
| - !node->local().IsInternal() && |
| - (node->token_pos() != Scanner::kNoSourcePos)) { |
| - AddInstruction(new(Z) DebugStepCheckInstr( |
| - node->token_pos(), RawPcDescriptors::kRuntimeCall)); |
| + if (FLAG_support_debugger) { |
| + if ((node->value()->IsLiteralNode() || |
| + (node->value()->IsLoadLocalNode() && |
| + !node->value()->AsLoadLocalNode()->local().IsInternal()) || |
| + node->value()->IsClosureNode()) && |
| + !node->local().IsInternal() && |
| + (node->token_pos() != Scanner::kNoSourcePos)) { |
| + AddInstruction(new(Z) DebugStepCheckInstr( |
| + node->token_pos(), RawPcDescriptors::kRuntimeCall)); |
| + } |
| } |
| ValueGraphVisitor for_value(owner()); |
| @@ -4249,11 +4253,13 @@ |
| void EffectGraphVisitor::BuildThrowNode(ThrowNode* node) { |
| - if (node->exception()->IsLiteralNode() || |
| - node->exception()->IsLoadLocalNode() || |
| - node->exception()->IsClosureNode()) { |
| - AddInstruction(new(Z) DebugStepCheckInstr( |
| - node->token_pos(), RawPcDescriptors::kRuntimeCall)); |
| + if (FLAG_support_debugger) { |
| + if (node->exception()->IsLiteralNode() || |
| + node->exception()->IsLoadLocalNode() || |
| + node->exception()->IsClosureNode()) { |
| + AddInstruction(new(Z) DebugStepCheckInstr( |
| + node->token_pos(), RawPcDescriptors::kRuntimeCall)); |
| + } |
| } |
| ValueGraphVisitor for_exception(owner()); |
| node->exception()->Visit(&for_exception); |