Index: src/interpreter/bytecodes.h |
diff --git a/src/interpreter/bytecodes.h b/src/interpreter/bytecodes.h |
index 5325472a834f9cce98634d8ef2c8762e473b8554..9357c0a8372b765a13c5dce6da88d4791bae09f1 100644 |
--- a/src/interpreter/bytecodes.h |
+++ b/src/interpreter/bytecodes.h |
@@ -104,7 +104,6 @@ namespace interpreter { |
V(LoadICStrict, OperandType::kReg8, OperandType::kIdx8, OperandType::kIdx8) \ |
V(KeyedLoadICSloppy, OperandType::kReg8, OperandType::kIdx8) \ |
V(KeyedLoadICStrict, OperandType::kReg8, OperandType::kIdx8) \ |
- /* TODO(rmcilroy): Wide register operands too? */ \ |
V(LoadICSloppyWide, OperandType::kReg8, OperandType::kIdx16, \ |
OperandType::kIdx16) \ |
V(LoadICStrictWide, OperandType::kReg8, OperandType::kIdx16, \ |
@@ -119,7 +118,6 @@ namespace interpreter { |
OperandType::kIdx8) \ |
V(KeyedStoreICStrict, OperandType::kReg8, OperandType::kReg8, \ |
OperandType::kIdx8) \ |
- /* TODO(rmcilroy): Wide register operands too? */ \ |
V(StoreICSloppyWide, OperandType::kReg8, OperandType::kIdx16, \ |
OperandType::kIdx16) \ |
V(StoreICStrictWide, OperandType::kReg8, OperandType::kIdx16, \ |
@@ -298,10 +296,13 @@ class Register { |
} |
bool is_parameter() const { return index() < 0; } |
bool is_valid() const { return index_ != kIllegalIndex; } |
+ bool is_byte_operand() const; |
+ bool is_short_operand() const; |
static Register FromParameterIndex(int index, int parameter_count); |
int ToParameterIndex(int parameter_count) const; |
static int MaxParameterIndex(); |
+ static int MaxRegisterIndex(); |
// Returns the register for the function's closure object. |
static Register function_closure(); |
@@ -324,6 +325,8 @@ class Register { |
static Register FromRawOperand(uint32_t raw_operand); |
uint32_t ToRawOperand() const; |
+ static Register IllegalRegister() { return Register(kIllegalIndex); } |
rmcilroy
2016/01/22 17:50:56
This is just the same as Register(); I'm fine with
|
+ |
static bool AreContiguous(Register reg1, Register reg2, |
Register reg3 = Register(), |
Register reg4 = Register(), |
@@ -378,6 +381,9 @@ class Bytecodes { |
// Returns the number of operands expected by |bytecode|. |
static int NumberOfOperands(Bytecode bytecode); |
+ // Returns the number of register operands expected by |bytecode|. |
+ static int NumberOfRegisterOperands(Bytecode bytecode); |
+ |
// Return the i-th operand of |bytecode|. |
static OperandType GetOperandType(Bytecode bytecode, int i); |
@@ -394,31 +400,31 @@ class Bytecodes { |
// Returns the size of |operand|. |
static OperandSize SizeOfOperand(OperandType operand); |
- // Return true if the bytecode is a conditional jump taking |
+ // Returns true if the bytecode is a conditional jump taking |
// an immediate byte operand (OperandType::kImm8). |
static bool IsConditionalJumpImmediate(Bytecode bytecode); |
- // Return true if the bytecode is a conditional jump taking |
+ // Returns true if the bytecode is a conditional jump taking |
// a constant pool entry (OperandType::kIdx8). |
static bool IsConditionalJumpConstant(Bytecode bytecode); |
- // Return true if the bytecode is a conditional jump taking |
+ // Returns true if the bytecode is a conditional jump taking |
// a constant pool entry (OperandType::kIdx16). |
static bool IsConditionalJumpConstantWide(Bytecode bytecode); |
- // Return true if the bytecode is a conditional jump taking |
+ // Returns true if the bytecode is a conditional jump taking |
// any kind of operand. |
static bool IsConditionalJump(Bytecode bytecode); |
- // Return true if the bytecode is a jump or a conditional jump taking |
+ // Returns true if the bytecode is a jump or a conditional jump taking |
// an immediate byte operand (OperandType::kImm8). |
static bool IsJumpImmediate(Bytecode bytecode); |
- // Return true if the bytecode is a jump or conditional jump taking a |
+ // Returns true if the bytecode is a jump or conditional jump taking a |
// constant pool entry (OperandType::kIdx8). |
static bool IsJumpConstant(Bytecode bytecode); |
- // Return true if the bytecode is a jump or conditional jump taking a |
+ // Returns true if the bytecode is a jump or conditional jump taking a |
// constant pool entry (OperandType::kIdx16). |
static bool IsJumpConstantWide(Bytecode bytecode); |