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

Unified Diff: src/codegen.cc

Issue 14170: Refactored the recording of source position in the generated code. The code g... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years 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/assembler-ia32.cc ('k') | src/codegen-arm.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 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;
}
« no previous file with comments | « src/assembler-ia32.cc ('k') | src/codegen-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698