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

Side by Side Diff: src/objects.h

Issue 279773002: Fix Array.prototype.push and Array.prototype.unshift for read-only length. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Extend test Created 6 years, 7 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 | Annotate | Revision Log
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 "allocation.h" 8 #include "allocation.h"
9 #include "assert-scope.h" 9 #include "assert-scope.h"
10 #include "builtins.h" 10 #include "builtins.h"
(...skipping 10321 matching lines...) Expand 10 before | Expand all | Expand 10 after
10332 DECL_ACCESSORS(length, Object) 10332 DECL_ACCESSORS(length, Object)
10333 10333
10334 // Overload the length setter to skip write barrier when the length 10334 // Overload the length setter to skip write barrier when the length
10335 // is set to a smi. This matches the set function on FixedArray. 10335 // is set to a smi. This matches the set function on FixedArray.
10336 inline void set_length(Smi* length); 10336 inline void set_length(Smi* length);
10337 10337
10338 static void JSArrayUpdateLengthFromIndex(Handle<JSArray> array, 10338 static void JSArrayUpdateLengthFromIndex(Handle<JSArray> array,
10339 uint32_t index, 10339 uint32_t index,
10340 Handle<Object> value); 10340 Handle<Object> value);
10341 10341
10342 static bool IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map);
10343 static bool ChangeOfReadOnlyLength(Handle<JSArray> array, uint32_t index);
10344 static MaybeHandle<Object> ReadOnlyLengthError(Handle<JSArray> array);
10345
10342 // Initialize the array with the given capacity. The function may 10346 // Initialize the array with the given capacity. The function may
10343 // fail due to out-of-memory situations, but only if the requested 10347 // fail due to out-of-memory situations, but only if the requested
10344 // capacity is non-zero. 10348 // capacity is non-zero.
10345 static void Initialize(Handle<JSArray> array, int capacity, int length = 0); 10349 static void Initialize(Handle<JSArray> array, int capacity, int length = 0);
10346 10350
10347 // Initializes the array to a certain length. 10351 // Initializes the array to a certain length.
10348 inline bool AllowsSetElementsLength(); 10352 inline bool AllowsSetElementsLength();
10349 // Can cause GC. 10353 // Can cause GC.
10350 MUST_USE_RESULT static MaybeHandle<Object> SetElementsLength( 10354 MUST_USE_RESULT static MaybeHandle<Object> SetElementsLength(
10351 Handle<JSArray> array, 10355 Handle<JSArray> array,
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
11119 } else { 11123 } else {
11120 value &= ~(1 << bit_position); 11124 value &= ~(1 << bit_position);
11121 } 11125 }
11122 return value; 11126 return value;
11123 } 11127 }
11124 }; 11128 };
11125 11129
11126 } } // namespace v8::internal 11130 } } // namespace v8::internal
11127 11131
11128 #endif // V8_OBJECTS_H_ 11132 #endif // V8_OBJECTS_H_
OLDNEW
« src/builtins.cc ('K') | « src/hydrogen.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698