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

Unified Diff: src/interpreter/bytecode-array-builder.cc

Issue 1662983002: [interpreter] add source positions for call and call-new. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix test expectations Created 4 years, 10 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/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index aff34053fc7b1b0be0b0af35d5f7763a80c8ec88..54184344c4273d19323ef0dae3d8071a6dd79795 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -73,6 +73,7 @@ BytecodeArrayBuilder::BytecodeArrayBuilder(Isolate* isolate, Zone* zone,
bytecode_generated_(false),
constant_array_builder_(isolate, zone),
handler_table_builder_(isolate, zone),
+ source_position_table_builder_(isolate, zone),
last_block_end_(0),
last_bytecode_start_(~0),
exit_seen_in_block_(false),
@@ -122,10 +123,13 @@ Handle<BytecodeArray> BytecodeArrayBuilder::ToBytecodeArray() {
int frame_size = register_count * kPointerSize;
Handle<FixedArray> constant_pool = constant_array_builder()->ToFixedArray();
Handle<FixedArray> handler_table = handler_table_builder()->ToHandlerTable();
+ Handle<FixedArray> source_position_table =
+ source_position_table_builder()->ToFixedArray();
Handle<BytecodeArray> output = isolate_->factory()->NewBytecodeArray(
bytecode_size, &bytecodes_.front(), frame_size, parameter_count(),
constant_pool);
output->set_handler_table(*handler_table);
+ output->set_source_position_table(*source_position_table);
bytecode_generated_ = true;
return output;
}
@@ -1182,6 +1186,18 @@ size_t BytecodeArrayBuilder::GetConstantPoolEntry(Handle<Object> object) {
return constant_array_builder()->Insert(object);
}
+void BytecodeArrayBuilder::SetStatementPosition(Statement* stmt) {
+ if (stmt->position() == RelocInfo::kNoPosition) return;
+ source_position_table_builder_.AddStatementPosition(
+ static_cast<int>(bytecodes_.size()), stmt->position());
+}
+
+void BytecodeArrayBuilder::SetExpressionPosition(Expression* expr) {
+ if (expr->position() == RelocInfo::kNoPosition) return;
+ source_position_table_builder_.AddExpressionPosition(
+ static_cast<int>(bytecodes_.size()), expr->position());
+}
+
bool BytecodeArrayBuilder::TemporaryRegisterIsLive(Register reg) const {
return temporary_register_allocator()->RegisterIsLive(reg);
}
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698