| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 case Runtime::kInlineToLength: | 65 case Runtime::kInlineToLength: |
| 66 return ReduceToLength(node); | 66 return ReduceToLength(node); |
| 67 case Runtime::kInlineToNumber: | 67 case Runtime::kInlineToNumber: |
| 68 return ReduceToNumber(node); | 68 return ReduceToNumber(node); |
| 69 case Runtime::kInlineToObject: | 69 case Runtime::kInlineToObject: |
| 70 return ReduceToObject(node); | 70 return ReduceToObject(node); |
| 71 case Runtime::kInlineToString: | 71 case Runtime::kInlineToString: |
| 72 return ReduceToString(node); | 72 return ReduceToString(node); |
| 73 case Runtime::kInlineCall: | 73 case Runtime::kInlineCall: |
| 74 return ReduceCall(node); | 74 return ReduceCall(node); |
| 75 case Runtime::kInlineNewObject: | |
| 76 return ReduceNewObject(node); | |
| 77 case Runtime::kInlineGetSuperConstructor: | 75 case Runtime::kInlineGetSuperConstructor: |
| 78 return ReduceGetSuperConstructor(node); | 76 return ReduceGetSuperConstructor(node); |
| 79 default: | 77 default: |
| 80 break; | 78 break; |
| 81 } | 79 } |
| 82 return NoChange(); | 80 return NoChange(); |
| 83 } | 81 } |
| 84 | 82 |
| 85 | 83 |
| 86 Reduction JSIntrinsicLowering::ReduceCreateIterResultObject(Node* node) { | 84 Reduction JSIntrinsicLowering::ReduceCreateIterResultObject(Node* node) { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 279 |
| 282 Reduction JSIntrinsicLowering::ReduceCall(Node* node) { | 280 Reduction JSIntrinsicLowering::ReduceCall(Node* node) { |
| 283 size_t const arity = CallRuntimeParametersOf(node->op()).arity(); | 281 size_t const arity = CallRuntimeParametersOf(node->op()).arity(); |
| 284 NodeProperties::ChangeOp( | 282 NodeProperties::ChangeOp( |
| 285 node, javascript()->CallFunction(arity, 0.0f, VectorSlotPair(), | 283 node, javascript()->CallFunction(arity, 0.0f, VectorSlotPair(), |
| 286 ConvertReceiverMode::kAny, | 284 ConvertReceiverMode::kAny, |
| 287 TailCallMode::kDisallow)); | 285 TailCallMode::kDisallow)); |
| 288 return Changed(node); | 286 return Changed(node); |
| 289 } | 287 } |
| 290 | 288 |
| 291 Reduction JSIntrinsicLowering::ReduceNewObject(Node* node) { | |
| 292 return Change(node, CodeFactory::FastNewObject(isolate()), 0); | |
| 293 } | |
| 294 | |
| 295 Reduction JSIntrinsicLowering::ReduceGetSuperConstructor(Node* node) { | 289 Reduction JSIntrinsicLowering::ReduceGetSuperConstructor(Node* node) { |
| 296 Node* active_function = NodeProperties::GetValueInput(node, 0); | 290 Node* active_function = NodeProperties::GetValueInput(node, 0); |
| 297 Node* effect = NodeProperties::GetEffectInput(node); | 291 Node* effect = NodeProperties::GetEffectInput(node); |
| 298 Node* control = NodeProperties::GetControlInput(node); | 292 Node* control = NodeProperties::GetControlInput(node); |
| 299 Node* active_function_map = effect = | 293 Node* active_function_map = effect = |
| 300 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), | 294 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), |
| 301 active_function, effect, control); | 295 active_function, effect, control); |
| 302 return Change(node, simplified()->LoadField(AccessBuilder::ForMapPrototype()), | 296 return Change(node, simplified()->LoadField(AccessBuilder::ForMapPrototype()), |
| 303 active_function_map, effect, control); | 297 active_function_map, effect, control); |
| 304 } | 298 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 return jsgraph_->javascript(); | 359 return jsgraph_->javascript(); |
| 366 } | 360 } |
| 367 | 361 |
| 368 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { | 362 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { |
| 369 return jsgraph()->simplified(); | 363 return jsgraph()->simplified(); |
| 370 } | 364 } |
| 371 | 365 |
| 372 } // namespace compiler | 366 } // namespace compiler |
| 373 } // namespace internal | 367 } // namespace internal |
| 374 } // namespace v8 | 368 } // namespace v8 |
| OLD | NEW |