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

Unified Diff: src/compiler/instruction-selector.cc

Issue 1060373006: [turbofan] Get rid of SourcePositionInstruction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/compiler/instruction.cc ('k') | src/compiler/jump-threading.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc
index b612e3253be0a5d775011b69f3904d51fd8fbe59..4734e75aa8180f197d3e8abd828ba254c2edd3d7 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -475,6 +475,15 @@ void InstructionSelector::VisitBlock(BasicBlock* block) {
size_t current_node_end = instructions_.size();
VisitNode(node);
std::reverse(instructions_.begin() + current_node_end, instructions_.end());
+ if (instructions_.size() == current_node_end) continue;
+ // Mark source position on first instruction emitted.
+ SourcePosition source_position = source_positions_->GetSourcePosition(node);
+ if (source_position.IsUnknown()) continue;
+ DCHECK(!source_position.IsInvalid());
+ if (FLAG_turbo_source_positions || node->opcode() == IrOpcode::kCall) {
+ sequence()->SetSourcePosition(instructions_[current_node_end],
+ source_position);
+ }
}
// We're done with the block.
@@ -581,13 +590,6 @@ void InstructionSelector::VisitControl(BasicBlock* block) {
void InstructionSelector::VisitNode(Node* node) {
DCHECK_NOT_NULL(schedule()->block(node)); // should only use scheduled nodes.
- SourcePosition source_position = source_positions_->GetSourcePosition(node);
- if (!source_position.IsUnknown()) {
- DCHECK(!source_position.IsInvalid());
- if (FLAG_turbo_source_positions || node->opcode() == IrOpcode::kCall) {
- Emit(SourcePositionInstruction::New(instruction_zone(), source_position));
- }
- }
switch (node->opcode()) {
case IrOpcode::kStart:
case IrOpcode::kLoop:
« no previous file with comments | « src/compiler/instruction.cc ('k') | src/compiler/jump-threading.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698