Index: src/full-codegen.cc |
diff --git a/src/full-codegen.cc b/src/full-codegen.cc |
index e8f214cc92b39187b1118a4d1e6a93582dcf04b6..52cb5015500643de79e517cb52fb2ae8755c912a 100644 |
--- a/src/full-codegen.cc |
+++ b/src/full-codegen.cc |
@@ -572,88 +572,78 @@ void FullCodeGenerator::VisitDeclarations( |
void FullCodeGenerator::SetFunctionPosition(FunctionLiteral* fun) { |
- if (FLAG_debug_info) { |
- CodeGenerator::RecordPositions(masm_, fun->start_position()); |
- } |
+ CodeGenerator::RecordPositions(masm_, fun->start_position()); |
} |
void FullCodeGenerator::SetReturnPosition(FunctionLiteral* fun) { |
- if (FLAG_debug_info) { |
- CodeGenerator::RecordPositions(masm_, fun->end_position() - 1); |
- } |
+ CodeGenerator::RecordPositions(masm_, fun->end_position() - 1); |
} |
void FullCodeGenerator::SetStatementPosition(Statement* stmt) { |
- if (FLAG_debug_info) { |
#ifdef ENABLE_DEBUGGER_SUPPORT |
- if (!isolate()->debugger()->IsDebuggerActive()) { |
- CodeGenerator::RecordPositions(masm_, stmt->statement_pos()); |
- } else { |
- // Check if the statement will be breakable without adding a debug break |
- // slot. |
- BreakableStatementChecker checker; |
- checker.Check(stmt); |
- // Record the statement position right here if the statement is not |
- // breakable. For breakable statements the actual recording of the |
- // position will be postponed to the breakable code (typically an IC). |
- bool position_recorded = CodeGenerator::RecordPositions( |
- masm_, stmt->statement_pos(), !checker.is_breakable()); |
- // If the position recording did record a new position generate a debug |
- // break slot to make the statement breakable. |
- if (position_recorded) { |
- Debug::GenerateSlot(masm_); |
- } |
+ if (!isolate()->debugger()->IsDebuggerActive()) { |
+ CodeGenerator::RecordPositions(masm_, stmt->statement_pos()); |
+ } else { |
+ // Check if the statement will be breakable without adding a debug break |
+ // slot. |
+ BreakableStatementChecker checker; |
+ checker.Check(stmt); |
+ // Record the statement position right here if the statement is not |
+ // breakable. For breakable statements the actual recording of the |
+ // position will be postponed to the breakable code (typically an IC). |
+ bool position_recorded = CodeGenerator::RecordPositions( |
+ masm_, stmt->statement_pos(), !checker.is_breakable()); |
+ // If the position recording did record a new position generate a debug |
+ // break slot to make the statement breakable. |
+ if (position_recorded) { |
+ Debug::GenerateSlot(masm_); |
} |
+ } |
#else |
- CodeGenerator::RecordPositions(masm_, stmt->statement_pos()); |
+ CodeGenerator::RecordPositions(masm_, stmt->statement_pos()); |
#endif |
- } |
} |
void FullCodeGenerator::SetExpressionPosition(Expression* expr, int pos) { |
- if (FLAG_debug_info) { |
#ifdef ENABLE_DEBUGGER_SUPPORT |
- if (!isolate()->debugger()->IsDebuggerActive()) { |
- CodeGenerator::RecordPositions(masm_, pos); |
- } else { |
- // Check if the expression will be breakable without adding a debug break |
- // slot. |
- BreakableStatementChecker checker; |
- checker.Check(expr); |
- // Record a statement position right here if the expression is not |
- // breakable. For breakable expressions the actual recording of the |
- // position will be postponed to the breakable code (typically an IC). |
- // NOTE this will record a statement position for something which might |
- // not be a statement. As stepping in the debugger will only stop at |
- // statement positions this is used for e.g. the condition expression of |
- // a do while loop. |
- bool position_recorded = CodeGenerator::RecordPositions( |
- masm_, pos, !checker.is_breakable()); |
- // If the position recording did record a new position generate a debug |
- // break slot to make the statement breakable. |
- if (position_recorded) { |
- Debug::GenerateSlot(masm_); |
- } |
+ if (!isolate()->debugger()->IsDebuggerActive()) { |
+ CodeGenerator::RecordPositions(masm_, pos); |
+ } else { |
+ // Check if the expression will be breakable without adding a debug break |
+ // slot. |
+ BreakableStatementChecker checker; |
+ checker.Check(expr); |
+ // Record a statement position right here if the expression is not |
+ // breakable. For breakable expressions the actual recording of the |
+ // position will be postponed to the breakable code (typically an IC). |
+ // NOTE this will record a statement position for something which might |
+ // not be a statement. As stepping in the debugger will only stop at |
+ // statement positions this is used for e.g. the condition expression of |
+ // a do while loop. |
+ bool position_recorded = CodeGenerator::RecordPositions( |
+ masm_, pos, !checker.is_breakable()); |
+ // If the position recording did record a new position generate a debug |
+ // break slot to make the statement breakable. |
+ if (position_recorded) { |
+ Debug::GenerateSlot(masm_); |
} |
+ } |
#else |
- CodeGenerator::RecordPositions(masm_, pos); |
+ CodeGenerator::RecordPositions(masm_, pos); |
#endif |
- } |
} |
void FullCodeGenerator::SetStatementPosition(int pos) { |
- if (FLAG_debug_info) { |
- CodeGenerator::RecordPositions(masm_, pos); |
- } |
+ CodeGenerator::RecordPositions(masm_, pos); |
} |
void FullCodeGenerator::SetSourcePosition(int pos) { |
- if (FLAG_debug_info && pos != RelocInfo::kNoPosition) { |
+ if (pos != RelocInfo::kNoPosition) { |
masm_->positions_recorder()->RecordPosition(pos); |
} |
} |