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

Side by Side Diff: src/interpreter/bytecode-pipeline.h

Issue 1997653002: [interpreter] Bytecode register optimizer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Try harder with source positions. Created 4 years, 7 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_INTERPRETER_BYTECODE_PIPELINE_H_ 5 #ifndef V8_INTERPRETER_BYTECODE_PIPELINE_H_
6 #define V8_INTERPRETER_BYTECODE_PIPELINE_H_ 6 #define V8_INTERPRETER_BYTECODE_PIPELINE_H_
7 7
8 #include "src/interpreter/bytecode-register-allocator.h" 8 #include "src/interpreter/bytecode-register-allocator.h"
9 #include "src/interpreter/bytecodes.h" 9 #include "src/interpreter/bytecodes.h"
10 #include "src/zone-containers.h" 10 #include "src/zone-containers.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 uint32_t operand(int i) const { 105 uint32_t operand(int i) const {
106 DCHECK_LT(i, operand_count()); 106 DCHECK_LT(i, operand_count());
107 return operands_[i]; 107 return operands_[i];
108 } 108 }
109 uint32_t* operands() { return operands_; } 109 uint32_t* operands() { return operands_; }
110 const uint32_t* operands() const { return operands_; } 110 const uint32_t* operands() const { return operands_; }
111 111
112 int operand_count() const { return Bytecodes::NumberOfOperands(bytecode_); } 112 int operand_count() const { return Bytecodes::NumberOfOperands(bytecode_); }
113 OperandScale operand_scale() const { return operand_scale_; } 113 OperandScale operand_scale() const { return operand_scale_; }
114 void set_operand_scale(OperandScale operand_scale) {
115 operand_scale_ = operand_scale;
116 }
114 117
115 const BytecodeSourceInfo& source_info() const { return source_info_; } 118 const BytecodeSourceInfo& source_info() const { return source_info_; }
116 BytecodeSourceInfo& source_info() { return source_info_; } 119 BytecodeSourceInfo& source_info() { return source_info_; }
117 120
118 bool operator==(const BytecodeNode& other) const; 121 bool operator==(const BytecodeNode& other) const;
119 bool operator!=(const BytecodeNode& other) const { return !(*this == other); } 122 bool operator!=(const BytecodeNode& other) const { return !(*this == other); }
120 123
121 private: 124 private:
122 static const int kInvalidPosition = kMinInt; 125 static const int kInvalidPosition = kMinInt;
123 static const size_t kMaxOperands = 4; 126 static const size_t kMaxOperands = 4;
124 127
125 Bytecode bytecode_; 128 Bytecode bytecode_;
126 uint32_t operands_[kMaxOperands]; 129 uint32_t operands_[kMaxOperands];
127 OperandScale operand_scale_; 130 OperandScale operand_scale_;
128 BytecodeSourceInfo source_info_; 131 BytecodeSourceInfo source_info_;
129 }; 132 };
130 133
131 std::ostream& operator<<(std::ostream& os, const BytecodeSourceInfo& info); 134 std::ostream& operator<<(std::ostream& os, const BytecodeSourceInfo& info);
132 std::ostream& operator<<(std::ostream& os, const BytecodeNode& node); 135 std::ostream& operator<<(std::ostream& os, const BytecodeNode& node);
133 136
134 } // namespace interpreter 137 } // namespace interpreter
135 } // namespace internal 138 } // namespace internal
136 } // namespace v8 139 } // namespace v8
137 140
138 #endif // V8_INTERPRETER_BYTECODE_PIPELINE_H_ 141 #endif // V8_INTERPRETER_BYTECODE_PIPELINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698