| 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 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1760 | 1760 |
| 1761 if (store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS) { | 1761 if (store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS) { |
| 1762 // Check that the {index} is a valid array index, we do the actual | 1762 // Check that the {index} is a valid array index, we do the actual |
| 1763 // bounds check below and just skip the store below if it's out of | 1763 // bounds check below and just skip the store below if it's out of |
| 1764 // bounds for the {receiver}. | 1764 // bounds for the {receiver}. |
| 1765 index = effect = graph()->NewNode(simplified()->CheckBounds(), index, | 1765 index = effect = graph()->NewNode(simplified()->CheckBounds(), index, |
| 1766 jsgraph()->Constant(Smi::kMaxValue), | 1766 jsgraph()->Constant(Smi::kMaxValue), |
| 1767 effect, control); | 1767 effect, control); |
| 1768 } else { | 1768 } else { |
| 1769 // Check that the {index} is in the valid range for the {receiver}. | 1769 // Check that the {index} is in the valid range for the {receiver}. |
| 1770 DCHECK_EQ(STANDARD_STORE, store_mode); | |
| 1771 index = effect = graph()->NewNode(simplified()->CheckBounds(), index, | 1770 index = effect = graph()->NewNode(simplified()->CheckBounds(), index, |
| 1772 length, effect, control); | 1771 length, effect, control); |
| 1773 } | 1772 } |
| 1774 | 1773 |
| 1775 // Access the actual element. | 1774 // Access the actual element. |
| 1776 ExternalArrayType external_array_type = | 1775 ExternalArrayType external_array_type = |
| 1777 GetArrayTypeFromElementsKind(elements_kind); | 1776 GetArrayTypeFromElementsKind(elements_kind); |
| 1778 switch (access_mode) { | 1777 switch (access_mode) { |
| 1779 case AccessMode::kLoad: { | 1778 case AccessMode::kLoad: { |
| 1780 value = effect = graph()->NewNode( | 1779 value = effect = graph()->NewNode( |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1818 Node* efalse = effect; | 1817 Node* efalse = effect; |
| 1819 { | 1818 { |
| 1820 // Just ignore the out-of-bounds write. | 1819 // Just ignore the out-of-bounds write. |
| 1821 } | 1820 } |
| 1822 | 1821 |
| 1823 control = graph()->NewNode(common()->Merge(2), if_true, if_false); | 1822 control = graph()->NewNode(common()->Merge(2), if_true, if_false); |
| 1824 effect = | 1823 effect = |
| 1825 graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control); | 1824 graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control); |
| 1826 } else { | 1825 } else { |
| 1827 // Perform the actual store | 1826 // Perform the actual store |
| 1828 DCHECK_EQ(STANDARD_STORE, store_mode); | |
| 1829 effect = graph()->NewNode( | 1827 effect = graph()->NewNode( |
| 1830 simplified()->StoreTypedElement(external_array_type), buffer, | 1828 simplified()->StoreTypedElement(external_array_type), buffer, |
| 1831 base_pointer, external_pointer, index, value, effect, control); | 1829 base_pointer, external_pointer, index, value, effect, control); |
| 1832 } | 1830 } |
| 1833 break; | 1831 break; |
| 1834 } | 1832 } |
| 1835 } | 1833 } |
| 1836 } else { | 1834 } else { |
| 1837 // Load the elements for the {receiver}. | 1835 // Load the elements for the {receiver}. |
| 1838 Node* elements = effect = graph()->NewNode( | 1836 Node* elements = effect = graph()->NewNode( |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2260 return jsgraph()->javascript(); | 2258 return jsgraph()->javascript(); |
| 2261 } | 2259 } |
| 2262 | 2260 |
| 2263 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 2261 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
| 2264 return jsgraph()->simplified(); | 2262 return jsgraph()->simplified(); |
| 2265 } | 2263 } |
| 2266 | 2264 |
| 2267 } // namespace compiler | 2265 } // namespace compiler |
| 2268 } // namespace internal | 2266 } // namespace internal |
| 2269 } // namespace v8 | 2267 } // namespace v8 |
| OLD | NEW |