Index: src/interpreter/bytecode-array-builder.cc |
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc |
index 68972c81c2a26786bcf9bf3f919974aca3102069..f1dd7670891e5542df517084421aa2864ea19c6f 100644 |
--- a/src/interpreter/bytecode-array-builder.cc |
+++ b/src/interpreter/bytecode-array-builder.cc |
@@ -4,6 +4,7 @@ |
#include "src/interpreter/bytecode-array-builder.h" |
#include "src/compiler.h" |
+#include "src/interpreter/interpreter-intrinsics.h" |
namespace v8 { |
namespace internal { |
@@ -1122,19 +1123,22 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( |
DCHECK_EQ(0u, arg_count); |
first_arg = Register(0); |
} |
+ Bytecode bytecode = IntrinsicsHelper::IsSupported(function_id) |
+ ? Bytecode::kInvokeIntrinsic |
+ : Bytecode::kCallRuntime; |
if (FitsInReg8Operand(first_arg) && FitsInIdx8Operand(arg_count)) { |
- Output(Bytecode::kCallRuntime, static_cast<uint16_t>(function_id), |
+ Output(bytecode, static_cast<uint16_t>(function_id), |
first_arg.ToRawOperand(), static_cast<uint8_t>(arg_count)); |
} else if (FitsInReg16Operand(first_arg) && FitsInIdx16Operand(arg_count)) { |
- Output(Bytecode::kCallRuntimeWide, static_cast<uint16_t>(function_id), |
- first_arg.ToRawOperand(), static_cast<uint16_t>(arg_count)); |
+ Output(BytecodeForWideOperands(bytecode), |
+ static_cast<uint16_t>(function_id), first_arg.ToRawOperand(), |
+ static_cast<uint16_t>(arg_count)); |
} else { |
UNIMPLEMENTED(); |
} |
return *this; |
} |
- |
BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntimeForPair( |
Runtime::FunctionId function_id, Register first_arg, size_t arg_count, |
Register first_return) { |
@@ -1476,6 +1480,10 @@ Bytecode BytecodeArrayBuilder::BytecodeForWideOperands(Bytecode bytecode) { |
return Bytecode::kStaLookupSlotStrictWide; |
case Bytecode::kStaLookupSlotSloppy: |
return Bytecode::kStaLookupSlotSloppyWide; |
+ case Bytecode::kInvokeIntrinsic: |
+ return Bytecode::kInvokeIntrinsicWide; |
+ case Bytecode::kCallRuntime: |
+ return Bytecode::kCallRuntimeWide; |
default: |
UNREACHABLE(); |
return static_cast<Bytecode>(-1); |