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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 1127523004: Add flag --support_debugger, controls emitting single stepping checks. Disable in --noopt, 6% gain. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
« no previous file with comments | « no previous file | 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/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 45631)
+++ 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");
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));
}
@@ -3428,14 +3430,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());
@@ -4239,11 +4243,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);
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698