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

Side by Side Diff: src/compiler/js-intrinsic-lowering.cc

Issue 1531753002: [turbofan] Add support for CreateIterResultObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/compiler/js-intrinsic-lowering.h ('k') | src/compiler/js-operator.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/compiler/js-intrinsic-lowering.h" 5 #include "src/compiler/js-intrinsic-lowering.h"
6 6
7 #include <stack> 7 #include <stack>
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/compiler/access-builder.h" 10 #include "src/compiler/access-builder.h"
(...skipping 19 matching lines...) Expand all
30 30
31 31
32 Reduction JSIntrinsicLowering::Reduce(Node* node) { 32 Reduction JSIntrinsicLowering::Reduce(Node* node) {
33 if (node->opcode() != IrOpcode::kJSCallRuntime) return NoChange(); 33 if (node->opcode() != IrOpcode::kJSCallRuntime) return NoChange();
34 const Runtime::Function* const f = 34 const Runtime::Function* const f =
35 Runtime::FunctionForId(CallRuntimeParametersOf(node->op()).id()); 35 Runtime::FunctionForId(CallRuntimeParametersOf(node->op()).id());
36 if (f->intrinsic_type != Runtime::IntrinsicType::INLINE) return NoChange(); 36 if (f->intrinsic_type != Runtime::IntrinsicType::INLINE) return NoChange();
37 switch (f->function_id) { 37 switch (f->function_id) {
38 case Runtime::kInlineConstructDouble: 38 case Runtime::kInlineConstructDouble:
39 return ReduceConstructDouble(node); 39 return ReduceConstructDouble(node);
40 case Runtime::kInlineCreateIterResultObject:
41 return ReduceCreateIterResultObject(node);
40 case Runtime::kInlineDateField: 42 case Runtime::kInlineDateField:
41 return ReduceDateField(node); 43 return ReduceDateField(node);
42 case Runtime::kInlineDeoptimizeNow: 44 case Runtime::kInlineDeoptimizeNow:
43 return ReduceDeoptimizeNow(node); 45 return ReduceDeoptimizeNow(node);
44 case Runtime::kInlineDoubleHi: 46 case Runtime::kInlineDoubleHi:
45 return ReduceDoubleHi(node); 47 return ReduceDoubleHi(node);
46 case Runtime::kInlineDoubleLo: 48 case Runtime::kInlineDoubleLo:
47 return ReduceDoubleLo(node); 49 return ReduceDoubleLo(node);
48 case Runtime::kInlineIncrementStatsCounter: 50 case Runtime::kInlineIncrementStatsCounter:
49 return ReduceIncrementStatsCounter(node); 51 return ReduceIncrementStatsCounter(node);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 return ReduceTailCall(node); 111 return ReduceTailCall(node);
110 case Runtime::kInlineGetSuperConstructor: 112 case Runtime::kInlineGetSuperConstructor:
111 return ReduceGetSuperConstructor(node); 113 return ReduceGetSuperConstructor(node);
112 default: 114 default:
113 break; 115 break;
114 } 116 }
115 return NoChange(); 117 return NoChange();
116 } 118 }
117 119
118 120
121 Reduction JSIntrinsicLowering::ReduceCreateIterResultObject(Node* node) {
122 Node* const value = NodeProperties::GetValueInput(node, 0);
123 Node* const done = NodeProperties::GetValueInput(node, 1);
124 Node* const context = NodeProperties::GetContextInput(node);
125 Node* const effect = NodeProperties::GetEffectInput(node);
126 return Change(node, javascript()->CreateIterResultObject(), value, done,
127 context, effect);
128 }
129
130
119 Reduction JSIntrinsicLowering::ReduceConstructDouble(Node* node) { 131 Reduction JSIntrinsicLowering::ReduceConstructDouble(Node* node) {
120 Node* high = NodeProperties::GetValueInput(node, 0); 132 Node* high = NodeProperties::GetValueInput(node, 0);
121 Node* low = NodeProperties::GetValueInput(node, 1); 133 Node* low = NodeProperties::GetValueInput(node, 1);
122 Node* value = 134 Node* value =
123 graph()->NewNode(machine()->Float64InsertHighWord32(), 135 graph()->NewNode(machine()->Float64InsertHighWord32(),
124 graph()->NewNode(machine()->Float64InsertLowWord32(), 136 graph()->NewNode(machine()->Float64InsertLowWord32(),
125 jsgraph()->Constant(0), low), 137 jsgraph()->Constant(0), low),
126 high); 138 high);
127 ReplaceWithValue(node, value); 139 ReplaceWithValue(node, value);
128 return Replace(value); 140 return Replace(value);
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 } 691 }
680 692
681 693
682 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { 694 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const {
683 return jsgraph()->simplified(); 695 return jsgraph()->simplified();
684 } 696 }
685 697
686 } // namespace compiler 698 } // namespace compiler
687 } // namespace internal 699 } // namespace internal
688 } // namespace v8 700 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-intrinsic-lowering.h ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698