Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(834)

Side by Side Diff: src/interpreter/interpreter.cc

Issue 1323463005: [Interpreter] Add support for JS calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add MIPS port contributed by akos.palfi@imgtec.com Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698