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

Side by Side Diff: src/interpreter/bytecodes.h

Issue 1392933002: [Interpreter] Reduce temporary register usage in generated bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate comments from mstarzinger. Created 5 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
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_BYTECODES_H_ 5 #ifndef V8_INTERPRETER_BYTECODES_H_
6 #define V8_INTERPRETER_BYTECODES_H_ 6 #define V8_INTERPRETER_BYTECODES_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 // Clients of this interface shouldn't depend on lots of interpreter internals. 10 // Clients of this interface shouldn't depend on lots of interpreter internals.
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 bool is_function_context() const; 204 bool is_function_context() const;
205 205
206 static Register FromOperand(uint8_t operand); 206 static Register FromOperand(uint8_t operand);
207 uint8_t ToOperand() const; 207 uint8_t ToOperand() const;
208 208
209 static bool AreContiguous(Register reg1, Register reg2, 209 static bool AreContiguous(Register reg1, Register reg2,
210 Register reg3 = Register(), 210 Register reg3 = Register(),
211 Register reg4 = Register(), 211 Register reg4 = Register(),
212 Register reg5 = Register()); 212 Register reg5 = Register());
213 213
214 bool operator==(const Register& o) const { return o.index() == index(); } 214 bool operator==(const Register& other) const {
215 bool operator!=(const Register& o) const { return o.index() != index(); } 215 return index() == other.index();
216 }
217 bool operator!=(const Register& other) const {
218 return index() != other.index();
219 }
220 bool operator<(const Register& other) const {
221 return index() < other.index();
222 }
223 bool operator<=(const Register& other) const {
224 return index() <= other.index();
225 }
216 226
217 private: 227 private:
218 static const int kIllegalIndex = kMaxInt; 228 static const int kIllegalIndex = kMaxInt;
219 229
220 void* operator new(size_t size); 230 void* operator new(size_t size);
221 void operator delete(void* p); 231 void operator delete(void* p);
222 232
223 int index_; 233 int index_;
224 }; 234 };
225 235
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 294
285 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); 295 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode);
286 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); 296 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type);
287 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); 297 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type);
288 298
289 } // namespace interpreter 299 } // namespace interpreter
290 } // namespace internal 300 } // namespace internal
291 } // namespace v8 301 } // namespace v8
292 302
293 #endif // V8_INTERPRETER_BYTECODES_H_ 303 #endif // V8_INTERPRETER_BYTECODES_H_
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698