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

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

Issue 1645763003: [Interpreter] TurboFan implementation of intrinsics. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Merged with oth@'s changes. Created 4 years, 9 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/interpreter/interpreter-intrinsics.h » ('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/ast/prettyprinter.h" 7 #include "src/ast/prettyprinter.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/factory.h" 10 #include "src/factory.h"
11 #include "src/interpreter/bytecode-generator.h" 11 #include "src/interpreter/bytecode-generator.h"
12 #include "src/interpreter/bytecodes.h" 12 #include "src/interpreter/bytecodes.h"
13 #include "src/interpreter/interpreter-assembler.h" 13 #include "src/interpreter/interpreter-assembler.h"
14 #include "src/interpreter/interpreter-intrinsics.h"
14 #include "src/log.h" 15 #include "src/log.h"
15 #include "src/zone.h" 16 #include "src/zone.h"
16 17
17 namespace v8 { 18 namespace v8 {
18 namespace internal { 19 namespace internal {
19 namespace interpreter { 20 namespace interpreter {
20 21
21 using compiler::Node; 22 using compiler::Node;
22 23
23 #define __ assembler-> 24 #define __ assembler->
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 888
888 // CallRuntime <function_id> <first_arg> <arg_count> 889 // CallRuntime <function_id> <first_arg> <arg_count>
889 // 890 //
890 // Call the runtime function |function_id| with the first argument in 891 // Call the runtime function |function_id| with the first argument in
891 // register |first_arg| and |arg_count| arguments in subsequent 892 // register |first_arg| and |arg_count| arguments in subsequent
892 // registers. 893 // registers.
893 void Interpreter::DoCallRuntime(InterpreterAssembler* assembler) { 894 void Interpreter::DoCallRuntime(InterpreterAssembler* assembler) {
894 DoCallRuntimeCommon(assembler); 895 DoCallRuntimeCommon(assembler);
895 } 896 }
896 897
898 // InvokeIntrinsic <function_id> <first_arg> <arg_count>
899 //
900 // Implements the semantic equivalent of calling the runtime function
901 // |function_id| with the first argument in |first_arg| and |arg_count|
902 // arguments in subsequent registers.
903 void Interpreter::DoInvokeIntrinsic(InterpreterAssembler* assembler) {
904 Node* function_id = __ BytecodeOperandRuntimeId(0);
905 Node* first_arg_reg = __ BytecodeOperandReg(1);
906 Node* arg_count = __ BytecodeOperandCount(2);
907 Node* context = __ GetContext();
908 IntrinsicsHelper helper(assembler);
909 Node* result =
910 helper.InvokeIntrinsic(function_id, context, first_arg_reg, arg_count);
911 __ SetAccumulator(result);
912 __ Dispatch();
913 }
914
897 void Interpreter::DoCallRuntimeForPairCommon(InterpreterAssembler* assembler) { 915 void Interpreter::DoCallRuntimeForPairCommon(InterpreterAssembler* assembler) {
898 // Call the runtime function. 916 // Call the runtime function.
899 Node* function_id = __ BytecodeOperandRuntimeId(0); 917 Node* function_id = __ BytecodeOperandRuntimeId(0);
900 Node* first_arg_reg = __ BytecodeOperandReg(1); 918 Node* first_arg_reg = __ BytecodeOperandReg(1);
901 Node* first_arg = __ RegisterLocation(first_arg_reg); 919 Node* first_arg = __ RegisterLocation(first_arg_reg);
902 Node* args_count = __ BytecodeOperandCount(2); 920 Node* args_count = __ BytecodeOperandCount(2);
903 Node* context = __ GetContext(); 921 Node* context = __ GetContext();
904 Node* result_pair = 922 Node* result_pair =
905 __ CallRuntimeN(function_id, context, first_arg, args_count, 2); 923 __ CallRuntimeN(function_id, context, first_arg, args_count, 2);
906 924
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 // Illegal 1605 // Illegal
1588 // 1606 //
1589 // An invalid bytecode aborting execution if dispatched. 1607 // An invalid bytecode aborting execution if dispatched.
1590 void Interpreter::DoIllegal(InterpreterAssembler* assembler) { 1608 void Interpreter::DoIllegal(InterpreterAssembler* assembler) {
1591 __ Abort(kInvalidBytecode); 1609 __ Abort(kInvalidBytecode);
1592 } 1610 }
1593 1611
1594 } // namespace interpreter 1612 } // namespace interpreter
1595 } // namespace internal 1613 } // namespace internal
1596 } // namespace v8 1614 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | src/interpreter/interpreter-intrinsics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698