Index: src/codegen.cc |
=================================================================== |
--- src/codegen.cc (revision 958) |
+++ src/codegen.cc (working copy) |
@@ -40,9 +40,11 @@ |
DeferredCode::DeferredCode(CodeGenerator* generator) |
: masm_(generator->masm()), |
generator_(generator), |
- statement_position_(masm_->last_statement_position()), |
- position_(masm_->last_position()) { |
+ statement_position_(masm_->current_statement_position()), |
+ position_(masm_->current_position()) { |
generator->AddDeferred(this); |
+ ASSERT(statement_position_ != RelocInfo::kNoPosition); |
+ ASSERT(position_ != RelocInfo::kNoPosition); |
#ifdef DEBUG |
comment_ = ""; |
#endif |
@@ -54,9 +56,7 @@ |
DeferredCode* code = deferred_.RemoveLast(); |
MacroAssembler* masm = code->masm(); |
// Record position of deferred code stub. |
- if (code->statement_position() != RelocInfo::kNoPosition) { |
- masm->RecordStatementPosition(code->statement_position()); |
- } |
+ masm->RecordStatementPosition(code->statement_position()); |
if (code->position() != RelocInfo::kNoPosition) { |
masm->RecordPosition(code->position()); |
} |
@@ -464,6 +464,26 @@ |
} |
+void CodeGenerator::CodeForStatement(Node* node) { |
+ if (FLAG_debug_info) { |
+ int pos = node->statement_pos(); |
+ if (pos != RelocInfo::kNoPosition) { |
+ masm()->RecordStatementPosition(pos); |
+ CodeForSourcePosition(pos); |
+ } |
+ } |
+} |
+ |
+ |
+void CodeGenerator::CodeForSourcePosition(int pos) { |
+ if (FLAG_debug_info) { |
+ if (pos != RelocInfo::kNoPosition) { |
+ masm()->RecordPosition(pos); |
+ } |
+ } |
+} |
+ |
+ |
const char* RuntimeStub::GetName() { |
return Runtime::FunctionForId(id_)->stub_name; |
} |