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/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 22 matching lines...) Expand all Loading... |
33 case Runtime::kInlineCreateIterResultObject: | 33 case Runtime::kInlineCreateIterResultObject: |
34 return ReduceCreateIterResultObject(node); | 34 return ReduceCreateIterResultObject(node); |
35 case Runtime::kInlineDebugIsActive: | 35 case Runtime::kInlineDebugIsActive: |
36 return ReduceDebugIsActive(node); | 36 return ReduceDebugIsActive(node); |
37 case Runtime::kInlineDeoptimizeNow: | 37 case Runtime::kInlineDeoptimizeNow: |
38 return ReduceDeoptimizeNow(node); | 38 return ReduceDeoptimizeNow(node); |
39 case Runtime::kInlineGeneratorClose: | 39 case Runtime::kInlineGeneratorClose: |
40 return ReduceGeneratorClose(node); | 40 return ReduceGeneratorClose(node); |
41 case Runtime::kInlineGeneratorGetInputOrDebugPos: | 41 case Runtime::kInlineGeneratorGetInputOrDebugPos: |
42 return ReduceGeneratorGetInputOrDebugPos(node); | 42 return ReduceGeneratorGetInputOrDebugPos(node); |
| 43 case Runtime::kInlineAsyncGeneratorGetAwaitInput: |
| 44 return ReduceAsyncGeneratorGetAwaitInput(node); |
43 case Runtime::kInlineGeneratorGetResumeMode: | 45 case Runtime::kInlineGeneratorGetResumeMode: |
44 return ReduceGeneratorGetResumeMode(node); | 46 return ReduceGeneratorGetResumeMode(node); |
45 case Runtime::kInlineIsArray: | 47 case Runtime::kInlineIsArray: |
46 return ReduceIsInstanceType(node, JS_ARRAY_TYPE); | 48 return ReduceIsInstanceType(node, JS_ARRAY_TYPE); |
47 case Runtime::kInlineIsTypedArray: | 49 case Runtime::kInlineIsTypedArray: |
48 return ReduceIsInstanceType(node, JS_TYPED_ARRAY_TYPE); | 50 return ReduceIsInstanceType(node, JS_TYPED_ARRAY_TYPE); |
49 case Runtime::kInlineIsJSReceiver: | 51 case Runtime::kInlineIsJSReceiver: |
50 return ReduceIsJSReceiver(node); | 52 return ReduceIsJSReceiver(node); |
51 case Runtime::kInlineIsSmi: | 53 case Runtime::kInlineIsSmi: |
52 return ReduceIsSmi(node); | 54 return ReduceIsSmi(node); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 Reduction JSIntrinsicLowering::ReduceGeneratorGetInputOrDebugPos(Node* node) { | 135 Reduction JSIntrinsicLowering::ReduceGeneratorGetInputOrDebugPos(Node* node) { |
134 Node* const generator = NodeProperties::GetValueInput(node, 0); | 136 Node* const generator = NodeProperties::GetValueInput(node, 0); |
135 Node* const effect = NodeProperties::GetEffectInput(node); | 137 Node* const effect = NodeProperties::GetEffectInput(node); |
136 Node* const control = NodeProperties::GetControlInput(node); | 138 Node* const control = NodeProperties::GetControlInput(node); |
137 Operator const* const op = simplified()->LoadField( | 139 Operator const* const op = simplified()->LoadField( |
138 AccessBuilder::ForJSGeneratorObjectInputOrDebugPos()); | 140 AccessBuilder::ForJSGeneratorObjectInputOrDebugPos()); |
139 | 141 |
140 return Change(node, op, generator, effect, control); | 142 return Change(node, op, generator, effect, control); |
141 } | 143 } |
142 | 144 |
| 145 Reduction JSIntrinsicLowering::ReduceAsyncGeneratorGetAwaitInput(Node* node) { |
| 146 Node* const generator = NodeProperties::GetValueInput(node, 0); |
| 147 Node* const effect = NodeProperties::GetEffectInput(node); |
| 148 Node* const control = NodeProperties::GetControlInput(node); |
| 149 Operator const* const op = simplified()->LoadField( |
| 150 AccessBuilder::ForJSAsyncGeneratorObjectAwaitInput()); |
| 151 |
| 152 return Change(node, op, generator, effect, control); |
| 153 } |
| 154 |
| 155 Reduction JSIntrinsicLowering::ReduceGeneratorSaveInputForAwait(Node* node) { |
| 156 Node* const generator = NodeProperties::GetValueInput(node, 0); |
| 157 Node* const effect = NodeProperties::GetEffectInput(node); |
| 158 Node* const control = NodeProperties::GetControlInput(node); |
| 159 |
| 160 Node* const input = graph()->NewNode( |
| 161 simplified()->LoadField( |
| 162 AccessBuilder::ForJSAsyncGeneratorObjectAwaitInput()), |
| 163 generator, effect, control); |
| 164 |
| 165 Operator const* const op = simplified()->StoreField( |
| 166 AccessBuilder::ForJSGeneratorObjectContinuation()); |
| 167 return Change(node, op, generator, input, effect, control); |
| 168 } |
| 169 |
143 Reduction JSIntrinsicLowering::ReduceGeneratorGetResumeMode(Node* node) { | 170 Reduction JSIntrinsicLowering::ReduceGeneratorGetResumeMode(Node* node) { |
144 Node* const generator = NodeProperties::GetValueInput(node, 0); | 171 Node* const generator = NodeProperties::GetValueInput(node, 0); |
145 Node* const effect = NodeProperties::GetEffectInput(node); | 172 Node* const effect = NodeProperties::GetEffectInput(node); |
146 Node* const control = NodeProperties::GetControlInput(node); | 173 Node* const control = NodeProperties::GetControlInput(node); |
147 Operator const* const op = | 174 Operator const* const op = |
148 simplified()->LoadField(AccessBuilder::ForJSGeneratorObjectResumeMode()); | 175 simplified()->LoadField(AccessBuilder::ForJSGeneratorObjectResumeMode()); |
149 | 176 |
150 return Change(node, op, generator, effect, control); | 177 return Change(node, op, generator, effect, control); |
151 } | 178 } |
152 | 179 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 return jsgraph_->javascript(); | 384 return jsgraph_->javascript(); |
358 } | 385 } |
359 | 386 |
360 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { | 387 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { |
361 return jsgraph()->simplified(); | 388 return jsgraph()->simplified(); |
362 } | 389 } |
363 | 390 |
364 } // namespace compiler | 391 } // namespace compiler |
365 } // namespace internal | 392 } // namespace internal |
366 } // namespace v8 | 393 } // namespace v8 |
OLD | NEW |