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

Unified Diff: src/compiler/instruction.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.h ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction.cc
diff --git a/src/compiler/instruction.cc b/src/compiler/instruction.cc
index c361571dfdf41d1acd711b854a407bfacd84cbad..316c96efe9f623cfd8f67d0e46378eb6093c0f0e 100644
--- a/src/compiler/instruction.cc
+++ b/src/compiler/instruction.cc
@@ -319,21 +319,14 @@ std::ostream& operator<<(std::ostream& os,
if (instr.OutputCount() > 1) os << ") = ";
if (instr.OutputCount() == 1) os << " = ";
- if (instr.IsSourcePosition()) {
- const SourcePositionInstruction* pos =
- SourcePositionInstruction::cast(&instr);
- os << "position (" << pos->source_position().raw() << ")";
- } else {
- os << ArchOpcodeField::decode(instr.opcode());
- AddressingMode am = AddressingModeField::decode(instr.opcode());
- if (am != kMode_None) {
- os << " : " << AddressingModeField::decode(instr.opcode());
- }
- FlagsMode fm = FlagsModeField::decode(instr.opcode());
- if (fm != kFlags_none) {
- os << " && " << fm << " if "
- << FlagsConditionField::decode(instr.opcode());
- }
+ os << ArchOpcodeField::decode(instr.opcode());
+ AddressingMode am = AddressingModeField::decode(instr.opcode());
+ if (am != kMode_None) {
+ os << " : " << AddressingModeField::decode(instr.opcode());
+ }
+ FlagsMode fm = FlagsModeField::decode(instr.opcode());
+ if (fm != kFlags_none) {
+ os << " && " << fm << " if " << FlagsConditionField::decode(instr.opcode());
}
if (instr.InputCount() > 0) {
for (size_t i = 0; i < instr.InputCount(); i++) {
@@ -480,6 +473,7 @@ InstructionSequence::InstructionSequence(Isolate* isolate,
: isolate_(isolate),
zone_(instruction_zone),
instruction_blocks_(instruction_blocks),
+ source_positions_(zone()),
block_starts_(zone()),
constants_(ConstantMap::key_compare(),
ConstantMap::allocator_type(zone())),
@@ -604,6 +598,23 @@ RpoNumber InstructionSequence::InputRpo(Instruction* instr, size_t index) {
}
+bool InstructionSequence::GetSourcePosition(const Instruction* instr,
+ SourcePosition* result) const {
+ auto it = source_positions_.find(instr);
+ if (it == source_positions_.end()) return false;
+ *result = it->second;
+ return true;
+}
+
+
+void InstructionSequence::SetSourcePosition(const Instruction* instr,
+ SourcePosition value) {
+ DCHECK(!value.IsInvalid());
+ DCHECK(!value.IsUnknown());
+ source_positions_.insert(std::make_pair(instr, value));
+}
+
+
FrameStateDescriptor::FrameStateDescriptor(
Zone* zone, const FrameStateCallInfo& state_info, size_t parameters_count,
size_t locals_count, size_t stack_count, FrameStateDescriptor* outer_state)
« no previous file with comments | « src/compiler/instruction.h ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698