| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/instruction-selector.h" | 5 #include "src/compiler/instruction-selector.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "src/base/adapters.h" | 9 #include "src/base/adapters.h" |
| 10 #include "src/compiler/instruction-selector-impl.h" | 10 #include "src/compiler/instruction-selector-impl.h" |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 // Skip nodes that are unused or already defined. | 416 // Skip nodes that are unused or already defined. |
| 417 if (!IsUsed(node) || IsDefined(node)) continue; | 417 if (!IsUsed(node) || IsDefined(node)) continue; |
| 418 // Generate code for this node "top down", but schedule the code "bottom | 418 // Generate code for this node "top down", but schedule the code "bottom |
| 419 // up". | 419 // up". |
| 420 size_t current_node_end = instructions_.size(); | 420 size_t current_node_end = instructions_.size(); |
| 421 VisitNode(node); | 421 VisitNode(node); |
| 422 std::reverse(instructions_.begin() + current_node_end, instructions_.end()); | 422 std::reverse(instructions_.begin() + current_node_end, instructions_.end()); |
| 423 if (instructions_.size() == current_node_end) continue; | 423 if (instructions_.size() == current_node_end) continue; |
| 424 // Mark source position on first instruction emitted. | 424 // Mark source position on first instruction emitted. |
| 425 SourcePosition source_position = source_positions_->GetSourcePosition(node); | 425 SourcePosition source_position = source_positions_->GetSourcePosition(node); |
| 426 if (source_position.IsUnknown()) continue; | 426 if (source_position.IsKnown() && |
| 427 DCHECK(!source_position.IsInvalid()); | 427 (source_position_mode_ == kAllSourcePositions || |
| 428 if (source_position_mode_ == kAllSourcePositions || | 428 node->opcode() == IrOpcode::kCall)) { |
| 429 node->opcode() == IrOpcode::kCall) { | |
| 430 sequence()->SetSourcePosition(instructions_[current_node_end], | 429 sequence()->SetSourcePosition(instructions_[current_node_end], |
| 431 source_position); | 430 source_position); |
| 432 } | 431 } |
| 433 } | 432 } |
| 434 | 433 |
| 435 // We're done with the block. | 434 // We're done with the block. |
| 436 InstructionBlock* instruction_block = | 435 InstructionBlock* instruction_block = |
| 437 sequence()->InstructionBlockAt(RpoNumber::FromInt(block->rpo_number())); | 436 sequence()->InstructionBlockAt(RpoNumber::FromInt(block->rpo_number())); |
| 438 instruction_block->set_code_start(static_cast<int>(instructions_.size())); | 437 instruction_block->set_code_start(static_cast<int>(instructions_.size())); |
| 439 instruction_block->set_code_end(current_block_end); | 438 instruction_block->set_code_end(current_block_end); |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1144 MachineOperatorBuilder::Flags | 1143 MachineOperatorBuilder::Flags |
| 1145 InstructionSelector::SupportedMachineOperatorFlags() { | 1144 InstructionSelector::SupportedMachineOperatorFlags() { |
| 1146 return MachineOperatorBuilder::Flag::kNoFlags; | 1145 return MachineOperatorBuilder::Flag::kNoFlags; |
| 1147 } | 1146 } |
| 1148 | 1147 |
| 1149 #endif // !V8_TURBOFAN_BACKEND | 1148 #endif // !V8_TURBOFAN_BACKEND |
| 1150 | 1149 |
| 1151 } // namespace compiler | 1150 } // namespace compiler |
| 1152 } // namespace internal | 1151 } // namespace internal |
| 1153 } // namespace v8 | 1152 } // namespace v8 |
| OLD | NEW |