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 24 matching lines...) Expand all Loading... |
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::kInlineGeneratorGetResumeMode: | 43 case Runtime::kInlineGeneratorGetResumeMode: |
44 return ReduceGeneratorGetResumeMode(node); | 44 return ReduceGeneratorGetResumeMode(node); |
| 45 case Runtime::kInlineGeneratorGetContext: |
| 46 return ReduceGeneratorGetContext(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); |
53 case Runtime::kInlineFixedArrayGet: | 55 case Runtime::kInlineFixedArrayGet: |
54 return ReduceFixedArrayGet(node); | 56 return ReduceFixedArrayGet(node); |
(...skipping 78 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::ReduceGeneratorGetContext(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 = |
| 150 simplified()->LoadField(AccessBuilder::ForJSGeneratorObjectContext()); |
| 151 |
| 152 return Change(node, op, generator, effect, control); |
| 153 } |
| 154 |
143 Reduction JSIntrinsicLowering::ReduceGeneratorGetResumeMode(Node* node) { | 155 Reduction JSIntrinsicLowering::ReduceGeneratorGetResumeMode(Node* node) { |
144 Node* const generator = NodeProperties::GetValueInput(node, 0); | 156 Node* const generator = NodeProperties::GetValueInput(node, 0); |
145 Node* const effect = NodeProperties::GetEffectInput(node); | 157 Node* const effect = NodeProperties::GetEffectInput(node); |
146 Node* const control = NodeProperties::GetControlInput(node); | 158 Node* const control = NodeProperties::GetControlInput(node); |
147 Operator const* const op = | 159 Operator const* const op = |
148 simplified()->LoadField(AccessBuilder::ForJSGeneratorObjectResumeMode()); | 160 simplified()->LoadField(AccessBuilder::ForJSGeneratorObjectResumeMode()); |
149 | 161 |
150 return Change(node, op, generator, effect, control); | 162 return Change(node, op, generator, effect, control); |
151 } | 163 } |
152 | 164 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 return jsgraph_->javascript(); | 369 return jsgraph_->javascript(); |
358 } | 370 } |
359 | 371 |
360 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { | 372 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { |
361 return jsgraph()->simplified(); | 373 return jsgraph()->simplified(); |
362 } | 374 } |
363 | 375 |
364 } // namespace compiler | 376 } // namespace compiler |
365 } // namespace internal | 377 } // namespace internal |
366 } // namespace v8 | 378 } // namespace v8 |
OLD | NEW |