Upgrade V8 to 5.1.281.57  DO NOT MERGE

FPIIM-449

Change-Id: Id981b686b4d587ac31697662eb98bb34be42ad90
(cherry picked from commit 3b9bc31999c9787eb726ecdbfd5796bfdec32a18)
diff --git a/src/interpreter/bytecodes.h b/src/interpreter/bytecodes.h
index d4863b1..2361271 100644
--- a/src/interpreter/bytecodes.h
+++ b/src/interpreter/bytecodes.h
@@ -15,37 +15,24 @@
 namespace internal {
 namespace interpreter {
 
-#define INVALID_OPERAND_TYPE_LIST(V) \
-  V(None, OperandSize::kNone)
+#define INVALID_OPERAND_TYPE_LIST(V) V(None, OperandTypeInfo::kNone)
 
-#define REGISTER_INPUT_OPERAND_TYPE_LIST(V) \
-  /* Byte operands. */                      \
-  V(MaybeReg8, OperandSize::kByte)          \
-  V(Reg8, OperandSize::kByte)               \
-  V(RegPair8, OperandSize::kByte)           \
-  /* Short operands. */                     \
-  V(MaybeReg16, OperandSize::kShort)        \
-  V(Reg16, OperandSize::kShort)             \
-  V(RegPair16, OperandSize::kShort)
+#define REGISTER_INPUT_OPERAND_TYPE_LIST(V)         \
+  V(MaybeReg, OperandTypeInfo::kScalableSignedByte) \
+  V(Reg, OperandTypeInfo::kScalableSignedByte)      \
+  V(RegPair, OperandTypeInfo::kScalableSignedByte)
 
-#define REGISTER_OUTPUT_OPERAND_TYPE_LIST(V) \
-  /* Byte operands. */                       \
-  V(RegOut8, OperandSize::kByte)             \
-  V(RegOutPair8, OperandSize::kByte)         \
-  V(RegOutTriple8, OperandSize::kByte)       \
-  /* Short operands. */                      \
-  V(RegOut16, OperandSize::kShort)           \
-  V(RegOutPair16, OperandSize::kShort)       \
-  V(RegOutTriple16, OperandSize::kShort)
+#define REGISTER_OUTPUT_OPERAND_TYPE_LIST(V)          \
+  V(RegOut, OperandTypeInfo::kScalableSignedByte)     \
+  V(RegOutPair, OperandTypeInfo::kScalableSignedByte) \
+  V(RegOutTriple, OperandTypeInfo::kScalableSignedByte)
 
-#define SCALAR_OPERAND_TYPE_LIST(V) \
-  /* Byte operands. */              \
-  V(Idx8, OperandSize::kByte)       \
-  V(Imm8, OperandSize::kByte)       \
-  V(RegCount8, OperandSize::kByte)  \
-  /* Short operands. */             \
-  V(Idx16, OperandSize::kShort)     \
-  V(RegCount16, OperandSize::kShort)
+#define SCALAR_OPERAND_TYPE_LIST(V)                   \
+  V(Flag8, OperandTypeInfo::kFixedUnsignedByte)       \
+  V(Idx, OperandTypeInfo::kScalableUnsignedByte)      \
+  V(Imm, OperandTypeInfo::kScalableSignedByte)        \
+  V(RegCount, OperandTypeInfo::kScalableUnsignedByte) \
+  V(RuntimeId, OperandTypeInfo::kFixedUnsignedShort)
 
 #define REGISTER_OPERAND_TYPE_LIST(V) \
   REGISTER_INPUT_OPERAND_TYPE_LIST(V) \
@@ -60,235 +47,258 @@
   NON_REGISTER_OPERAND_TYPE_LIST(V) \
   REGISTER_OPERAND_TYPE_LIST(V)
 
-// Define one debug break bytecode for each operands size.
-#define DEBUG_BREAK_BYTECODE_LIST(V)                                           \
-  V(DebugBreak0, OperandType::kNone)                                           \
-  V(DebugBreak1, OperandType::kReg8)                                           \
-  V(DebugBreak2, OperandType::kReg16)                                          \
-  V(DebugBreak3, OperandType::kReg16, OperandType::kReg8)                      \
-  V(DebugBreak4, OperandType::kReg16, OperandType::kReg16)                     \
-  V(DebugBreak5, OperandType::kReg16, OperandType::kReg16, OperandType::kReg8) \
-  V(DebugBreak6, OperandType::kReg16, OperandType::kReg16,                     \
-    OperandType::kReg16)                                                       \
-  V(DebugBreak7, OperandType::kReg16, OperandType::kReg16,                     \
-    OperandType::kReg16, OperandType::kReg8)                                   \
-  V(DebugBreak8, OperandType::kReg16, OperandType::kReg16,                     \
-    OperandType::kReg16, OperandType::kReg16)
+// Define one debug break bytecode for each possible size of unscaled
+// bytecodes. Format is V(<bytecode>, <accumulator_use>, <operands>).
+#define DEBUG_BREAK_PLAIN_BYTECODE_LIST(V)                                    \
+  V(DebugBreak0, AccumulatorUse::kRead)                                       \
+  V(DebugBreak1, AccumulatorUse::kRead, OperandType::kReg)                    \
+  V(DebugBreak2, AccumulatorUse::kRead, OperandType::kReg, OperandType::kReg) \
+  V(DebugBreak3, AccumulatorUse::kRead, OperandType::kReg, OperandType::kReg, \
+    OperandType::kReg)                                                        \
+  V(DebugBreak4, AccumulatorUse::kRead, OperandType::kReg, OperandType::kReg, \
+    OperandType::kReg, OperandType::kReg)                                     \
+  V(DebugBreak5, AccumulatorUse::kRead, OperandType::kRuntimeId,              \
+    OperandType::kReg, OperandType::kReg)                                     \
+  V(DebugBreak6, AccumulatorUse::kRead, OperandType::kRuntimeId,              \
+    OperandType::kReg, OperandType::kReg, OperandType::kReg)
+
+// Define one debug break for each widening prefix.
+#define DEBUG_BREAK_PREFIX_BYTECODE_LIST(V) \
+  V(DebugBreakWide, AccumulatorUse::kRead)  \
+  V(DebugBreakExtraWide, AccumulatorUse::kRead)
+
+#define DEBUG_BREAK_BYTECODE_LIST(V) \
+  DEBUG_BREAK_PLAIN_BYTECODE_LIST(V) \
+  DEBUG_BREAK_PREFIX_BYTECODE_LIST(V)
 
 // 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(LdaUndefined, OperandType::kNone)                                          \
-  V(LdaNull, OperandType::kNone)                                               \
-  V(LdaTheHole, OperandType::kNone)                                            \
-  V(LdaTrue, OperandType::kNone)                                               \
-  V(LdaFalse, OperandType::kNone)                                              \
-  V(LdaConstant, OperandType::kIdx8)                                           \
-  V(LdaConstantWide, OperandType::kIdx16)                                      \
-                                                                               \
-  /* Globals */                                                                \
-  V(LdaGlobal, OperandType::kIdx8, OperandType::kIdx8)                         \
-  V(LdaGlobalInsideTypeof, OperandType::kIdx8, OperandType::kIdx8)             \
-  V(LdaGlobalWide, OperandType::kIdx16, OperandType::kIdx16)                   \
-  V(LdaGlobalInsideTypeofWide, OperandType::kIdx16, OperandType::kIdx16)       \
-  V(StaGlobalSloppy, OperandType::kIdx8, OperandType::kIdx8)                   \
-  V(StaGlobalStrict, OperandType::kIdx8, OperandType::kIdx8)                   \
-  V(StaGlobalSloppyWide, OperandType::kIdx16, OperandType::kIdx16)             \
-  V(StaGlobalStrictWide, OperandType::kIdx16, OperandType::kIdx16)             \
-                                                                               \
-  /* Context operations */                                                     \
-  V(PushContext, OperandType::kReg8)                                           \
-  V(PopContext, OperandType::kReg8)                                            \
-  V(LdaContextSlot, OperandType::kReg8, OperandType::kIdx8)                    \
-  V(StaContextSlot, OperandType::kReg8, OperandType::kIdx8)                    \
-  V(LdaContextSlotWide, OperandType::kReg8, OperandType::kIdx16)               \
-  V(StaContextSlotWide, OperandType::kReg8, OperandType::kIdx16)               \
-                                                                               \
-  /* Load-Store lookup slots */                                                \
-  V(LdaLookupSlot, OperandType::kIdx8)                                         \
-  V(LdaLookupSlotInsideTypeof, OperandType::kIdx8)                             \
-  V(LdaLookupSlotWide, OperandType::kIdx16)                                    \
-  V(LdaLookupSlotInsideTypeofWide, OperandType::kIdx16)                        \
-  V(StaLookupSlotSloppy, OperandType::kIdx8)                                   \
-  V(StaLookupSlotStrict, OperandType::kIdx8)                                   \
-  V(StaLookupSlotSloppyWide, OperandType::kIdx16)                              \
-  V(StaLookupSlotStrictWide, OperandType::kIdx16)                              \
-                                                                               \
-  /* Register-accumulator transfers */                                         \
-  V(Ldar, OperandType::kReg8)                                                  \
-  V(Star, OperandType::kRegOut8)                                               \
-                                                                               \
-  /* Register-register transfers */                                            \
-  V(Mov, OperandType::kReg8, OperandType::kRegOut8)                            \
-  V(MovWide, OperandType::kReg16, OperandType::kRegOut16)                      \
-                                                                               \
-  /* LoadIC operations */                                                      \
-  V(LoadIC, OperandType::kReg8, OperandType::kIdx8, OperandType::kIdx8)        \
-  V(KeyedLoadIC, OperandType::kReg8, OperandType::kIdx8)                       \
-  V(LoadICWide, OperandType::kReg8, OperandType::kIdx16, OperandType::kIdx16)  \
-  V(KeyedLoadICWide, OperandType::kReg8, OperandType::kIdx16)                  \
-                                                                               \
-  /* StoreIC operations */                                                     \
-  V(StoreICSloppy, OperandType::kReg8, OperandType::kIdx8, OperandType::kIdx8) \
-  V(StoreICStrict, OperandType::kReg8, OperandType::kIdx8, OperandType::kIdx8) \
-  V(KeyedStoreICSloppy, OperandType::kReg8, OperandType::kReg8,                \
-    OperandType::kIdx8)                                                        \
-  V(KeyedStoreICStrict, OperandType::kReg8, OperandType::kReg8,                \
-    OperandType::kIdx8)                                                        \
-  V(StoreICSloppyWide, OperandType::kReg8, OperandType::kIdx16,                \
-    OperandType::kIdx16)                                                       \
-  V(StoreICStrictWide, OperandType::kReg8, OperandType::kIdx16,                \
-    OperandType::kIdx16)                                                       \
-  V(KeyedStoreICSloppyWide, OperandType::kReg8, OperandType::kReg8,            \
-    OperandType::kIdx16)                                                       \
-  V(KeyedStoreICStrictWide, OperandType::kReg8, OperandType::kReg8,            \
-    OperandType::kIdx16)                                                       \
-                                                                               \
-  /* Binary Operators */                                                       \
-  V(Add, OperandType::kReg8)                                                   \
-  V(Sub, OperandType::kReg8)                                                   \
-  V(Mul, OperandType::kReg8)                                                   \
-  V(Div, OperandType::kReg8)                                                   \
-  V(Mod, OperandType::kReg8)                                                   \
-  V(BitwiseOr, OperandType::kReg8)                                             \
-  V(BitwiseXor, OperandType::kReg8)                                            \
-  V(BitwiseAnd, OperandType::kReg8)                                            \
-  V(ShiftLeft, OperandType::kReg8)                                             \
-  V(ShiftRight, OperandType::kReg8)                                            \
-  V(ShiftRightLogical, OperandType::kReg8)                                     \
-                                                                               \
-  /* Unary Operators */                                                        \
-  V(Inc, OperandType::kNone)                                                   \
-  V(Dec, OperandType::kNone)                                                   \
-  V(LogicalNot, OperandType::kNone)                                            \
-  V(TypeOf, OperandType::kNone)                                                \
-  V(DeletePropertyStrict, OperandType::kReg8)                                  \
-  V(DeletePropertySloppy, OperandType::kReg8)                                  \
-                                                                               \
-  /* Call operations */                                                        \
-  V(Call, OperandType::kReg8, OperandType::kReg8, OperandType::kRegCount8,     \
-    OperandType::kIdx8)                                                        \
-  V(CallWide, OperandType::kReg16, OperandType::kReg16,                        \
-    OperandType::kRegCount16, OperandType::kIdx16)                             \
-  V(TailCall, OperandType::kReg8, OperandType::kReg8, OperandType::kRegCount8, \
-    OperandType::kIdx8)                                                        \
-  V(TailCallWide, OperandType::kReg16, OperandType::kReg16,                    \
-    OperandType::kRegCount16, OperandType::kIdx16)                             \
-  V(CallRuntime, OperandType::kIdx16, OperandType::kMaybeReg8,                 \
-    OperandType::kRegCount8)                                                   \
-  V(CallRuntimeWide, OperandType::kIdx16, OperandType::kMaybeReg16,            \
-    OperandType::kRegCount8)                                                   \
-  V(CallRuntimeForPair, OperandType::kIdx16, OperandType::kMaybeReg8,          \
-    OperandType::kRegCount8, OperandType::kRegOutPair8)                        \
-  V(CallRuntimeForPairWide, OperandType::kIdx16, OperandType::kMaybeReg16,     \
-    OperandType::kRegCount8, OperandType::kRegOutPair16)                       \
-  V(CallJSRuntime, OperandType::kIdx16, OperandType::kReg8,                    \
-    OperandType::kRegCount8)                                                   \
-  V(CallJSRuntimeWide, OperandType::kIdx16, OperandType::kReg16,               \
-    OperandType::kRegCount16)                                                  \
-                                                                               \
-  /* New operator */                                                           \
-  V(New, OperandType::kReg8, OperandType::kMaybeReg8, OperandType::kRegCount8) \
-  V(NewWide, OperandType::kReg16, OperandType::kMaybeReg16,                    \
-    OperandType::kRegCount16)                                                  \
-                                                                               \
-  /* Test Operators */                                                         \
-  V(TestEqual, OperandType::kReg8)                                             \
-  V(TestNotEqual, OperandType::kReg8)                                          \
-  V(TestEqualStrict, OperandType::kReg8)                                       \
-  V(TestNotEqualStrict, OperandType::kReg8)                                    \
-  V(TestLessThan, OperandType::kReg8)                                          \
-  V(TestGreaterThan, OperandType::kReg8)                                       \
-  V(TestLessThanOrEqual, OperandType::kReg8)                                   \
-  V(TestGreaterThanOrEqual, OperandType::kReg8)                                \
-  V(TestInstanceOf, OperandType::kReg8)                                        \
-  V(TestIn, OperandType::kReg8)                                                \
-                                                                               \
-  /* Cast operators */                                                         \
-  V(ToName, OperandType::kNone)                                                \
-  V(ToNumber, OperandType::kNone)                                              \
-  V(ToObject, OperandType::kNone)                                              \
-                                                                               \
-  /* Literals */                                                               \
-  V(CreateRegExpLiteral, OperandType::kIdx8, OperandType::kIdx8,               \
-    OperandType::kImm8)                                                        \
-  V(CreateArrayLiteral, OperandType::kIdx8, OperandType::kIdx8,                \
-    OperandType::kImm8)                                                        \
-  V(CreateObjectLiteral, OperandType::kIdx8, OperandType::kIdx8,               \
-    OperandType::kImm8)                                                        \
-  V(CreateRegExpLiteralWide, OperandType::kIdx16, OperandType::kIdx16,         \
-    OperandType::kImm8)                                                        \
-  V(CreateArrayLiteralWide, OperandType::kIdx16, OperandType::kIdx16,          \
-    OperandType::kImm8)                                                        \
-  V(CreateObjectLiteralWide, OperandType::kIdx16, OperandType::kIdx16,         \
-    OperandType::kImm8)                                                        \
-                                                                               \
-  /* Closure allocation */                                                     \
-  V(CreateClosure, OperandType::kIdx8, OperandType::kImm8)                     \
-  V(CreateClosureWide, OperandType::kIdx16, OperandType::kImm8)                \
-                                                                               \
-  /* Arguments allocation */                                                   \
-  V(CreateMappedArguments, OperandType::kNone)                                 \
-  V(CreateUnmappedArguments, OperandType::kNone)                               \
-  V(CreateRestParameter, OperandType::kNone)                                   \
-                                                                               \
-  /* Control Flow */                                                           \
-  V(Jump, OperandType::kImm8)                                                  \
-  V(JumpConstant, OperandType::kIdx8)                                          \
-  V(JumpConstantWide, OperandType::kIdx16)                                     \
-  V(JumpIfTrue, OperandType::kImm8)                                            \
-  V(JumpIfTrueConstant, OperandType::kIdx8)                                    \
-  V(JumpIfTrueConstantWide, OperandType::kIdx16)                               \
-  V(JumpIfFalse, OperandType::kImm8)                                           \
-  V(JumpIfFalseConstant, OperandType::kIdx8)                                   \
-  V(JumpIfFalseConstantWide, OperandType::kIdx16)                              \
-  V(JumpIfToBooleanTrue, OperandType::kImm8)                                   \
-  V(JumpIfToBooleanTrueConstant, OperandType::kIdx8)                           \
-  V(JumpIfToBooleanTrueConstantWide, OperandType::kIdx16)                      \
-  V(JumpIfToBooleanFalse, OperandType::kImm8)                                  \
-  V(JumpIfToBooleanFalseConstant, OperandType::kIdx8)                          \
-  V(JumpIfToBooleanFalseConstantWide, OperandType::kIdx16)                     \
-  V(JumpIfNull, OperandType::kImm8)                                            \
-  V(JumpIfNullConstant, OperandType::kIdx8)                                    \
-  V(JumpIfNullConstantWide, OperandType::kIdx16)                               \
-  V(JumpIfUndefined, OperandType::kImm8)                                       \
-  V(JumpIfUndefinedConstant, OperandType::kIdx8)                               \
-  V(JumpIfUndefinedConstantWide, OperandType::kIdx16)                          \
-  V(JumpIfNotHole, OperandType::kImm8)                                         \
-  V(JumpIfNotHoleConstant, OperandType::kIdx8)                                 \
-  V(JumpIfNotHoleConstantWide, OperandType::kIdx16)                            \
-                                                                               \
-  /* Complex flow control For..in */                                           \
-  V(ForInPrepare, OperandType::kRegOutTriple8)                                 \
-  V(ForInPrepareWide, OperandType::kRegOutTriple16)                            \
-  V(ForInDone, OperandType::kReg8, OperandType::kReg8)                         \
-  V(ForInNext, OperandType::kReg8, OperandType::kReg8, OperandType::kRegPair8) \
-  V(ForInNextWide, OperandType::kReg16, OperandType::kReg16,                   \
-    OperandType::kRegPair16)                                                   \
-  V(ForInStep, OperandType::kReg8)                                             \
-                                                                               \
-  /* Perform a stack guard check */                                            \
-  V(StackCheck, OperandType::kNone)                                            \
-                                                                               \
-  /* Non-local flow control */                                                 \
-  V(Throw, OperandType::kNone)                                                 \
-  V(ReThrow, OperandType::kNone)                                               \
-  V(Return, OperandType::kNone)                                                \
-                                                                               \
-  /* Debugger */                                                               \
-  V(Debugger, OperandType::kNone)                                              \
-  DEBUG_BREAK_BYTECODE_LIST(V)
+#define BYTECODE_LIST(V)                                                      \
+  /* Extended width operands */                                               \
+  V(Wide, AccumulatorUse::kNone)                                              \
+  V(ExtraWide, AccumulatorUse::kNone)                                         \
+                                                                              \
+  /* Loading the accumulator */                                               \
+  V(LdaZero, AccumulatorUse::kWrite)                                          \
+  V(LdaSmi, AccumulatorUse::kWrite, OperandType::kImm)                        \
+  V(LdaUndefined, AccumulatorUse::kWrite)                                     \
+  V(LdaNull, AccumulatorUse::kWrite)                                          \
+  V(LdaTheHole, AccumulatorUse::kWrite)                                       \
+  V(LdaTrue, AccumulatorUse::kWrite)                                          \
+  V(LdaFalse, AccumulatorUse::kWrite)                                         \
+  V(LdaConstant, AccumulatorUse::kWrite, OperandType::kIdx)                   \
+                                                                              \
+  /* Globals */                                                               \
+  V(LdaGlobal, AccumulatorUse::kWrite, OperandType::kIdx, OperandType::kIdx)  \
+  V(LdaGlobalInsideTypeof, AccumulatorUse::kWrite, OperandType::kIdx,         \
+    OperandType::kIdx)                                                        \
+  V(StaGlobalSloppy, AccumulatorUse::kRead, OperandType::kIdx,                \
+    OperandType::kIdx)                                                        \
+  V(StaGlobalStrict, AccumulatorUse::kRead, OperandType::kIdx,                \
+    OperandType::kIdx)                                                        \
+                                                                              \
+  /* Context operations */                                                    \
+  V(PushContext, AccumulatorUse::kRead, OperandType::kReg)                    \
+  V(PopContext, AccumulatorUse::kNone, OperandType::kReg)                     \
+  V(LdaContextSlot, AccumulatorUse::kWrite, OperandType::kReg,                \
+    OperandType::kIdx)                                                        \
+  V(StaContextSlot, AccumulatorUse::kRead, OperandType::kReg,                 \
+    OperandType::kIdx)                                                        \
+                                                                              \
+  /* Load-Store lookup slots */                                               \
+  V(LdaLookupSlot, AccumulatorUse::kWrite, OperandType::kIdx)                 \
+  V(LdaLookupSlotInsideTypeof, AccumulatorUse::kWrite, OperandType::kIdx)     \
+  V(StaLookupSlotSloppy, AccumulatorUse::kReadWrite, OperandType::kIdx)       \
+  V(StaLookupSlotStrict, AccumulatorUse::kReadWrite, OperandType::kIdx)       \
+                                                                              \
+  /* Register-accumulator transfers */                                        \
+  V(Ldar, AccumulatorUse::kWrite, OperandType::kReg)                          \
+  V(Star, AccumulatorUse::kRead, OperandType::kRegOut)                        \
+                                                                              \
+  /* Register-register transfers */                                           \
+  V(Mov, AccumulatorUse::kNone, OperandType::kReg, OperandType::kRegOut)      \
+                                                                              \
+  /* LoadIC operations */                                                     \
+  V(LoadIC, AccumulatorUse::kWrite, OperandType::kReg, OperandType::kIdx,     \
+    OperandType::kIdx)                                                        \
+  V(KeyedLoadIC, AccumulatorUse::kReadWrite, OperandType::kReg,               \
+    OperandType::kIdx)                                                        \
+                                                                              \
+  /* StoreIC operations */                                                    \
+  V(StoreICSloppy, AccumulatorUse::kRead, OperandType::kReg,                  \
+    OperandType::kIdx, OperandType::kIdx)                                     \
+  V(StoreICStrict, AccumulatorUse::kRead, OperandType::kReg,                  \
+    OperandType::kIdx, OperandType::kIdx)                                     \
+  V(KeyedStoreICSloppy, AccumulatorUse::kRead, OperandType::kReg,             \
+    OperandType::kReg, OperandType::kIdx)                                     \
+  V(KeyedStoreICStrict, AccumulatorUse::kRead, OperandType::kReg,             \
+    OperandType::kReg, OperandType::kIdx)                                     \
+                                                                              \
+  /* Binary Operators */                                                      \
+  V(Add, AccumulatorUse::kReadWrite, OperandType::kReg)                       \
+  V(Sub, AccumulatorUse::kReadWrite, OperandType::kReg)                       \
+  V(Mul, AccumulatorUse::kReadWrite, OperandType::kReg)                       \
+  V(Div, AccumulatorUse::kReadWrite, OperandType::kReg)                       \
+  V(Mod, AccumulatorUse::kReadWrite, OperandType::kReg)                       \
+  V(BitwiseOr, AccumulatorUse::kReadWrite, OperandType::kReg)                 \
+  V(BitwiseXor, AccumulatorUse::kReadWrite, OperandType::kReg)                \
+  V(BitwiseAnd, AccumulatorUse::kReadWrite, OperandType::kReg)                \
+  V(ShiftLeft, AccumulatorUse::kReadWrite, OperandType::kReg)                 \
+  V(ShiftRight, AccumulatorUse::kReadWrite, OperandType::kReg)                \
+  V(ShiftRightLogical, AccumulatorUse::kReadWrite, OperandType::kReg)         \
+                                                                              \
+  /* Unary Operators */                                                       \
+  V(Inc, AccumulatorUse::kReadWrite)                                          \
+  V(Dec, AccumulatorUse::kReadWrite)                                          \
+  V(LogicalNot, AccumulatorUse::kReadWrite)                                   \
+  V(TypeOf, AccumulatorUse::kReadWrite)                                       \
+  V(DeletePropertyStrict, AccumulatorUse::kReadWrite, OperandType::kReg)      \
+  V(DeletePropertySloppy, AccumulatorUse::kReadWrite, OperandType::kReg)      \
+                                                                              \
+  /* Call operations */                                                       \
+  V(Call, AccumulatorUse::kWrite, OperandType::kReg, OperandType::kReg,       \
+    OperandType::kRegCount, OperandType::kIdx)                                \
+  V(TailCall, AccumulatorUse::kWrite, OperandType::kReg, OperandType::kReg,   \
+    OperandType::kRegCount, OperandType::kIdx)                                \
+  V(CallRuntime, AccumulatorUse::kWrite, OperandType::kRuntimeId,             \
+    OperandType::kMaybeReg, OperandType::kRegCount)                           \
+  V(CallRuntimeForPair, AccumulatorUse::kNone, OperandType::kRuntimeId,       \
+    OperandType::kMaybeReg, OperandType::kRegCount, OperandType::kRegOutPair) \
+  V(CallJSRuntime, AccumulatorUse::kWrite, OperandType::kIdx,                 \
+    OperandType::kReg, OperandType::kRegCount)                                \
+                                                                              \
+  /* Intrinsics */                                                            \
+  V(InvokeIntrinsic, AccumulatorUse::kWrite, OperandType::kRuntimeId,         \
+    OperandType::kMaybeReg, OperandType::kRegCount)                           \
+                                                                              \
+  /* New operator */                                                          \
+  V(New, AccumulatorUse::kReadWrite, OperandType::kReg,                       \
+    OperandType::kMaybeReg, OperandType::kRegCount)                           \
+                                                                              \
+  /* Test Operators */                                                        \
+  V(TestEqual, AccumulatorUse::kReadWrite, OperandType::kReg)                 \
+  V(TestNotEqual, AccumulatorUse::kReadWrite, OperandType::kReg)              \
+  V(TestEqualStrict, AccumulatorUse::kReadWrite, OperandType::kReg)           \
+  V(TestLessThan, AccumulatorUse::kReadWrite, OperandType::kReg)              \
+  V(TestGreaterThan, AccumulatorUse::kReadWrite, OperandType::kReg)           \
+  V(TestLessThanOrEqual, AccumulatorUse::kReadWrite, OperandType::kReg)       \
+  V(TestGreaterThanOrEqual, AccumulatorUse::kReadWrite, OperandType::kReg)    \
+  V(TestInstanceOf, AccumulatorUse::kReadWrite, OperandType::kReg)            \
+  V(TestIn, AccumulatorUse::kReadWrite, OperandType::kReg)                    \
+                                                                              \
+  /* Cast operators */                                                        \
+  V(ToName, AccumulatorUse::kReadWrite)                                       \
+  V(ToNumber, AccumulatorUse::kReadWrite)                                     \
+  V(ToObject, AccumulatorUse::kReadWrite)                                     \
+                                                                              \
+  /* Literals */                                                              \
+  V(CreateRegExpLiteral, AccumulatorUse::kWrite, OperandType::kIdx,           \
+    OperandType::kIdx, OperandType::kFlag8)                                   \
+  V(CreateArrayLiteral, AccumulatorUse::kWrite, OperandType::kIdx,            \
+    OperandType::kIdx, OperandType::kFlag8)                                   \
+  V(CreateObjectLiteral, AccumulatorUse::kWrite, OperandType::kIdx,           \
+    OperandType::kIdx, OperandType::kFlag8)                                   \
+                                                                              \
+  /* Closure allocation */                                                    \
+  V(CreateClosure, AccumulatorUse::kWrite, OperandType::kIdx,                 \
+    OperandType::kFlag8)                                                      \
+                                                                              \
+  /* Arguments allocation */                                                  \
+  V(CreateMappedArguments, AccumulatorUse::kWrite)                            \
+  V(CreateUnmappedArguments, AccumulatorUse::kWrite)                          \
+  V(CreateRestParameter, AccumulatorUse::kWrite)                              \
+                                                                              \
+  /* Control Flow */                                                          \
+  V(Jump, AccumulatorUse::kNone, OperandType::kImm)                           \
+  V(JumpConstant, AccumulatorUse::kNone, OperandType::kIdx)                   \
+  V(JumpIfTrue, AccumulatorUse::kRead, OperandType::kImm)                     \
+  V(JumpIfTrueConstant, AccumulatorUse::kRead, OperandType::kIdx)             \
+  V(JumpIfFalse, AccumulatorUse::kRead, OperandType::kImm)                    \
+  V(JumpIfFalseConstant, AccumulatorUse::kRead, OperandType::kIdx)            \
+  V(JumpIfToBooleanTrue, AccumulatorUse::kRead, OperandType::kImm)            \
+  V(JumpIfToBooleanTrueConstant, AccumulatorUse::kRead, OperandType::kIdx)    \
+  V(JumpIfToBooleanFalse, AccumulatorUse::kRead, OperandType::kImm)           \
+  V(JumpIfToBooleanFalseConstant, AccumulatorUse::kRead, OperandType::kIdx)   \
+  V(JumpIfNull, AccumulatorUse::kRead, OperandType::kImm)                     \
+  V(JumpIfNullConstant, AccumulatorUse::kRead, OperandType::kIdx)             \
+  V(JumpIfUndefined, AccumulatorUse::kRead, OperandType::kImm)                \
+  V(JumpIfUndefinedConstant, AccumulatorUse::kRead, OperandType::kIdx)        \
+  V(JumpIfNotHole, AccumulatorUse::kRead, OperandType::kImm)                  \
+  V(JumpIfNotHoleConstant, AccumulatorUse::kRead, OperandType::kIdx)          \
+                                                                              \
+  /* Complex flow control For..in */                                          \
+  V(ForInPrepare, AccumulatorUse::kRead, OperandType::kRegOutTriple)          \
+  V(ForInDone, AccumulatorUse::kWrite, OperandType::kReg, OperandType::kReg)  \
+  V(ForInNext, AccumulatorUse::kWrite, OperandType::kReg, OperandType::kReg,  \
+    OperandType::kRegPair, OperandType::kIdx)                                 \
+  V(ForInStep, AccumulatorUse::kWrite, OperandType::kReg)                     \
+                                                                              \
+  /* Perform a stack guard check */                                           \
+  V(StackCheck, AccumulatorUse::kNone)                                        \
+                                                                              \
+  /* Non-local flow control */                                                \
+  V(Throw, AccumulatorUse::kRead)                                             \
+  V(ReThrow, AccumulatorUse::kRead)                                           \
+  V(Return, AccumulatorUse::kNone)                                            \
+                                                                              \
+  /* Debugger */                                                              \
+  V(Debugger, AccumulatorUse::kNone)                                          \
+  DEBUG_BREAK_BYTECODE_LIST(V)                                                \
+                                                                              \
+  /* Illegal bytecode (terminates execution) */                               \
+  V(Illegal, AccumulatorUse::kNone)
 
-// Enumeration of the size classes of operand types used by bytecodes.
+enum class AccumulatorUse : uint8_t {
+  kNone = 0,
+  kRead = 1 << 0,
+  kWrite = 1 << 1,
+  kReadWrite = kRead | kWrite
+};
+
+V8_INLINE AccumulatorUse operator&(AccumulatorUse lhs, AccumulatorUse rhs) {
+  int result = static_cast<int>(lhs) & static_cast<int>(rhs);
+  return static_cast<AccumulatorUse>(result);
+}
+
+V8_INLINE AccumulatorUse operator|(AccumulatorUse lhs, AccumulatorUse rhs) {
+  int result = static_cast<int>(lhs) | static_cast<int>(rhs);
+  return static_cast<AccumulatorUse>(result);
+}
+
+// Enumeration of scaling factors applicable to scalable operands. Code
+// relies on being able to cast values to integer scaling values.
+enum class OperandScale : uint8_t {
+  kSingle = 1,
+  kDouble = 2,
+  kQuadruple = 4,
+  kMaxValid = kQuadruple,
+  kInvalid = 8,
+};
+
+// Enumeration of the size classes of operand types used by
+// bytecodes. Code relies on being able to cast values to integer
+// types to get the size in bytes.
 enum class OperandSize : uint8_t {
   kNone = 0,
   kByte = 1,
   kShort = 2,
+  kQuad = 4,
+  kLast = kQuad
 };
 
+// Primitive operand info used that summarize properties of operands.
+// Columns are Name, IsScalable, IsUnsigned, UnscaledSize.
+#define OPERAND_TYPE_INFO_LIST(V)                         \
+  V(None, false, false, OperandSize::kNone)               \
+  V(ScalableSignedByte, true, false, OperandSize::kByte)  \
+  V(ScalableUnsignedByte, true, true, OperandSize::kByte) \
+  V(FixedUnsignedByte, false, true, OperandSize::kByte)   \
+  V(FixedUnsignedShort, false, true, OperandSize::kShort)
+
+enum class OperandTypeInfo : uint8_t {
+#define DECLARE_OPERAND_TYPE_INFO(Name, ...) k##Name,
+  OPERAND_TYPE_INFO_LIST(DECLARE_OPERAND_TYPE_INFO)
+#undef DECLARE_OPERAND_TYPE_INFO
+};
 
 // Enumeration of operand types used by bytecodes.
 enum class OperandType : uint8_t {
@@ -330,9 +340,6 @@
 
   static Register FromParameterIndex(int index, int parameter_count);
   int ToParameterIndex(int parameter_count) const;
-  static int MaxParameterIndex();
-  static int MaxRegisterIndex();
-  static int MaxRegisterIndexForByteOperand();
 
   // Returns an invalid register.
   static Register invalid_value() { return Register(); }
@@ -349,14 +356,8 @@
   static Register new_target();
   bool is_new_target() const;
 
-  static Register FromOperand(uint8_t operand);
-  uint8_t ToOperand() const;
-
-  static Register FromWideOperand(uint16_t operand);
-  uint16_t ToWideOperand() const;
-
-  static Register FromRawOperand(uint32_t raw_operand);
-  uint32_t ToRawOperand() const;
+  int32_t ToOperand() const { return -index_; }
+  static Register FromOperand(int32_t operand) { return Register(-operand); }
 
   static bool AreContiguous(Register reg1, Register reg2,
                             Register reg3 = Register(),
@@ -399,9 +400,18 @@
   // Returns string representation of |bytecode|.
   static const char* ToString(Bytecode bytecode);
 
+  // Returns string representation of |bytecode|.
+  static std::string ToString(Bytecode bytecode, OperandScale operand_scale);
+
+  // Returns string representation of |accumulator_use|.
+  static const char* AccumulatorUseToString(AccumulatorUse accumulator_use);
+
   // Returns string representation of |operand_type|.
   static const char* OperandTypeToString(OperandType operand_type);
 
+  // Returns string representation of |operand_scale|.
+  static const char* OperandScaleToString(OperandScale operand_scale);
+
   // Returns string representation of |operand_size|.
   static const char* OperandSizeToString(OperandSize operand_size);
 
@@ -417,57 +427,72 @@
   // Returns the number of register operands expected by |bytecode|.
   static int NumberOfRegisterOperands(Bytecode bytecode);
 
+  // Returns the prefix bytecode representing an operand scale to be
+  // applied to a a bytecode.
+  static Bytecode OperandScaleToPrefixBytecode(OperandScale operand_scale);
+
+  // Returns true if the operand scale requires a prefix bytecode.
+  static bool OperandScaleRequiresPrefixBytecode(OperandScale operand_scale);
+
+  // Returns the scaling applied to scalable operands if bytecode is
+  // is a scaling prefix.
+  static OperandScale PrefixBytecodeToOperandScale(Bytecode bytecode);
+
+  // Returns how accumulator is used by |bytecode|.
+  static AccumulatorUse GetAccumulatorUse(Bytecode bytecode);
+
+  // Returns true if |bytecode| reads the accumulator.
+  static bool ReadsAccumulator(Bytecode bytecode);
+
+  // Returns true if |bytecode| writes the accumulator.
+  static bool WritesAccumulator(Bytecode bytecode);
+
   // Returns the i-th operand of |bytecode|.
   static OperandType GetOperandType(Bytecode bytecode, int i);
 
   // Returns the size of the i-th operand of |bytecode|.
-  static OperandSize GetOperandSize(Bytecode bytecode, int i);
+  static OperandSize GetOperandSize(Bytecode bytecode, int i,
+                                    OperandScale operand_scale);
 
   // Returns the offset of the i-th operand of |bytecode| relative to the start
   // of the bytecode.
-  static int GetOperandOffset(Bytecode bytecode, int i);
+  static int GetOperandOffset(Bytecode bytecode, int i,
+                              OperandScale operand_scale);
 
   // Returns a zero-based bitmap of the register operand positions of
   // |bytecode|.
   static int GetRegisterOperandBitmap(Bytecode bytecode);
 
-  // Returns a debug break bytecode with a matching operand size.
+  // Returns a debug break bytecode to replace |bytecode|.
   static Bytecode GetDebugBreak(Bytecode bytecode);
 
-  // Returns the size of the bytecode including its operands.
-  static int Size(Bytecode bytecode);
+  // Returns the size of the bytecode including its operands for the
+  // given |operand_scale|.
+  static int Size(Bytecode bytecode, OperandScale operand_scale);
 
   // Returns the size of |operand|.
-  static OperandSize SizeOfOperand(OperandType operand);
+  static OperandSize SizeOfOperand(OperandType operand, OperandScale scale);
 
   // Returns true if the bytecode is a conditional jump taking
-  // an immediate byte operand (OperandType::kImm8).
+  // an immediate byte operand (OperandType::kImm).
   static bool IsConditionalJumpImmediate(Bytecode bytecode);
 
   // Returns true if the bytecode is a conditional jump taking
-  // a constant pool entry (OperandType::kIdx8).
+  // a constant pool entry (OperandType::kIdx).
   static bool IsConditionalJumpConstant(Bytecode bytecode);
 
   // Returns true if the bytecode is a conditional jump taking
-  // a constant pool entry (OperandType::kIdx16).
-  static bool IsConditionalJumpConstantWide(Bytecode bytecode);
-
-  // Returns true if the bytecode is a conditional jump taking
   // any kind of operand.
   static bool IsConditionalJump(Bytecode bytecode);
 
   // Returns true if the bytecode is a jump or a conditional jump taking
-  // an immediate byte operand (OperandType::kImm8).
+  // an immediate byte operand (OperandType::kImm).
   static bool IsJumpImmediate(Bytecode bytecode);
 
   // Returns true if the bytecode is a jump or conditional jump taking a
-  // constant pool entry (OperandType::kIdx8).
+  // constant pool entry (OperandType::kIdx).
   static bool IsJumpConstant(Bytecode bytecode);
 
-  // Returns true if the bytecode is a jump or conditional jump taking a
-  // constant pool entry (OperandType::kIdx16).
-  static bool IsJumpConstantWide(Bytecode bytecode);
-
   // Returns true if the bytecode is a jump or conditional jump taking
   // any kind of operand.
   static bool IsJump(Bytecode bytecode);
@@ -478,18 +503,17 @@
   // Returns true if the bytecode is a call or a constructor call.
   static bool IsCallOrNew(Bytecode bytecode);
 
+  // Returns true if the bytecode is a call to the runtime.
+  static bool IsCallRuntime(Bytecode bytecode);
+
   // Returns true if the bytecode is a debug break.
   static bool IsDebugBreak(Bytecode bytecode);
 
-  // Returns true if |operand_type| is a register index operand (kIdx8/kIdx16).
-  static bool IsIndexOperandType(OperandType operand_type);
+  // Returns true if the bytecode has wider operand forms.
+  static bool IsBytecodeWithScalableOperands(Bytecode bytecode);
 
-  // Returns true if |operand_type| represents an immediate.
-  static bool IsImmediateOperandType(OperandType operand_type);
-
-  // Returns true if |operand_type| is a register count operand
-  // (kRegCount8/kRegCount16).
-  static bool IsRegisterCountOperandType(OperandType operand_type);
+  // Returns true if the bytecode is a scaling prefix bytecode.
+  static bool IsPrefixScalingBytecode(Bytecode bytecode);
 
   // Returns true if |operand_type| is any type of register operand.
   static bool IsRegisterOperandType(OperandType operand_type);
@@ -501,20 +525,52 @@
   static bool IsRegisterOutputOperandType(OperandType operand_type);
 
   // Returns true if |operand_type| is a maybe register operand
-  // (kMaybeReg8/kMaybeReg16).
+  // (kMaybeReg).
   static bool IsMaybeRegisterOperandType(OperandType operand_type);
 
+  // Returns true if |operand_type| is a runtime-id operand (kRuntimeId).
+  static bool IsRuntimeIdOperandType(OperandType operand_type);
+
+  // Returns true if |operand_type| is unsigned, false if signed.
+  static bool IsUnsignedOperandType(OperandType operand_type);
+
+  // Decodes a register operand in a byte array.
+  static Register DecodeRegisterOperand(const uint8_t* operand_start,
+                                        OperandType operand_type,
+                                        OperandScale operand_scale);
+
+  // Decodes a signed operand in a byte array.
+  static int32_t DecodeSignedOperand(const uint8_t* operand_start,
+                                     OperandType operand_type,
+                                     OperandScale operand_scale);
+
+  // Decodes an unsigned operand in a byte array.
+  static uint32_t DecodeUnsignedOperand(const uint8_t* operand_start,
+                                        OperandType operand_type,
+                                        OperandScale operand_scale);
+
   // Decode a single bytecode and operands to |os|.
   static std::ostream& Decode(std::ostream& os, const uint8_t* bytecode_start,
                               int number_of_parameters);
 
+  // Returns true if a handler is generated for a bytecode at a given
+  // operand scale. All bytecodes have handlers at OperandScale::kSingle,
+  // but only bytecodes with scalable operands have handlers with larger
+  // OperandScale values.
+  static bool BytecodeHasHandler(Bytecode bytecode, OperandScale operand_scale);
+
+  // Return the next larger operand scale.
+  static OperandScale NextOperandScale(OperandScale operand_scale);
+
  private:
   DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes);
 };
 
 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode);
+std::ostream& operator<<(std::ostream& os, const AccumulatorUse& use);
+std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale);
+std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size);
 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type);
-std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type);
 
 }  // namespace interpreter
 }  // namespace internal