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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 case Runtime::kInlineCall: | 75 case Runtime::kInlineCall: |
76 return ReduceCall(node); | 76 return ReduceCall(node); |
77 case Runtime::kInlineGetSuperConstructor: | 77 case Runtime::kInlineGetSuperConstructor: |
78 return ReduceGetSuperConstructor(node); | 78 return ReduceGetSuperConstructor(node); |
79 case Runtime::kInlineJSCollectionGetTable: | 79 case Runtime::kInlineJSCollectionGetTable: |
80 return ReduceJSCollectionGetTable(node); | 80 return ReduceJSCollectionGetTable(node); |
81 case Runtime::kInlineStringGetRawHashField: | 81 case Runtime::kInlineStringGetRawHashField: |
82 return ReduceStringGetRawHashField(node); | 82 return ReduceStringGetRawHashField(node); |
83 case Runtime::kInlineTheHole: | 83 case Runtime::kInlineTheHole: |
84 return ReduceTheHole(node); | 84 return ReduceTheHole(node); |
| 85 case Runtime::kInlineClassOf: |
| 86 return ReduceClassOf(node); |
85 default: | 87 default: |
86 break; | 88 break; |
87 } | 89 } |
88 return NoChange(); | 90 return NoChange(); |
89 } | 91 } |
90 | 92 |
91 | 93 |
92 Reduction JSIntrinsicLowering::ReduceCreateIterResultObject(Node* node) { | 94 Reduction JSIntrinsicLowering::ReduceCreateIterResultObject(Node* node) { |
93 Node* const value = NodeProperties::GetValueInput(node, 0); | 95 Node* const value = NodeProperties::GetValueInput(node, 0); |
94 Node* const done = NodeProperties::GetValueInput(node, 1); | 96 Node* const done = NodeProperties::GetValueInput(node, 1); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 simplified()->LoadField(AccessBuilder::ForNameHashField()), | 334 simplified()->LoadField(AccessBuilder::ForNameHashField()), |
333 string, effect, control); | 335 string, effect, control); |
334 } | 336 } |
335 | 337 |
336 Reduction JSIntrinsicLowering::ReduceTheHole(Node* node) { | 338 Reduction JSIntrinsicLowering::ReduceTheHole(Node* node) { |
337 Node* value = jsgraph()->TheHoleConstant(); | 339 Node* value = jsgraph()->TheHoleConstant(); |
338 ReplaceWithValue(node, value); | 340 ReplaceWithValue(node, value); |
339 return Replace(value); | 341 return Replace(value); |
340 } | 342 } |
341 | 343 |
| 344 Reduction JSIntrinsicLowering::ReduceClassOf(Node* node) { |
| 345 RelaxEffectsAndControls(node); |
| 346 node->TrimInputCount(2); |
| 347 NodeProperties::ChangeOp(node, javascript()->ClassOf()); |
| 348 return Changed(node); |
| 349 } |
| 350 |
342 Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a, | 351 Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a, |
343 Node* b) { | 352 Node* b) { |
344 RelaxControls(node); | 353 RelaxControls(node); |
345 node->ReplaceInput(0, a); | 354 node->ReplaceInput(0, a); |
346 node->ReplaceInput(1, b); | 355 node->ReplaceInput(1, b); |
347 node->TrimInputCount(2); | 356 node->TrimInputCount(2); |
348 NodeProperties::ChangeOp(node, op); | 357 NodeProperties::ChangeOp(node, op); |
349 return Changed(node); | 358 return Changed(node); |
350 } | 359 } |
351 | 360 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 return jsgraph_->javascript(); | 410 return jsgraph_->javascript(); |
402 } | 411 } |
403 | 412 |
404 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { | 413 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { |
405 return jsgraph()->simplified(); | 414 return jsgraph()->simplified(); |
406 } | 415 } |
407 | 416 |
408 } // namespace compiler | 417 } // namespace compiler |
409 } // namespace internal | 418 } // namespace internal |
410 } // namespace v8 | 419 } // namespace v8 |
OLD | NEW |