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

Side by Side Diff: src/compiler/instruction.h

Issue 755323011: [turbofan] optimize moves into merges (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 10 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
« no previous file with comments | « no previous file | src/compiler/move-optimizer.h » ('j') | src/compiler/move-optimizer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef V8_COMPILER_INSTRUCTION_H_ 5 #ifndef V8_COMPILER_INSTRUCTION_H_
6 #define V8_COMPILER_INSTRUCTION_H_ 6 #define V8_COMPILER_INSTRUCTION_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <iosfwd> 9 #include <iosfwd>
10 #include <map> 10 #include <map>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 #undef INSTRUCTION_OPERAND_PREDICATE 75 #undef INSTRUCTION_OPERAND_PREDICATE
76 bool Equals(const InstructionOperand* other) const { 76 bool Equals(const InstructionOperand* other) const {
77 return value_ == other->value_; 77 return value_ == other->value_;
78 } 78 }
79 79
80 void ConvertTo(Kind kind, int index) { 80 void ConvertTo(Kind kind, int index) {
81 DCHECK(kind != UNALLOCATED && kind != INVALID); 81 DCHECK(kind != UNALLOCATED && kind != INVALID);
82 ConvertTo(kind, index, kInvalidVirtualRegister); 82 ConvertTo(kind, index, kInvalidVirtualRegister);
83 } 83 }
84 84
85 // Useful for map/set keys.
86 bool operator<(const InstructionOperand& op) const {
87 return value_ < op.value_;
88 }
89
85 protected: 90 protected:
86 template <typename SubKindOperand> 91 template <typename SubKindOperand>
87 static SubKindOperand* New(Zone* zone, const SubKindOperand& op) { 92 static SubKindOperand* New(Zone* zone, const SubKindOperand& op) {
88 void* buffer = zone->New(sizeof(op)); 93 void* buffer = zone->New(sizeof(op));
89 return new (buffer) SubKindOperand(op); 94 return new (buffer) SubKindOperand(op);
90 } 95 }
91 96
92 InstructionOperand(Kind kind, int index, int virtual_register) { 97 InstructionOperand(Kind kind, int index, int virtual_register) {
93 ConvertTo(kind, index, virtual_register); 98 ConvertTo(kind, index, virtual_register);
94 } 99 }
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 1067
1063 1068
1064 std::ostream& operator<<(std::ostream& os, 1069 std::ostream& operator<<(std::ostream& os,
1065 const PrintableInstructionSequence& code); 1070 const PrintableInstructionSequence& code);
1066 1071
1067 } // namespace compiler 1072 } // namespace compiler
1068 } // namespace internal 1073 } // namespace internal
1069 } // namespace v8 1074 } // namespace v8
1070 1075
1071 #endif // V8_COMPILER_INSTRUCTION_H_ 1076 #endif // V8_COMPILER_INSTRUCTION_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/move-optimizer.h » ('j') | src/compiler/move-optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698