 Chromium Code Reviews
 Chromium Code Reviews Issue 2038323002:
  [interpreter] Filter expression positions at source.  (Closed) 
  Base URL: https://chromium.googlesource.com/v8/v8.git@oth-0060-source-position-testing
    
  
    Issue 2038323002:
  [interpreter] Filter expression positions at source.  (Closed) 
  Base URL: https://chromium.googlesource.com/v8/v8.git@oth-0060-source-position-testing| Index: src/interpreter/bytecode-array-builder.cc | 
| diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc | 
| index fa57c16c7cca85c9faa418815cddf63dd0620b3e..39435b286996915f815e8eb014b3c7a6f78e980f 100644 | 
| --- a/src/interpreter/bytecode-array-builder.cc | 
| +++ b/src/interpreter/bytecode-array-builder.cc | 
| @@ -81,8 +81,11 @@ Handle<BytecodeArray> BytecodeArrayBuilder::ToBytecodeArray() { | 
| void BytecodeArrayBuilder::AttachSourceInfo(BytecodeNode* node) { | 
| if (latest_source_info_.is_valid()) { | 
| - node->source_info().Update(latest_source_info_); | 
| - latest_source_info_.set_invalid(); | 
| + if (latest_source_info_.is_statement() || !FLAG_ignition_filter_positions || | 
| + !Bytecodes::IsWithoutExternalSideEffects(node->bytecode())) { | 
| 
rmcilroy
2016/06/07 10:21:41
Please pull out a CanFilterPosition function for c
 
oth
2016/06/08 09:19:41
Added NeedExpressionPosition(Bytecode).
 | 
| + node->source_info() = latest_source_info_; | 
| + latest_source_info_.set_invalid(); | 
| 
rmcilroy
2016/06/07 10:21:41
I think you should set_invalid unconditionally, ot
 
oth
2016/06/08 09:19:41
The goal is to defer writing the expression positi
 
rmcilroy
2016/06/08 13:45:11
I see, makes sense. Could you add a comment here a
 
oth
2016/06/08 15:04:21
Done.
 | 
| + } | 
| } | 
| } | 
| @@ -722,6 +725,9 @@ void BytecodeArrayBuilder::SetStatementPosition(Statement* stmt) { | 
| void BytecodeArrayBuilder::SetExpressionPosition(Expression* expr) { | 
| if (expr->position() == RelocInfo::kNoPosition) return; | 
| + if (latest_source_info_.is_expression()) { | 
| + latest_source_info_.set_invalid(); | 
| 
rmcilroy
2016/06/07 10:21:41
Why do you need to set this as invalid, won't Upda
 
oth
2016/06/08 09:19:41
Update() does not do the right thing. I don't want
 
rmcilroy
2016/06/08 13:45:11
I'm fine with getting rid of Update (I agree the l
 
oth
2016/06/08 15:04:20
Amen.
 | 
| + } | 
| latest_source_info_.Update({expr->position(), false}); | 
| } |