aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/interpreter/bytecodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/interpreter/bytecodes.h')
-rw-r--r--deps/v8/src/interpreter/bytecodes.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/deps/v8/src/interpreter/bytecodes.h b/deps/v8/src/interpreter/bytecodes.h
index baf9e88963..83417fe879 100644
--- a/deps/v8/src/interpreter/bytecodes.h
+++ b/deps/v8/src/interpreter/bytecodes.h
@@ -284,6 +284,10 @@ namespace interpreter {
V(JumpIfJSReceiver, AccumulatorUse::kRead, OperandType::kUImm) \
V(JumpIfNotHole, AccumulatorUse::kRead, OperandType::kUImm) \
\
+ /* Smi-table lookup for switch statements */ \
+ V(SwitchOnSmiNoFeedback, AccumulatorUse::kRead, OperandType::kIdx, \
+ OperandType::kUImm, OperandType::kImm) \
+ \
/* Complex flow control For..in */ \
V(ForInPrepare, AccumulatorUse::kNone, OperandType::kReg, \
OperandType::kRegOutTriple) \
@@ -611,13 +615,18 @@ class V8_EXPORT_PRIVATE Bytecodes final {
return IsJump(bytecode) && !IsJumpIfToBoolean(bytecode);
}
+ // Returns true if the bytecode is a switch.
+ static constexpr bool IsSwitch(Bytecode bytecode) {
+ return bytecode == Bytecode::kSwitchOnSmiNoFeedback;
+ }
+
// Returns true if |bytecode| has no effects. These bytecodes only manipulate
// interpreter frame state and will never throw.
static constexpr bool IsWithoutExternalSideEffects(Bytecode bytecode) {
return (IsAccumulatorLoadWithoutEffects(bytecode) ||
IsRegisterLoadWithoutEffects(bytecode) ||
IsCompareWithoutEffects(bytecode) || bytecode == Bytecode::kNop ||
- IsJumpWithoutEffects(bytecode));
+ IsJumpWithoutEffects(bytecode) || IsSwitch(bytecode));
}
// Returns true if the bytecode is Ldar or Star.
@@ -640,7 +649,6 @@ class V8_EXPORT_PRIVATE Bytecodes final {
bytecode == Bytecode::kConstruct ||
bytecode == Bytecode::kCallWithSpread ||
bytecode == Bytecode::kConstructWithSpread ||
- bytecode == Bytecode::kInvokeIntrinsic ||
bytecode == Bytecode::kCallJSRuntime;
}
@@ -752,7 +760,8 @@ class V8_EXPORT_PRIVATE Bytecodes final {
// Returns the receiver mode of the given call bytecode.
static ConvertReceiverMode GetReceiverMode(Bytecode bytecode) {
- DCHECK(IsCallOrConstruct(bytecode));
+ DCHECK(IsCallOrConstruct(bytecode) ||
+ bytecode == Bytecode::kInvokeIntrinsic);
switch (bytecode) {
case Bytecode::kCallProperty:
case Bytecode::kCallProperty0: