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

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

Issue 1378523005: [Interpreter] Add support for global declarations and load/store of global variables (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_toplevel
Patch Set: Fix test 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
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/bytecodes.cc » ('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_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 25 matching lines...) Expand all
36 /* Loading the accumulator */ \ 36 /* Loading the accumulator */ \
37 V(LdaZero, OperandType::kNone) \ 37 V(LdaZero, OperandType::kNone) \
38 V(LdaSmi8, OperandType::kImm8) \ 38 V(LdaSmi8, OperandType::kImm8) \
39 V(LdaConstant, OperandType::kIdx8) \ 39 V(LdaConstant, OperandType::kIdx8) \
40 V(LdaUndefined, OperandType::kNone) \ 40 V(LdaUndefined, OperandType::kNone) \
41 V(LdaNull, OperandType::kNone) \ 41 V(LdaNull, OperandType::kNone) \
42 V(LdaTheHole, OperandType::kNone) \ 42 V(LdaTheHole, OperandType::kNone) \
43 V(LdaTrue, OperandType::kNone) \ 43 V(LdaTrue, OperandType::kNone) \
44 V(LdaFalse, OperandType::kNone) \ 44 V(LdaFalse, OperandType::kNone) \
45 \ 45 \
46 /* Load globals */ \ 46 /* Globals */ \
47 V(LdaGlobal, OperandType::kIdx8) \ 47 V(LdaGlobal, OperandType::kIdx8) \
48 V(StaGlobal, OperandType::kIdx8) \
49 \
50 /* Context operations */ \
51 V(LdaContextSlot, OperandType::kReg8, OperandType::kIdx8) \
48 \ 52 \
49 /* Register-accumulator transfers */ \ 53 /* Register-accumulator transfers */ \
50 V(Ldar, OperandType::kReg8) \ 54 V(Ldar, OperandType::kReg8) \
51 V(Star, OperandType::kReg8) \ 55 V(Star, OperandType::kReg8) \
52 \ 56 \
53 /* LoadIC operations */ \ 57 /* LoadIC operations */ \
54 V(LoadICSloppy, OperandType::kReg8, OperandType::kIdx8) \ 58 V(LoadICSloppy, OperandType::kReg8, OperandType::kIdx8) \
55 V(LoadICStrict, OperandType::kReg8, OperandType::kIdx8) \ 59 V(LoadICStrict, OperandType::kReg8, OperandType::kIdx8) \
56 V(KeyedLoadICSloppy, OperandType::kReg8, OperandType::kIdx8) \ 60 V(KeyedLoadICSloppy, OperandType::kReg8, OperandType::kIdx8) \
57 V(KeyedLoadICStrict, OperandType::kReg8, OperandType::kIdx8) \ 61 V(KeyedLoadICStrict, OperandType::kReg8, OperandType::kIdx8) \
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 int index() const { 160 int index() const {
157 DCHECK(index_ != kIllegalIndex); 161 DCHECK(index_ != kIllegalIndex);
158 return index_; 162 return index_;
159 } 163 }
160 bool is_parameter() const { return index() < 0; } 164 bool is_parameter() const { return index() < 0; }
161 165
162 static Register FromParameterIndex(int index, int parameter_count); 166 static Register FromParameterIndex(int index, int parameter_count);
163 int ToParameterIndex(int parameter_count) const; 167 int ToParameterIndex(int parameter_count) const;
164 static int MaxParameterIndex(); 168 static int MaxParameterIndex();
165 169
170 // Returns the register for the function's outer context.
171 static Register function_context();
172 bool is_function_context() const;
173
166 static Register FromOperand(uint8_t operand); 174 static Register FromOperand(uint8_t operand);
167 uint8_t ToOperand() const; 175 uint8_t ToOperand() const;
168 176
169 private: 177 private:
170 static const int kIllegalIndex = kMaxInt; 178 static const int kIllegalIndex = kMaxInt;
171 179
172 void* operator new(size_t size); 180 void* operator new(size_t size);
173 void operator delete(void* p); 181 void operator delete(void* p);
174 182
175 int index_; 183 int index_;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 244
237 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); 245 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode);
238 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); 246 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type);
239 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); 247 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type);
240 248
241 } // namespace interpreter 249 } // namespace interpreter
242 } // namespace internal 250 } // namespace internal
243 } // namespace v8 251 } // namespace v8
244 252
245 #endif // V8_INTERPRETER_BYTECODES_H_ 253 #endif // V8_INTERPRETER_BYTECODES_H_
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/bytecodes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698