OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/interpreter/interpreter.h" | 5 #include "src/interpreter/interpreter.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/compiler/interpreter-assembler.h" | 9 #include "src/compiler/interpreter-assembler.h" |
10 #include "src/factory.h" | 10 #include "src/factory.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 315 |
316 | 316 |
317 // Mod <src> | 317 // Mod <src> |
318 // | 318 // |
319 // Modulo register <src> by accumulator. | 319 // Modulo register <src> by accumulator. |
320 void Interpreter::DoMod(compiler::InterpreterAssembler* assembler) { | 320 void Interpreter::DoMod(compiler::InterpreterAssembler* assembler) { |
321 DoBinaryOp(Runtime::kModulus, assembler); | 321 DoBinaryOp(Runtime::kModulus, assembler); |
322 } | 322 } |
323 | 323 |
324 | 324 |
| 325 // Call <receiver> <arg_count> |
| 326 // |
| 327 // Call a JS function with receiver and |arg_count| arguments in subsequent |
| 328 // registers. The JSfunction or Callable to call is in the accumulator. |
| 329 void Interpreter::DoCall(compiler::InterpreterAssembler* assembler) { |
| 330 Node* function_reg = __ BytecodeOperandReg(0); |
| 331 Node* function = __ LoadRegister(function_reg); |
| 332 Node* receiver_reg = __ BytecodeOperandReg(1); |
| 333 Node* first_arg = __ RegisterLocation(receiver_reg); |
| 334 Node* args_count = __ BytecodeOperandCount(2); |
| 335 Node* result = __ CallJS(function, first_arg, args_count); |
| 336 __ SetAccumulator(result); |
| 337 __ Dispatch(); |
| 338 } |
| 339 |
| 340 |
325 // Return | 341 // Return |
326 // | 342 // |
327 // Return the value in register 0. | 343 // Return the value in register 0. |
328 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { | 344 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { |
329 __ Return(); | 345 __ Return(); |
330 } | 346 } |
331 | 347 |
332 | 348 |
333 } // namespace interpreter | 349 } // namespace interpreter |
334 } // namespace internal | 350 } // namespace internal |
335 } // namespace v8 | 351 } // namespace v8 |
OLD | NEW |