| Index: src/compiler/interpreter-assembler.h
|
| diff --git a/src/compiler/interpreter-assembler.h b/src/compiler/interpreter-assembler.h
|
| index 11e3a9127c72fd1afc1aac367559a2fdac51ac57..21bc7af0f06a009cd61493c7b0a4991cb51f5fbc 100644
|
| --- a/src/compiler/interpreter-assembler.h
|
| +++ b/src/compiler/interpreter-assembler.h
|
| @@ -60,8 +60,11 @@ class InterpreterAssembler {
|
| void SetContext(Node* value);
|
|
|
| // Loads from and stores to the interpreter register file.
|
| + Node* LoadRegister(int offset);
|
| Node* LoadRegister(interpreter::Register reg);
|
| Node* LoadRegister(Node* reg_index);
|
| + Node* StoreRegister(Node* value, int offset);
|
| + Node* StoreRegister(Node* value, interpreter::Register reg);
|
| Node* StoreRegister(Node* value, Node* reg_index);
|
|
|
| // Returns the location in memory of the register |reg_index| in the
|
| @@ -115,20 +118,38 @@ class InterpreterAssembler {
|
| // located at |first_arg|.
|
| Node* CallJS(Node* function, Node* first_arg, Node* arg_count);
|
|
|
| + // Specifies whether the current accumulator will be clobbered or saved
|
| + // across a call.
|
| + enum class SaveAccumulatorMode { kClobberAccumulator, kSaveAccumulator };
|
| +
|
| // Call an IC code stub.
|
| Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node* arg1,
|
| - Node* arg2, Node* arg3);
|
| + Node* arg2, Node* arg3,
|
| + SaveAccumulatorMode save_accum =
|
| + SaveAccumulatorMode::kClobberAccumulator);
|
| Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node* arg1,
|
| - Node* arg2, Node* arg3, Node* arg4);
|
| + Node* arg2, Node* arg3, Node* arg4,
|
| + SaveAccumulatorMode save_accum =
|
| + SaveAccumulatorMode::kClobberAccumulator);
|
| Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node* arg1,
|
| - Node* arg2, Node* arg3, Node* arg4, Node* arg5);
|
| + Node* arg2, Node* arg3, Node* arg4, Node* arg5,
|
| + SaveAccumulatorMode save_accum =
|
| + SaveAccumulatorMode::kClobberAccumulator);
|
|
|
| // Call runtime function.
|
| - Node* CallRuntime(Node* function_id, Node* first_arg, Node* arg_count);
|
| - Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1);
|
| - Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1, Node* arg2);
|
| + Node* CallRuntime(Node* function_id, Node* first_arg, Node* arg_count,
|
| + SaveAccumulatorMode save_accum =
|
| + SaveAccumulatorMode::kClobberAccumulator);
|
| + Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1,
|
| + SaveAccumulatorMode save_accum =
|
| + SaveAccumulatorMode::kClobberAccumulator);
|
| + Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1, Node* arg2,
|
| + SaveAccumulatorMode save_accum =
|
| + SaveAccumulatorMode::kClobberAccumulator);
|
| Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1, Node* arg2,
|
| - Node* arg3, Node* arg4);
|
| + Node* arg3, Node* arg4,
|
| + SaveAccumulatorMode save_accum =
|
| + SaveAccumulatorMode::kClobberAccumulator);
|
|
|
| // Jump relative to the current bytecode by |jump_offset|.
|
| void Jump(Node* jump_offset);
|
| @@ -163,6 +184,13 @@ class InterpreterAssembler {
|
| // Returns a raw pointer to first entry in the interpreter dispatch table.
|
| Node* DispatchTableRawPointer();
|
|
|
| + // Saves and restores interpreter parameter registers when performing a call
|
| + // to avoid Turbofan explicitly spilling them to the stack. The accumulator
|
| + // can be saved and restored if save_accumulator_mode is kSaveAccumulator,
|
| + // otherwise it will be clobbered by the call.
|
| + void CallPrologue(SaveAccumulatorMode save_accumulator_mode);
|
| + void CallEpilogue(SaveAccumulatorMode save_accumulator_mode);
|
| +
|
| // Returns the offset of register |index| relative to RegisterFilePointer().
|
| Node* RegisterFrameOffset(Node* index);
|
|
|
| @@ -171,10 +199,10 @@ class InterpreterAssembler {
|
| Node* BytecodeOperandSignExtended(int operand_index);
|
| Node* BytecodeOperandShort(int operand_index);
|
|
|
| - Node* CallN(CallDescriptor* descriptor, Node* code_target, Node** args);
|
| - Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node** args);
|
| - Node* CallJSBuiltin(int context_index, Node* receiver, Node** js_args,
|
| - int js_arg_count);
|
| + Node* CallN(CallDescriptor* descriptor, Node* code_target, Node** args,
|
| + SaveAccumulatorMode save_accum);
|
| + Node* CallIC(CallInterfaceDescriptor descriptor, Node* target, Node** args,
|
| + SaveAccumulatorMode save_accum);
|
|
|
| // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not
|
| // update BytecodeOffset() itself.
|
| @@ -193,8 +221,11 @@ class InterpreterAssembler {
|
|
|
| interpreter::Bytecode bytecode_;
|
| base::SmartPointer<RawMachineAssembler> raw_assembler_;
|
| +
|
| Node* accumulator_;
|
| + Node* bytecode_offset_;
|
| Node* context_;
|
| +
|
| bool code_generated_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler);
|
|
|