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

Unified Diff: src/interpreter/bytecodes.h

Issue 1555713002: [Interpreter] Bytecodes for exchanging registers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 years, 12 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-array-iterator.cc ('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 5af551376893d3c1bf3c1f1df87e475343eb530f..5a3e46805f3b0df4ebbbbdcabd6548ca6a720341 100644
--- a/src/interpreter/bytecodes.h
+++ b/src/interpreter/bytecodes.h
@@ -25,12 +25,13 @@ namespace interpreter {
V(Count8, OperandSize::kByte) \
V(Imm8, OperandSize::kByte) \
V(Idx8, OperandSize::kByte) \
- V(Reg8, OperandSize::kByte) \
V(MaybeReg8, OperandSize::kByte) \
+ V(Reg8, OperandSize::kByte) \
\
/* Short operands. */ \
V(Count16, OperandSize::kShort) \
- V(Idx16, OperandSize::kShort)
+ V(Idx16, OperandSize::kShort) \
+ V(Reg16, OperandSize::kShort)
// The list of bytecodes which are interpreted by the interpreter.
#define BYTECODE_LIST(V) \
@@ -78,6 +79,8 @@ namespace interpreter {
\
/* Register-register transfers */ \
V(Mov, OperandType::kReg8, OperandType::kReg8) \
+ V(Exchange, OperandType::kReg8, OperandType::kReg16) \
+ V(ExchangeWide, OperandType::kReg16, OperandType::kReg16) \
\
/* LoadIC operations */ \
V(LoadICSloppy, OperandType::kReg8, OperandType::kIdx8, OperandType::kIdx8) \
@@ -249,15 +252,9 @@ enum class Bytecode : uint8_t {
// in its stack-frame. Register hold parameters, this, and expression values.
class Register {
public:
- 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);
- }
+ explicit Register(int index) : index_(index) {}
int index() const {
DCHECK(index_ != kIllegalIndex);
@@ -285,6 +282,9 @@ class Register {
static Register FromOperand(uint8_t operand);
uint8_t ToOperand() const;
+ static Register FromWideOperand(uint16_t operand);
+ uint16_t ToWideOperand() const;
+
static bool AreContiguous(Register reg1, Register reg2,
Register reg3 = Register(),
Register reg4 = Register(),
« no previous file with comments | « src/interpreter/bytecode-array-iterator.cc ('k') | src/interpreter/bytecodes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698