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

Unified Diff: src/codegen.cc

Issue 246019: Move the per-ast-node statement position to only statement node types.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 3 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 | « src/ast.h ('k') | src/ia32/codegen-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen.cc
===================================================================
--- src/codegen.cc (revision 2975)
+++ src/codegen.cc (working copy)
@@ -469,44 +469,32 @@
}
-void CodeGenerator::CodeForFunctionPosition(FunctionLiteral* fun) {
- if (FLAG_debug_info) {
- int pos = fun->start_position();
- if (pos != RelocInfo::kNoPosition) {
- masm()->RecordStatementPosition(pos);
- masm()->RecordPosition(pos);
- }
+static inline void RecordPositions(CodeGenerator* cgen, int pos) {
+ if (pos != RelocInfo::kNoPosition) {
+ cgen->masm()->RecordStatementPosition(pos);
+ cgen->masm()->RecordPosition(pos);
}
}
+void CodeGenerator::CodeForFunctionPosition(FunctionLiteral* fun) {
+ if (FLAG_debug_info) RecordPositions(this, fun->start_position());
+}
+
+
void CodeGenerator::CodeForReturnPosition(FunctionLiteral* fun) {
- if (FLAG_debug_info) {
- int pos = fun->end_position();
- if (pos != RelocInfo::kNoPosition) {
- masm()->RecordStatementPosition(pos);
- masm()->RecordPosition(pos);
- }
- }
+ if (FLAG_debug_info) RecordPositions(this, fun->end_position());
}
-void CodeGenerator::CodeForStatementPosition(AstNode* node) {
- if (FLAG_debug_info) {
- int pos = node->statement_pos();
- if (pos != RelocInfo::kNoPosition) {
- masm()->RecordStatementPosition(pos);
- masm()->RecordPosition(pos);
- }
- }
+void CodeGenerator::CodeForStatementPosition(Statement* stmt) {
+ if (FLAG_debug_info) RecordPositions(this, stmt->statement_pos());
}
void CodeGenerator::CodeForSourcePosition(int pos) {
- if (FLAG_debug_info) {
- if (pos != RelocInfo::kNoPosition) {
- masm()->RecordPosition(pos);
- }
+ if (FLAG_debug_info && pos != RelocInfo::kNoPosition) {
+ masm()->RecordPosition(pos);
}
}
« no previous file with comments | « src/ast.h ('k') | src/ia32/codegen-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698