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

Side by Side Diff: src/hydrogen-instructions.h

Issue 24957003: Add tool to visualize machine code/lithium. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Final polish before review Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 631
632 HValue(HType type = HType::Tagged()) 632 HValue(HType type = HType::Tagged())
633 : block_(NULL), 633 : block_(NULL),
634 id_(kNoNumber), 634 id_(kNoNumber),
635 type_(type), 635 type_(type),
636 use_list_(NULL), 636 use_list_(NULL),
637 range_(NULL), 637 range_(NULL),
638 flags_(0) {} 638 flags_(0) {}
639 virtual ~HValue() {} 639 virtual ~HValue() {}
640 640
641 virtual int position() const { return RelocInfo::kNoPosition; }
642
641 HBasicBlock* block() const { return block_; } 643 HBasicBlock* block() const { return block_; }
642 void SetBlock(HBasicBlock* block); 644 void SetBlock(HBasicBlock* block);
643 int LoopWeight() const; 645 int LoopWeight() const;
644 646
645 // Note: Never call this method for an unlinked value. 647 // Note: Never call this method for an unlinked value.
646 Isolate* isolate() const; 648 Isolate* isolate() const;
647 649
648 int id() const { return id_; } 650 int id() const { return id_; }
649 void set_id(int id) { id_ = id; } 651 void set_id(int id) { id_ = id; }
650 652
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 1109
1108 virtual void PrintTo(StringStream* stream) V8_OVERRIDE; 1110 virtual void PrintTo(StringStream* stream) V8_OVERRIDE;
1109 virtual void PrintDataTo(StringStream* stream); 1111 virtual void PrintDataTo(StringStream* stream);
1110 1112
1111 bool IsLinked() const { return block() != NULL; } 1113 bool IsLinked() const { return block() != NULL; }
1112 void Unlink(); 1114 void Unlink();
1113 void InsertBefore(HInstruction* next); 1115 void InsertBefore(HInstruction* next);
1114 void InsertAfter(HInstruction* previous); 1116 void InsertAfter(HInstruction* previous);
1115 1117
1116 // The position is a write-once variable. 1118 // The position is a write-once variable.
1117 int position() const { return position_; } 1119 virtual int position() const V8_OVERRIDE { return position_; }
1118 bool has_position() const { return position_ != RelocInfo::kNoPosition; } 1120 bool has_position() const { return position_ != RelocInfo::kNoPosition; }
1119 void set_position(int position) { 1121 void set_position(int position) {
1120 ASSERT(!has_position()); 1122 ASSERT(!has_position());
1121 ASSERT(position != RelocInfo::kNoPosition); 1123 ASSERT(position != RelocInfo::kNoPosition);
1122 position_ = position; 1124 position_ = position;
1123 } 1125 }
1124 1126
1125 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); } 1127 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); }
1126 1128
1127 virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0; 1129 virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0;
(...skipping 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after
3140 virtual HValue* OperandAt(int index) const V8_OVERRIDE { 3142 virtual HValue* OperandAt(int index) const V8_OVERRIDE {
3141 return inputs_[index]; 3143 return inputs_[index];
3142 } 3144 }
3143 HValue* GetRedundantReplacement(); 3145 HValue* GetRedundantReplacement();
3144 void AddInput(HValue* value); 3146 void AddInput(HValue* value);
3145 bool HasRealUses(); 3147 bool HasRealUses();
3146 3148
3147 bool IsReceiver() const { return merged_index_ == 0; } 3149 bool IsReceiver() const { return merged_index_ == 0; }
3148 bool HasMergedIndex() const { return merged_index_ != kInvalidMergedIndex; } 3150 bool HasMergedIndex() const { return merged_index_ != kInvalidMergedIndex; }
3149 3151
3152 virtual int position() const V8_OVERRIDE;
3153
3150 int merged_index() const { return merged_index_; } 3154 int merged_index() const { return merged_index_; }
3151 3155
3152 InductionVariableData* induction_variable_data() { 3156 InductionVariableData* induction_variable_data() {
3153 return induction_variable_data_; 3157 return induction_variable_data_;
3154 } 3158 }
3155 bool IsInductionVariable() { 3159 bool IsInductionVariable() {
3156 return induction_variable_data_ != NULL; 3160 return induction_variable_data_ != NULL;
3157 } 3161 }
3158 bool IsLimitedInductionVariable() { 3162 bool IsLimitedInductionVariable() {
3159 return IsInductionVariable() && 3163 return IsInductionVariable() &&
(...skipping 3983 matching lines...) Expand 10 before | Expand all | Expand 10 after
7143 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7147 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7144 }; 7148 };
7145 7149
7146 7150
7147 #undef DECLARE_INSTRUCTION 7151 #undef DECLARE_INSTRUCTION
7148 #undef DECLARE_CONCRETE_INSTRUCTION 7152 #undef DECLARE_CONCRETE_INSTRUCTION
7149 7153
7150 } } // namespace v8::internal 7154 } } // namespace v8::internal
7151 7155
7152 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7156 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698