| Index: src/interpreter/interpreter.cc
|
| diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
|
| index 334f7d3eaf56bd9262d18b2551cf0ee20c4d8c01..f24bda0c19fb4c2d1d78c7cfb80e54233630b197 100644
|
| --- a/src/interpreter/interpreter.cc
|
| +++ b/src/interpreter/interpreter.cc
|
| @@ -282,6 +282,24 @@ void Interpreter::DoMod(compiler::InterpreterAssembler* assembler) {
|
| }
|
|
|
|
|
| +// CallJS <first_arg_reg> <arg_count>
|
| +//
|
| +// Call a JS function with arguments in registers <first_arg_reg> to
|
| +// <first_arg_reg + arg_count>. The JSfunction or Callable to call is in
|
| +// the accumulator.
|
| +void Interpreter::DoCallJS(compiler::InterpreterAssembler* assembler) {
|
| + Node* first_arg_reg_index = __ BytecodeOperandReg(0);
|
| + Node* first_arg = __ RegisterLocation(first_arg_reg_index);
|
| + Node* args_count = __ BytecodeOperandCount(1);
|
| + Node* args_size = __ WordShl(args_count, kPointerSizeLog2);
|
| + Node* last_arg = __ IntPtrSub(first_arg, args_size);
|
| + Node* function = __ GetAccumulator();
|
| + Node* result = __ CallJS(function, first_arg, last_arg);
|
| + __ SetAccumulator(result);
|
| + __ Dispatch();
|
| +}
|
| +
|
| +
|
| // Return
|
| //
|
| // Return the value in register 0.
|
|
|