| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 321 |
| 322 Reduction JSNativeContextSpecialization::ReduceNamedAccessFromNexus( | 322 Reduction JSNativeContextSpecialization::ReduceNamedAccessFromNexus( |
| 323 Node* node, Node* value, FeedbackNexus const& nexus, Handle<Name> name, | 323 Node* node, Node* value, FeedbackNexus const& nexus, Handle<Name> name, |
| 324 AccessMode access_mode, LanguageMode language_mode) { | 324 AccessMode access_mode, LanguageMode language_mode) { |
| 325 DCHECK(node->opcode() == IrOpcode::kJSLoadNamed || | 325 DCHECK(node->opcode() == IrOpcode::kJSLoadNamed || |
| 326 node->opcode() == IrOpcode::kJSStoreNamed); | 326 node->opcode() == IrOpcode::kJSStoreNamed); |
| 327 Node* const receiver = NodeProperties::GetValueInput(node, 0); | 327 Node* const receiver = NodeProperties::GetValueInput(node, 0); |
| 328 Node* const effect = NodeProperties::GetEffectInput(node); | 328 Node* const effect = NodeProperties::GetEffectInput(node); |
| 329 | 329 |
| 330 // Check if the {nexus} reports type feedback for the IC. | 330 // Check if the {nexus} reports type feedback for the IC. |
| 331 if (nexus.IsUninitialized()) { | 331 if (nexus.IsUninitialized() || nexus.IsPremonomorphic()) { |
| 332 if ((flags() & kDeoptimizationEnabled) && | 332 if ((flags() & kDeoptimizationEnabled) && |
| 333 (flags() & kBailoutOnUninitialized)) { | 333 (flags() & kBailoutOnUninitialized)) { |
| 334 return ReduceSoftDeoptimize( | 334 return ReduceSoftDeoptimize( |
| 335 node, | 335 node, |
| 336 DeoptimizeReason::kInsufficientTypeFeedbackForGenericNamedAccess); | 336 DeoptimizeReason::kInsufficientTypeFeedbackForGenericNamedAccess); |
| 337 } | 337 } |
| 338 return NoChange(); | 338 return NoChange(); |
| 339 } | 339 } |
| 340 | 340 |
| 341 // Extract receiver maps from the IC using the {nexus}. | 341 // Extract receiver maps from the IC using the {nexus}. |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 Reduction JSNativeContextSpecialization::ReduceKeyedAccess( | 682 Reduction JSNativeContextSpecialization::ReduceKeyedAccess( |
| 683 Node* node, Node* index, Node* value, KeyedICNexus const& nexus, | 683 Node* node, Node* index, Node* value, KeyedICNexus const& nexus, |
| 684 AccessMode access_mode, LanguageMode language_mode, | 684 AccessMode access_mode, LanguageMode language_mode, |
| 685 KeyedAccessStoreMode store_mode) { | 685 KeyedAccessStoreMode store_mode) { |
| 686 DCHECK(node->opcode() == IrOpcode::kJSLoadProperty || | 686 DCHECK(node->opcode() == IrOpcode::kJSLoadProperty || |
| 687 node->opcode() == IrOpcode::kJSStoreProperty); | 687 node->opcode() == IrOpcode::kJSStoreProperty); |
| 688 Node* const receiver = NodeProperties::GetValueInput(node, 0); | 688 Node* const receiver = NodeProperties::GetValueInput(node, 0); |
| 689 Node* const effect = NodeProperties::GetEffectInput(node); | 689 Node* const effect = NodeProperties::GetEffectInput(node); |
| 690 | 690 |
| 691 // Check if the {nexus} reports type feedback for the IC. | 691 // Check if the {nexus} reports type feedback for the IC. |
| 692 if (nexus.IsUninitialized()) { | 692 if (nexus.IsUninitialized() || nexus.IsPremonomorphic()) { |
| 693 if ((flags() & kDeoptimizationEnabled) && | 693 if ((flags() & kDeoptimizationEnabled) && |
| 694 (flags() & kBailoutOnUninitialized)) { | 694 (flags() & kBailoutOnUninitialized)) { |
| 695 return ReduceSoftDeoptimize( | 695 return ReduceSoftDeoptimize( |
| 696 node, | 696 node, |
| 697 DeoptimizeReason::kInsufficientTypeFeedbackForGenericKeyedAccess); | 697 DeoptimizeReason::kInsufficientTypeFeedbackForGenericKeyedAccess); |
| 698 } | 698 } |
| 699 return NoChange(); | 699 return NoChange(); |
| 700 } | 700 } |
| 701 | 701 |
| 702 // Extract receiver maps from the {nexus}. | 702 // Extract receiver maps from the {nexus}. |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 } | 1480 } |
| 1481 | 1481 |
| 1482 | 1482 |
| 1483 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 1483 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
| 1484 return jsgraph()->simplified(); | 1484 return jsgraph()->simplified(); |
| 1485 } | 1485 } |
| 1486 | 1486 |
| 1487 } // namespace compiler | 1487 } // namespace compiler |
| 1488 } // namespace internal | 1488 } // namespace internal |
| 1489 } // namespace v8 | 1489 } // namespace v8 |
| OLD | NEW |