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

Side by Side Diff: src/objects.h

Issue 1086873003: Array() in optimized code can create with wrong ElementsKind in corner cases. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments and test failure. Created 5 years, 8 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
« no previous file with comments | « src/mips64/lithium-codegen-mips64.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10388 matching lines...) Expand 10 before | Expand all | Expand 10 after
10399 10399
10400 static bool HasReadOnlyLength(Handle<JSArray> array); 10400 static bool HasReadOnlyLength(Handle<JSArray> array);
10401 static bool WouldChangeReadOnlyLength(Handle<JSArray> array, uint32_t index); 10401 static bool WouldChangeReadOnlyLength(Handle<JSArray> array, uint32_t index);
10402 static MaybeHandle<Object> ReadOnlyLengthError(Handle<JSArray> array); 10402 static MaybeHandle<Object> ReadOnlyLengthError(Handle<JSArray> array);
10403 10403
10404 // Initialize the array with the given capacity. The function may 10404 // Initialize the array with the given capacity. The function may
10405 // fail due to out-of-memory situations, but only if the requested 10405 // fail due to out-of-memory situations, but only if the requested
10406 // capacity is non-zero. 10406 // capacity is non-zero.
10407 static void Initialize(Handle<JSArray> array, int capacity, int length = 0); 10407 static void Initialize(Handle<JSArray> array, int capacity, int length = 0);
10408 10408
10409 // If the JSArray has fast elements, and new_length would result in
10410 // normalization, returns true.
10411 static inline bool SetElementsLengthWouldNormalize(
10412 Heap* heap, Handle<Object> new_length_handle);
10413
10409 // Initializes the array to a certain length. 10414 // Initializes the array to a certain length.
10410 inline bool AllowsSetElementsLength(); 10415 inline bool AllowsSetElementsLength();
10411 // Can cause GC. 10416 // Can cause GC.
10412 MUST_USE_RESULT static MaybeHandle<Object> SetElementsLength( 10417 MUST_USE_RESULT static MaybeHandle<Object> SetElementsLength(
10413 Handle<JSArray> array, 10418 Handle<JSArray> array,
10414 Handle<Object> length); 10419 Handle<Object> length);
10415 10420
10416 // Set the content of the array to the content of storage. 10421 // Set the content of the array to the content of storage.
10417 static inline void SetContent(Handle<JSArray> array, 10422 static inline void SetContent(Handle<JSArray> array,
10418 Handle<FixedArrayBase> storage); 10423 Handle<FixedArrayBase> storage);
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
11075 } else { 11080 } else {
11076 value &= ~(1 << bit_position); 11081 value &= ~(1 << bit_position);
11077 } 11082 }
11078 return value; 11083 return value;
11079 } 11084 }
11080 }; 11085 };
11081 11086
11082 } } // namespace v8::internal 11087 } } // namespace v8::internal
11083 11088
11084 #endif // V8_OBJECTS_H_ 11089 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mips64/lithium-codegen-mips64.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698