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

Unified Diff: src/interpreter/bytecodes.h

Issue 1319833004: [Interpreter] Add support for property store operations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_implicit_ret
Patch Set: Add DCHECK Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/interpreter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecodes.h
diff --git a/src/interpreter/bytecodes.h b/src/interpreter/bytecodes.h
index 01552a35ec00123ade99950d60fb11774cea225b..9ab9c6fa5df8e18182fb7d4ef018c1f99d815122 100644
--- a/src/interpreter/bytecodes.h
+++ b/src/interpreter/bytecodes.h
@@ -23,34 +23,38 @@ namespace interpreter {
V(Reg)
// The list of bytecodes which are interpreted by the interpreter.
-#define BYTECODE_LIST(V) \
- \
- /* Loading the accumulator */ \
- V(LdaZero, OperandType::kNone) \
- V(LdaSmi8, OperandType::kImm8) \
- V(LdaConstant, OperandType::kIdx) \
- V(LdaUndefined, OperandType::kNone) \
- V(LdaNull, OperandType::kNone) \
- V(LdaTheHole, OperandType::kNone) \
- V(LdaTrue, OperandType::kNone) \
- V(LdaFalse, OperandType::kNone) \
- \
- /* Register-accumulator transfers */ \
- V(Ldar, OperandType::kReg) \
- V(Star, OperandType::kReg) \
- \
- /* LoadIC operations */ \
- V(LoadIC, OperandType::kReg, OperandType::kIdx) \
- V(KeyedLoadIC, OperandType::kReg, OperandType::kIdx) \
- \
- /* Binary Operators */ \
- V(Add, OperandType::kReg) \
- V(Sub, OperandType::kReg) \
- V(Mul, OperandType::kReg) \
- V(Div, OperandType::kReg) \
- V(Mod, OperandType::kReg) \
- \
- /* Control Flow */ \
+#define BYTECODE_LIST(V) \
+ \
+ /* Loading the accumulator */ \
+ V(LdaZero, OperandType::kNone) \
+ V(LdaSmi8, OperandType::kImm8) \
+ V(LdaConstant, OperandType::kIdx) \
+ V(LdaUndefined, OperandType::kNone) \
+ V(LdaNull, OperandType::kNone) \
+ V(LdaTheHole, OperandType::kNone) \
+ V(LdaTrue, OperandType::kNone) \
+ V(LdaFalse, OperandType::kNone) \
+ \
+ /* Register-accumulator transfers */ \
+ V(Ldar, OperandType::kReg) \
+ V(Star, OperandType::kReg) \
+ \
+ /* LoadIC operations */ \
+ V(LoadIC, OperandType::kReg, OperandType::kIdx) \
+ V(KeyedLoadIC, OperandType::kReg, OperandType::kIdx) \
+ \
+ /* StoreIC operations */ \
+ V(StoreIC, OperandType::kReg, OperandType::kReg, OperandType::kIdx) \
+ V(KeyedStoreIC, OperandType::kReg, OperandType::kReg, OperandType::kIdx) \
+ \
+ /* Binary Operators */ \
+ V(Add, OperandType::kReg) \
+ V(Sub, OperandType::kReg) \
+ V(Mul, OperandType::kReg) \
+ V(Div, OperandType::kReg) \
+ V(Mod, OperandType::kReg) \
+ \
+ /* Control Flow */ \
V(Return, OperandType::kNone)
@@ -87,13 +91,18 @@ class Register {
static const int kMaxRegisterIndex = 127;
static const int kMinRegisterIndex = -128;
+ Register() : index_(kIllegalIndex) {}
+
explicit Register(int index) : index_(index) {
DCHECK_LE(index_, kMaxRegisterIndex);
DCHECK_GE(index_, kMinRegisterIndex);
}
- int index() const { return index_; }
- bool is_parameter() const { return index_ < 0; }
+ int index() const {
+ DCHECK(index_ != kIllegalIndex);
+ return index_;
+ }
+ bool is_parameter() const { return index() < 0; }
static Register FromParameterIndex(int index, int parameter_count);
int ToParameterIndex(int parameter_count) const;
@@ -103,6 +112,8 @@ class Register {
uint8_t ToOperand() const;
private:
+ static const int kIllegalIndex = kMaxInt;
+
void* operator new(size_t size);
void operator delete(void* p);
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/interpreter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698