Index: src/interpreter/bytecode-array-builder.cc |
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc |
index b4615a557f61335e9ffd8119c584b3bc9bbcf978..78b5e1e76927762f6309150af6886b866669bf1b 100644 |
--- a/src/interpreter/bytecode-array-builder.cc |
+++ b/src/interpreter/bytecode-array-builder.cc |
@@ -474,6 +474,16 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable, |
} |
+BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime( |
+ Runtime::FunctionId function_id, Register first_arg, size_t arg_count) { |
+ DCHECK(FitsInWideIdxOperand(function_id)); |
+ DCHECK(FitsInIdxOperand(arg_count)); |
+ Output(Bytecode::kCallRuntime, static_cast<uint16_t>(function_id), |
+ first_arg.ToOperand(), static_cast<uint8_t>(arg_count)); |
+ return *this; |
+} |
+ |
+ |
size_t BytecodeArrayBuilder::GetConstantPoolEntry(Handle<Object> object) { |
// These constants shouldn't be added to the constant pool, the should use |
// specialzed bytecodes instead. |
@@ -611,6 +621,12 @@ bool BytecodeArrayBuilder::FitsInImm8Operand(int value) { |
} |
+// static |
+bool BytecodeArrayBuilder::FitsInWideIdxOperand(int value) { |
+ return kMinUInt16 <= value && value <= kMaxUInt16; |
+} |
+ |
+ |
TemporaryRegisterScope::TemporaryRegisterScope(BytecodeArrayBuilder* builder) |
: builder_(builder), count_(0), last_register_index_(-1) {} |