Index: src/compiler/js-native-context-specialization.cc |
diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc |
index 20d7e4d374da6d146728da65fd5ec522fb37c2ac..50c0851612cbcf1d01e9802ee0db0b43788b4875 100644 |
--- a/src/compiler/js-native-context-specialization.cc |
+++ b/src/compiler/js-native-context-specialization.cc |
@@ -634,6 +634,7 @@ Reduction JSNativeContextSpecialization::ReduceElementAccess( |
receiver, jsgraph()->HeapConstant(transition_target), context, |
frame_state, transition_effect, transition_control); |
} |
+ |
this_controls.push_back(transition_control); |
this_effects.push_back(transition_effect); |
} |
@@ -670,30 +671,6 @@ Reduction JSNativeContextSpecialization::ReduceElementAccess( |
AssumePrototypesStable(receiver_type, native_context, holder); |
} |
- // Check that the {index} is actually a Number. |
- if (!NumberMatcher(this_index).HasValue()) { |
- Node* check = |
- graph()->NewNode(simplified()->ObjectIsNumber(), this_index); |
- this_control = this_effect = |
- graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state, |
- this_effect, this_control); |
- this_index = graph()->NewNode(simplified()->TypeGuard(Type::Number()), |
- this_index, this_control); |
- } |
- |
- // Convert the {index} to an unsigned32 value and check if the result is |
- // equal to the original {index}. |
- if (!NumberMatcher(this_index).IsInRange(0.0, kMaxUInt32)) { |
- Node* this_index32 = |
- graph()->NewNode(simplified()->NumberToUint32(), this_index); |
- Node* check = graph()->NewNode(simplified()->NumberEqual(), this_index32, |
- this_index); |
- this_control = this_effect = |
- graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state, |
- this_effect, this_control); |
- this_index = this_index32; |
- } |
- |
// TODO(bmeurer): We currently specialize based on elements kind. We should |
// also be able to properly support strings and other JSObjects here. |
ElementsKind elements_kind = access_info.elements_kind(); |
@@ -729,10 +706,8 @@ Reduction JSNativeContextSpecialization::ReduceElementAccess( |
this_elements, this_effect, this_control); |
// Check that the {index} is in the valid range for the {receiver}. |
- Node* check = graph()->NewNode(simplified()->NumberLessThan(), this_index, |
- this_length); |
- this_control = this_effect = |
- graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state, |
+ this_index = this_effect = |
+ graph()->NewNode(simplified()->CheckBounds(), this_index, this_length, |
this_effect, this_control); |
// Compute the element access. |