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

Unified Diff: src/interpreter/bytecodes.h

Issue 1613163002: [interpreter] Wide register support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 11 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-traits.h ('k') | src/interpreter/bytecodes.cc » ('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 aa5234924152f24a25383d980b2685749bd4d2db..741c20bfe7399ce2ba8ace56aef8bbf4203243c2 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, \
@@ -289,20 +287,22 @@ enum class Bytecode : uint8_t {
// in its stack-frame. Register hold parameters, this, and expression values.
class Register {
public:
- Register() : index_(kIllegalIndex) {}
-
- explicit Register(int index) : index_(index) {}
+ explicit Register(int index = kInvalidIndex) : index_(index) {}
int index() const {
- DCHECK(index_ != kIllegalIndex);
+ DCHECK(index_ != kInvalidIndex);
return index_;
}
bool is_parameter() const { return index() < 0; }
- bool is_valid() const { return index_ != kIllegalIndex; }
+ bool is_valid() const { return index_ != kInvalidIndex; }
+ 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();
+ static int MaxRegisterIndexForByteOperand();
// Returns the register for the function's closure object.
static Register function_closure();
@@ -350,7 +350,7 @@ class Register {
}
private:
- static const int kIllegalIndex = kMaxInt;
+ static const int kInvalidIndex = kMaxInt;
void* operator new(size_t size);
void operator delete(void* p);
@@ -379,6 +379,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);
@@ -389,37 +392,41 @@ class Bytecodes {
// of the bytecode.
static int GetOperandOffset(Bytecode bytecode, int i);
+ // Returns a zero-based bitmap of the register operand positions of
+ // |bytecode|.
+ static int GetRegisterOperandBitmap(Bytecode bytecode);
+
// Returns the size of the bytecode including its operands.
static int Size(Bytecode bytecode);
// 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);
« no previous file with comments | « src/interpreter/bytecode-traits.h ('k') | src/interpreter/bytecodes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698