| 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-native-context-specialization.h" | 5 #include "src/compiler/js-native-context-specialization.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/compilation-dependencies.h" | 9 #include "src/compilation-dependencies.h" |
| 10 #include "src/compiler/access-builder.h" | 10 #include "src/compiler/access-builder.h" |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 } | 750 } |
| 751 | 751 |
| 752 Reduction JSNativeContextSpecialization::ReduceNamedAccessFromNexus( | 752 Reduction JSNativeContextSpecialization::ReduceNamedAccessFromNexus( |
| 753 Node* node, Node* value, FeedbackNexus const& nexus, Handle<Name> name, | 753 Node* node, Node* value, FeedbackNexus const& nexus, Handle<Name> name, |
| 754 AccessMode access_mode, LanguageMode language_mode) { | 754 AccessMode access_mode, LanguageMode language_mode) { |
| 755 DCHECK(node->opcode() == IrOpcode::kJSLoadNamed || | 755 DCHECK(node->opcode() == IrOpcode::kJSLoadNamed || |
| 756 node->opcode() == IrOpcode::kJSStoreNamed); | 756 node->opcode() == IrOpcode::kJSStoreNamed); |
| 757 Node* const receiver = NodeProperties::GetValueInput(node, 0); | 757 Node* const receiver = NodeProperties::GetValueInput(node, 0); |
| 758 Node* const effect = NodeProperties::GetEffectInput(node); | 758 Node* const effect = NodeProperties::GetEffectInput(node); |
| 759 | 759 |
| 760 // Check if we are accessing the current native contexts' global proxy. | 760 if (flags() & kDeoptimizationEnabled) { |
| 761 HeapObjectMatcher m(receiver); | 761 // Check if we are accessing the current native contexts' global proxy. |
| 762 if (m.HasValue() && m.Value().is_identical_to(global_proxy())) { | 762 HeapObjectMatcher m(receiver); |
| 763 // Optimize accesses to the current native contexts' global proxy. | 763 if (m.HasValue() && m.Value().is_identical_to(global_proxy())) { |
| 764 return ReduceGlobalAccess(node, nullptr, value, name, access_mode); | 764 // Optimize accesses to the current native contexts' global proxy. |
| 765 return ReduceGlobalAccess(node, nullptr, value, name, access_mode); |
| 766 } |
| 765 } | 767 } |
| 766 | 768 |
| 767 // Check if the {nexus} reports type feedback for the IC. | 769 // Check if the {nexus} reports type feedback for the IC. |
| 768 if (nexus.IsUninitialized()) { | 770 if (nexus.IsUninitialized()) { |
| 769 if ((flags() & kDeoptimizationEnabled) && | 771 if ((flags() & kDeoptimizationEnabled) && |
| 770 (flags() & kBailoutOnUninitialized)) { | 772 (flags() & kBailoutOnUninitialized)) { |
| 771 return ReduceSoftDeoptimize( | 773 return ReduceSoftDeoptimize( |
| 772 node, | 774 node, |
| 773 DeoptimizeReason::kInsufficientTypeFeedbackForGenericNamedAccess); | 775 DeoptimizeReason::kInsufficientTypeFeedbackForGenericNamedAccess); |
| 774 } | 776 } |
| (...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2256 return jsgraph()->javascript(); | 2258 return jsgraph()->javascript(); |
| 2257 } | 2259 } |
| 2258 | 2260 |
| 2259 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 2261 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
| 2260 return jsgraph()->simplified(); | 2262 return jsgraph()->simplified(); |
| 2261 } | 2263 } |
| 2262 | 2264 |
| 2263 } // namespace compiler | 2265 } // namespace compiler |
| 2264 } // namespace internal | 2266 } // namespace internal |
| 2265 } // namespace v8 | 2267 } // namespace v8 |
| OLD | NEW |