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

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

Issue 2557173004: [Interpreter] Allocate registers used as call arguments on-demand. (Closed)
Patch Set: Fix release build unused variable Created 4 years 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 | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/bytecode-register-allocator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_REGISTER_H_ 5 #ifndef V8_INTERPRETER_BYTECODE_REGISTER_H_
6 #define V8_INTERPRETER_BYTECODE_REGISTER_H_ 6 #define V8_INTERPRETER_BYTECODE_REGISTER_H_
7 7
8 #include "src/interpreter/bytecodes.h" 8 #include "src/interpreter/bytecodes.h"
9 9
10 #include "src/frames.h" 10 #include "src/frames.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 int index_; 99 int index_;
100 }; 100 };
101 101
102 class RegisterList { 102 class RegisterList {
103 public: 103 public:
104 RegisterList() : first_reg_index_(Register().index()), register_count_(0) {} 104 RegisterList() : first_reg_index_(Register().index()), register_count_(0) {}
105 RegisterList(int first_reg_index, int register_count) 105 RegisterList(int first_reg_index, int register_count)
106 : first_reg_index_(first_reg_index), register_count_(register_count) {} 106 : first_reg_index_(first_reg_index), register_count_(register_count) {}
107 107
108 // Increases the size of the register list by one.
109 void IncrementRegisterCount() { register_count_++; }
110
108 // Returns a new RegisterList which is a truncated version of this list, with 111 // Returns a new RegisterList which is a truncated version of this list, with
109 // |count| registers. 112 // |count| registers.
110 const RegisterList Truncate(int new_count) { 113 const RegisterList Truncate(int new_count) {
111 DCHECK_GE(new_count, 0); 114 DCHECK_GE(new_count, 0);
112 DCHECK_LT(new_count, register_count_); 115 DCHECK_LT(new_count, register_count_);
113 return RegisterList(first_reg_index_, new_count); 116 return RegisterList(first_reg_index_, new_count);
114 } 117 }
115 118
116 const Register operator[](size_t i) const { 119 const Register operator[](size_t i) const {
117 DCHECK_LT(static_cast<int>(i), register_count_); 120 DCHECK_LT(static_cast<int>(i), register_count_);
(...skipping 13 matching lines...) Expand all
131 private: 134 private:
132 int first_reg_index_; 135 int first_reg_index_;
133 int register_count_; 136 int register_count_;
134 }; 137 };
135 138
136 } // namespace interpreter 139 } // namespace interpreter
137 } // namespace internal 140 } // namespace internal
138 } // namespace v8 141 } // namespace v8
139 142
140 #endif // V8_INTERPRETER_BYTECODE_REGISTER_H_ 143 #endif // V8_INTERPRETER_BYTECODE_REGISTER_H_
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/bytecode-register-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698