OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/compilation-dependencies.h" | 6 #include "src/compilation-dependencies.h" |
7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 invert); | 526 invert); |
527 } | 527 } |
528 if (r.BothInputsAre(Type::Boolean())) { | 528 if (r.BothInputsAre(Type::Boolean())) { |
529 return r.ChangeToPureOperator(simplified()->ReferenceEqual(Type::Boolean()), | 529 return r.ChangeToPureOperator(simplified()->ReferenceEqual(Type::Boolean()), |
530 invert); | 530 invert); |
531 } | 531 } |
532 if (r.BothInputsAre(Type::Receiver())) { | 532 if (r.BothInputsAre(Type::Receiver())) { |
533 return r.ChangeToPureOperator( | 533 return r.ChangeToPureOperator( |
534 simplified()->ReferenceEqual(Type::Receiver()), invert); | 534 simplified()->ReferenceEqual(Type::Receiver()), invert); |
535 } | 535 } |
536 if (r.OneInputIs(Type::NullOrUndefined())) { | 536 if (r.OneInputIs(Type::Undetectable())) { |
537 Callable const callable = CodeFactory::CompareNilIC(isolate(), kNullValue); | 537 RelaxEffectsAndControls(node); |
538 CallDescriptor const* const desc = Linkage::GetStubCallDescriptor( | 538 node->RemoveInput(r.LeftInputIs(Type::Undetectable()) ? 0 : 1); |
539 isolate(), graph()->zone(), callable.descriptor(), 0, | 539 node->TrimInputCount(1); |
540 CallDescriptor::kNeedsFrameState, node->op()->properties()); | 540 NodeProperties::ChangeOp(node, simplified()->ObjectIsUndetectable()); |
541 node->RemoveInput(r.LeftInputIs(Type::NullOrUndefined()) ? 0 : 1); | |
542 node->InsertInput(graph()->zone(), 0, | |
543 jsgraph()->HeapConstant(callable.code())); | |
544 NodeProperties::ChangeOp(node, common()->Call(desc)); | |
545 if (invert) { | 541 if (invert) { |
546 // Insert an boolean not to invert the value. | 542 // Insert an boolean not to invert the value. |
547 Node* value = graph()->NewNode(simplified()->BooleanNot(), node); | 543 Node* value = graph()->NewNode(simplified()->BooleanNot(), node); |
548 node->ReplaceUses(value); | 544 node->ReplaceUses(value); |
549 // Note: ReplaceUses() smashes all uses, so smash it back here. | 545 // Note: ReplaceUses() smashes all uses, so smash it back here. |
550 value->ReplaceInput(0, node); | 546 value->ReplaceInput(0, node); |
551 return Replace(value); | 547 return Replace(value); |
552 } | 548 } |
553 return Changed(node); | 549 return Changed(node); |
554 } | 550 } |
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1759 } | 1755 } |
1760 | 1756 |
1761 | 1757 |
1762 CompilationDependencies* JSTypedLowering::dependencies() const { | 1758 CompilationDependencies* JSTypedLowering::dependencies() const { |
1763 return dependencies_; | 1759 return dependencies_; |
1764 } | 1760 } |
1765 | 1761 |
1766 } // namespace compiler | 1762 } // namespace compiler |
1767 } // namespace internal | 1763 } // namespace internal |
1768 } // namespace v8 | 1764 } // namespace v8 |
OLD | NEW |