| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2012 // be represented as a double and not a Smi. | 2012 // be represented as a double and not a Smi. |
| 2013 bool ShouldConvertToFastDoubleElements(bool* has_smi_only_elements); | 2013 bool ShouldConvertToFastDoubleElements(bool* has_smi_only_elements); |
| 2014 | 2014 |
| 2015 // Computes the new capacity when expanding the elements of a JSObject. | 2015 // Computes the new capacity when expanding the elements of a JSObject. |
| 2016 static int NewElementsCapacity(int old_capacity) { | 2016 static int NewElementsCapacity(int old_capacity) { |
| 2017 // (old_capacity + 50%) + 16 | 2017 // (old_capacity + 50%) + 16 |
| 2018 return old_capacity + (old_capacity >> 1) + 16; | 2018 return old_capacity + (old_capacity >> 1) + 16; |
| 2019 } | 2019 } |
| 2020 | 2020 |
| 2021 // These methods do not perform access checks! | 2021 // These methods do not perform access checks! |
| 2022 MUST_USE_RESULT static MaybeHandle<AccessorPair> GetOwnElementAccessorPair( | |
| 2023 Handle<JSObject> object, uint32_t index); | |
| 2024 | |
| 2025 static void UpdateAllocationSite(Handle<JSObject> object, | 2022 static void UpdateAllocationSite(Handle<JSObject> object, |
| 2026 ElementsKind to_kind); | 2023 ElementsKind to_kind); |
| 2027 | 2024 |
| 2028 enum SetFastElementsCapacitySmiMode { | 2025 enum SetFastElementsCapacitySmiMode { |
| 2029 kAllowSmiElements, | 2026 kAllowSmiElements, |
| 2030 kForceSmiElements, | 2027 kForceSmiElements, |
| 2031 kDontAllowSmiElements | 2028 kDontAllowSmiElements |
| 2032 }; | 2029 }; |
| 2033 | 2030 |
| 2034 static Handle<FixedArray> SetFastElementsCapacity( | 2031 static Handle<FixedArray> SetFastElementsCapacity( |
| (...skipping 8818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10853 } else { | 10850 } else { |
| 10854 value &= ~(1 << bit_position); | 10851 value &= ~(1 << bit_position); |
| 10855 } | 10852 } |
| 10856 return value; | 10853 return value; |
| 10857 } | 10854 } |
| 10858 }; | 10855 }; |
| 10859 | 10856 |
| 10860 } } // namespace v8::internal | 10857 } } // namespace v8::internal |
| 10861 | 10858 |
| 10862 #endif // V8_OBJECTS_H_ | 10859 #endif // V8_OBJECTS_H_ |
| OLD | NEW |