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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 Reduction JSIntrinsicLowering::ReduceCall(Node* node) { | 390 Reduction JSIntrinsicLowering::ReduceCall(Node* node) { |
391 size_t const arity = CallRuntimeParametersOf(node->op()).arity(); | 391 size_t const arity = CallRuntimeParametersOf(node->op()).arity(); |
392 NodeProperties::ChangeOp(node, | 392 NodeProperties::ChangeOp(node, |
393 javascript()->CallFunction(arity, VectorSlotPair(), | 393 javascript()->CallFunction(arity, VectorSlotPair(), |
394 ConvertReceiverMode::kAny, | 394 ConvertReceiverMode::kAny, |
395 TailCallMode::kDisallow)); | 395 TailCallMode::kDisallow)); |
396 return Changed(node); | 396 return Changed(node); |
397 } | 397 } |
398 | 398 |
399 Reduction JSIntrinsicLowering::ReduceNewObject(Node* node) { | 399 Reduction JSIntrinsicLowering::ReduceNewObject(Node* node) { |
400 Node* constructor = NodeProperties::GetValueInput(node, 0); | 400 return Change(node, CodeFactory::FastNewObject(isolate()), 0); |
401 Node* new_target = NodeProperties::GetValueInput(node, 1); | |
402 Node* context = NodeProperties::GetContextInput(node); | |
403 Node* effect = NodeProperties::GetEffectInput(node); | |
404 Node* frame_state = NodeProperties::GetFrameStateInput(node, 0); | |
405 Node* value = graph()->NewNode(javascript()->Create(), constructor, | |
406 new_target, context, frame_state, effect); | |
407 ReplaceWithValue(node, value, value); | |
408 return Replace(value); | |
409 } | 401 } |
410 | 402 |
411 Reduction JSIntrinsicLowering::ReduceGetSuperConstructor(Node* node) { | 403 Reduction JSIntrinsicLowering::ReduceGetSuperConstructor(Node* node) { |
412 Node* active_function = NodeProperties::GetValueInput(node, 0); | 404 Node* active_function = NodeProperties::GetValueInput(node, 0); |
413 Node* effect = NodeProperties::GetEffectInput(node); | 405 Node* effect = NodeProperties::GetEffectInput(node); |
414 Node* control = NodeProperties::GetControlInput(node); | 406 Node* control = NodeProperties::GetControlInput(node); |
415 Node* active_function_map = effect = | 407 Node* active_function_map = effect = |
416 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), | 408 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), |
417 active_function, effect, control); | 409 active_function, effect, control); |
418 return Change(node, simplified()->LoadField(AccessBuilder::ForMapPrototype()), | 410 return Change(node, simplified()->LoadField(AccessBuilder::ForMapPrototype()), |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 } | 490 } |
499 | 491 |
500 | 492 |
501 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { | 493 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { |
502 return jsgraph()->simplified(); | 494 return jsgraph()->simplified(); |
503 } | 495 } |
504 | 496 |
505 } // namespace compiler | 497 } // namespace compiler |
506 } // namespace internal | 498 } // namespace internal |
507 } // namespace v8 | 499 } // namespace v8 |
OLD | NEW |