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::Undetectable())) { | 536 if (r.OneInputIs(Type::NullOrUndefined())) { |
537 RelaxEffectsAndControls(node); | 537 Callable const callable = CodeFactory::CompareNilIC(isolate(), kNullValue); |
538 node->RemoveInput(r.LeftInputIs(Type::Undetectable()) ? 0 : 1); | 538 CallDescriptor const* const desc = Linkage::GetStubCallDescriptor( |
539 node->TrimInputCount(1); | 539 isolate(), graph()->zone(), callable.descriptor(), 0, |
540 NodeProperties::ChangeOp(node, simplified()->ObjectIsUndetectable()); | 540 CallDescriptor::kNeedsFrameState, node->op()->properties()); |
| 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)); |
541 if (invert) { | 545 if (invert) { |
542 // Insert an boolean not to invert the value. | 546 // Insert an boolean not to invert the value. |
543 Node* value = graph()->NewNode(simplified()->BooleanNot(), node); | 547 Node* value = graph()->NewNode(simplified()->BooleanNot(), node); |
544 node->ReplaceUses(value); | 548 node->ReplaceUses(value); |
545 // Note: ReplaceUses() smashes all uses, so smash it back here. | 549 // Note: ReplaceUses() smashes all uses, so smash it back here. |
546 value->ReplaceInput(0, node); | 550 value->ReplaceInput(0, node); |
547 return Replace(value); | 551 return Replace(value); |
548 } | 552 } |
549 return Changed(node); | 553 return Changed(node); |
550 } | 554 } |
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1755 } | 1759 } |
1756 | 1760 |
1757 | 1761 |
1758 CompilationDependencies* JSTypedLowering::dependencies() const { | 1762 CompilationDependencies* JSTypedLowering::dependencies() const { |
1759 return dependencies_; | 1763 return dependencies_; |
1760 } | 1764 } |
1761 | 1765 |
1762 } // namespace compiler | 1766 } // namespace compiler |
1763 } // namespace internal | 1767 } // namespace internal |
1764 } // namespace v8 | 1768 } // namespace v8 |
OLD | NEW |