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

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

Issue 2759093004: [interpreter] Split out intrinsics generation (Closed)
Patch Set: rebased Created 3 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 | « BUILD.gn ('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 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 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-generator.h" 5 #include "src/interpreter/interpreter-generator.h"
6 6
7 #include <array> 7 #include <array>
8 #include <tuple> 8 #include <tuple>
9 9
10 #include "src/builtins/builtins-arguments-gen.h" 10 #include "src/builtins/builtins-arguments-gen.h"
11 #include "src/builtins/builtins-constructor-gen.h" 11 #include "src/builtins/builtins-constructor-gen.h"
12 #include "src/builtins/builtins-forin-gen.h" 12 #include "src/builtins/builtins-forin-gen.h"
13 #include "src/code-events.h" 13 #include "src/code-events.h"
14 #include "src/code-factory.h" 14 #include "src/code-factory.h"
15 #include "src/factory.h" 15 #include "src/factory.h"
16 #include "src/ic/accessor-assembler.h" 16 #include "src/ic/accessor-assembler.h"
17 #include "src/interpreter/bytecode-flags.h" 17 #include "src/interpreter/bytecode-flags.h"
18 #include "src/interpreter/bytecodes.h" 18 #include "src/interpreter/bytecodes.h"
19 #include "src/interpreter/interpreter-assembler.h" 19 #include "src/interpreter/interpreter-assembler.h"
20 #include "src/interpreter/interpreter-intrinsics.h" 20 #include "src/interpreter/interpreter-intrinsics-generator.h"
21 #include "src/objects-inl.h" 21 #include "src/objects-inl.h"
22 22
23 namespace v8 { 23 namespace v8 {
24 namespace internal { 24 namespace internal {
25 namespace interpreter { 25 namespace interpreter {
26 26
27 using compiler::Node; 27 using compiler::Node;
28 typedef CodeStubAssembler::Label Label; 28 typedef CodeStubAssembler::Label Label;
29 typedef CodeStubAssembler::Variable Variable; 29 typedef CodeStubAssembler::Variable Variable;
30 30
(...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after
2116 // InvokeIntrinsic <function_id> <first_arg> <arg_count> 2116 // InvokeIntrinsic <function_id> <first_arg> <arg_count>
2117 // 2117 //
2118 // Implements the semantic equivalent of calling the runtime function 2118 // Implements the semantic equivalent of calling the runtime function
2119 // |function_id| with the first argument in |first_arg| and |arg_count| 2119 // |function_id| with the first argument in |first_arg| and |arg_count|
2120 // arguments in subsequent registers. 2120 // arguments in subsequent registers.
2121 void InterpreterGenerator::DoInvokeIntrinsic(InterpreterAssembler* assembler) { 2121 void InterpreterGenerator::DoInvokeIntrinsic(InterpreterAssembler* assembler) {
2122 Node* function_id = __ BytecodeOperandIntrinsicId(0); 2122 Node* function_id = __ BytecodeOperandIntrinsicId(0);
2123 Node* first_arg_reg = __ BytecodeOperandReg(1); 2123 Node* first_arg_reg = __ BytecodeOperandReg(1);
2124 Node* arg_count = __ BytecodeOperandCount(2); 2124 Node* arg_count = __ BytecodeOperandCount(2);
2125 Node* context = __ GetContext(); 2125 Node* context = __ GetContext();
2126 IntrinsicsHelper helper(assembler); 2126 Node* result = GenerateInvokeIntrinsic(assembler, function_id, context,
2127 Node* result = 2127 first_arg_reg, arg_count);
2128 helper.InvokeIntrinsic(function_id, context, first_arg_reg, arg_count);
2129 __ SetAccumulator(result); 2128 __ SetAccumulator(result);
2130 __ Dispatch(); 2129 __ Dispatch();
2131 } 2130 }
2132 2131
2133 // CallRuntimeForPair <function_id> <first_arg> <arg_count> <first_return> 2132 // CallRuntimeForPair <function_id> <first_arg> <arg_count> <first_return>
2134 // 2133 //
2135 // Call the runtime function |function_id| which returns a pair, with the 2134 // Call the runtime function |function_id| which returns a pair, with the
2136 // first argument in register |first_arg| and |arg_count| arguments in 2135 // first argument in register |first_arg| and |arg_count| arguments in
2137 // subsequent registers. Returns the result in <first_return> and 2136 // subsequent registers. Returns the result in <first_return> and
2138 // <first_return + 1> 2137 // <first_return + 1>
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after
3421 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, 3420 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset,
3422 __ SmiTag(new_state)); 3421 __ SmiTag(new_state));
3423 __ SetAccumulator(old_state); 3422 __ SetAccumulator(old_state);
3424 3423
3425 __ Dispatch(); 3424 __ Dispatch();
3426 } 3425 }
3427 3426
3428 } // namespace interpreter 3427 } // namespace interpreter
3429 } // namespace internal 3428 } // namespace internal
3430 } // namespace v8 3429 } // namespace v8
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/interpreter/interpreter-intrinsics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698