Index: src/interpreter/bytecode-array-builder.cc |
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc |
index 8dc4fb98985bddb9e5328b622f7ab808ef3789b1..b15c55269dc192560253371f1a44b95f4e5ff69e 100644 |
--- a/src/interpreter/bytecode-array-builder.cc |
+++ b/src/interpreter/bytecode-array-builder.cc |
@@ -30,6 +30,7 @@ BytecodeArrayBuilder::BytecodeArrayBuilder(Isolate* isolate, Zone* zone, |
parameter_count_(parameter_count), |
local_register_count_(locals_count), |
context_register_count_(context_count), |
+ literal_(literal), |
temporary_allocator_(zone, fixed_register_count()), |
bytecode_array_writer_(isolate, zone, &constant_array_builder_), |
pipeline_(&bytecode_array_writer_) { |
@@ -50,10 +51,6 @@ BytecodeArrayBuilder::BytecodeArrayBuilder(Isolate* isolate, Zone* zone, |
pipeline_ = new (zone) BytecodeRegisterOptimizer( |
zone, &temporary_allocator_, parameter_count, pipeline_); |
} |
- |
- return_position_ = |
- literal ? std::max(literal->start_position(), literal->end_position() - 1) |
- : kNoSourcePosition; |
} |
Register BytecodeArrayBuilder::first_context_register() const { |
@@ -632,8 +629,10 @@ size_t BytecodeArrayBuilder::GetConstantPoolEntry(Handle<Object> object) { |
} |
void BytecodeArrayBuilder::SetReturnPosition() { |
- if (return_position_ == kNoSourcePosition) return; |
- latest_source_info_.MakeStatementPosition(return_position_); |
+ if (literal_ == nullptr) return; |
+ int position = |
+ std::max(literal_->start_position(), literal_->end_position() - 1); |
+ latest_source_info_.MakeStatementPosition(position); |
Dan Ehrenberg
2016/07/07 00:25:41
What does this change have to do with the other pa
Yang
2016/07/07 04:00:47
Since we now store the function literal anyways, w
|
} |
void BytecodeArrayBuilder::SetStatementPosition(Statement* stmt) { |