Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1206)

Side by Side Diff: src/objects.h

Issue 1194943002: Inline SetLengthWithoutNormalize into its callers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Only find last non-configurable element in dicts if it can be present Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« src/elements.cc ('K') | « src/elements.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698