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

Unified Diff: src/compiler/instruction.h

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/code-generator.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction.h
diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h
index cf1883f8a61711ae0ac58057cf1489fcd2cef49a..f05542e6ff4016ca2d1677c815bff93616099b0f 100644
--- a/src/compiler/instruction.h
+++ b/src/compiler/instruction.h
@@ -24,9 +24,6 @@ namespace compiler {
class Schedule;
-// A couple of reserved opcodes are used for internal use.
-const InstructionCode kSourcePositionInstruction = -1;
-
class InstructionOperand {
public:
static const int kInvalidVirtualRegister = -1;
@@ -624,10 +621,6 @@ class Instruction {
bool NeedsReferenceMap() const { return IsCall(); }
bool HasReferenceMap() const { return reference_map_ != NULL; }
- bool IsSourcePosition() const {
- return opcode() == kSourcePositionInstruction;
- }
-
bool ClobbersRegisters() const { return IsCall(); }
bool ClobbersTemps() const { return IsCall(); }
bool ClobbersDoubleRegisters() const { return IsCall(); }
@@ -709,37 +702,6 @@ struct PrintableInstruction {
std::ostream& operator<<(std::ostream& os, const PrintableInstruction& instr);
-class SourcePositionInstruction FINAL : public Instruction {
- public:
- static SourcePositionInstruction* New(Zone* zone, SourcePosition position) {
- void* buffer = zone->New(sizeof(SourcePositionInstruction));
- return new (buffer) SourcePositionInstruction(position);
- }
-
- SourcePosition source_position() const { return source_position_; }
-
- static SourcePositionInstruction* cast(Instruction* instr) {
- DCHECK(instr->IsSourcePosition());
- return static_cast<SourcePositionInstruction*>(instr);
- }
-
- static const SourcePositionInstruction* cast(const Instruction* instr) {
- DCHECK(instr->IsSourcePosition());
- return static_cast<const SourcePositionInstruction*>(instr);
- }
-
- private:
- explicit SourcePositionInstruction(SourcePosition source_position)
- : Instruction(kSourcePositionInstruction),
- source_position_(source_position) {
- DCHECK(!source_position_.IsInvalid());
- DCHECK(!source_position_.IsUnknown());
- }
-
- SourcePosition source_position_;
-};
-
-
class RpoNumber FINAL {
public:
static const int kInvalidRpoNumber = -1;
@@ -1113,15 +1075,21 @@ class InstructionSequence FINAL : public ZoneObject {
RpoNumber InputRpo(Instruction* instr, size_t index);
+ bool GetSourcePosition(const Instruction* instr,
+ SourcePosition* result) const;
+ void SetSourcePosition(const Instruction* instr, SourcePosition value);
+
private:
friend std::ostream& operator<<(std::ostream& os,
const PrintableInstructionSequence& code);
typedef std::set<int, std::less<int>, ZoneIntAllocator> VirtualRegisterSet;
+ typedef ZoneMap<const Instruction*, SourcePosition> SourcePositionMap;
Isolate* isolate_;
Zone* const zone_;
InstructionBlocks* const instruction_blocks_;
+ SourcePositionMap source_positions_;
IntVector block_starts_;
ConstantMap constants_;
Immediates immediates_;
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698