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 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2026 // this object takes up nearly as much space as a fast-case backing | 2026 // this object takes up nearly as much space as a fast-case backing |
2027 // storage would. In that case the JSObject should have fast | 2027 // storage would. In that case the JSObject should have fast |
2028 // elements. | 2028 // elements. |
2029 bool ShouldConvertToFastElements(); | 2029 bool ShouldConvertToFastElements(); |
2030 // Returns true if the elements of JSObject contains only values that can be | 2030 // Returns true if the elements of JSObject contains only values that can be |
2031 // represented in a FixedDoubleArray and has at least one value that can only | 2031 // represented in a FixedDoubleArray and has at least one value that can only |
2032 // be represented as a double and not a Smi. | 2032 // be represented as a double and not a Smi. |
2033 bool ShouldConvertToFastDoubleElements(bool* has_smi_only_elements); | 2033 bool ShouldConvertToFastDoubleElements(bool* has_smi_only_elements); |
2034 | 2034 |
2035 // Computes the new capacity when expanding the elements of a JSObject. | 2035 // Computes the new capacity when expanding the elements of a JSObject. |
2036 static int NewElementsCapacity(int old_capacity) { | 2036 static uint32_t NewElementsCapacity(uint32_t old_capacity) { |
2037 // (old_capacity + 50%) + 16 | 2037 // (old_capacity + 50%) + 16 |
2038 return old_capacity + (old_capacity >> 1) + 16; | 2038 return old_capacity + (old_capacity >> 1) + 16; |
2039 } | 2039 } |
2040 | 2040 |
2041 // These methods do not perform access checks! | 2041 // These methods do not perform access checks! |
2042 static void UpdateAllocationSite(Handle<JSObject> object, | 2042 static void UpdateAllocationSite(Handle<JSObject> object, |
2043 ElementsKind to_kind); | 2043 ElementsKind to_kind); |
2044 | 2044 |
2045 enum SetFastElementsCapacitySmiMode { | 2045 enum SetFastElementsCapacitySmiMode { |
2046 kAllowSmiElements, | 2046 kAllowSmiElements, |
(...skipping 8814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10861 } else { | 10861 } else { |
10862 value &= ~(1 << bit_position); | 10862 value &= ~(1 << bit_position); |
10863 } | 10863 } |
10864 return value; | 10864 return value; |
10865 } | 10865 } |
10866 }; | 10866 }; |
10867 | 10867 |
10868 } } // namespace v8::internal | 10868 } } // namespace v8::internal |
10869 | 10869 |
10870 #endif // V8_OBJECTS_H_ | 10870 #endif // V8_OBJECTS_H_ |
OLD | NEW |