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

Side by Side Diff: src/transitions.cc

Issue 1513313003: Pretenure prototype transitions array. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/transitions.h ('k') | src/transitions-inl.h » ('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 #include "src/transitions.h" 5 #include "src/transitions.h"
6 6
7 #include "src/objects-inl.h" 7 #include "src/objects-inl.h"
8 #include "src/transitions-inl.h" 8 #include "src/transitions-inl.h"
9 #include "src/utils.h" 9 #include "src/utils.h"
10 10
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 262
263 263
264 // static 264 // static
265 Handle<FixedArray> TransitionArray::GrowPrototypeTransitionArray( 265 Handle<FixedArray> TransitionArray::GrowPrototypeTransitionArray(
266 Handle<FixedArray> array, int new_capacity, Isolate* isolate) { 266 Handle<FixedArray> array, int new_capacity, Isolate* isolate) {
267 // Grow array by factor 2 up to MaxCachedPrototypeTransitions. 267 // Grow array by factor 2 up to MaxCachedPrototypeTransitions.
268 int capacity = array->length() - kProtoTransitionHeaderSize; 268 int capacity = array->length() - kProtoTransitionHeaderSize;
269 new_capacity = Min(kMaxCachedPrototypeTransitions, new_capacity); 269 new_capacity = Min(kMaxCachedPrototypeTransitions, new_capacity);
270 DCHECK_GT(new_capacity, capacity); 270 DCHECK_GT(new_capacity, capacity);
271 int grow_by = new_capacity - capacity; 271 int grow_by = new_capacity - capacity;
272 array = isolate->factory()->CopyFixedArrayAndGrow(array, grow_by); 272 array = isolate->factory()->CopyFixedArrayAndGrow(array, grow_by, TENURED);
273 if (capacity < 0) { 273 if (capacity < 0) {
274 // There was no prototype transitions array before, so the size 274 // There was no prototype transitions array before, so the size
275 // couldn't be copied. Initialize it explicitly. 275 // couldn't be copied. Initialize it explicitly.
276 SetNumberOfPrototypeTransitions(*array, 0); 276 SetNumberOfPrototypeTransitions(*array, 0);
277 } 277 }
278 return array; 278 return array;
279 } 279 }
280 280
281 281
282 // static 282 // static
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 PropertyAttributes attributes, 545 PropertyAttributes attributes,
546 int* out_insertion_index) { 546 int* out_insertion_index) {
547 int transition = SearchName(name, out_insertion_index); 547 int transition = SearchName(name, out_insertion_index);
548 if (transition == kNotFound) { 548 if (transition == kNotFound) {
549 return kNotFound; 549 return kNotFound;
550 } 550 }
551 return SearchDetails(transition, kind, attributes, out_insertion_index); 551 return SearchDetails(transition, kind, attributes, out_insertion_index);
552 } 552 }
553 } // namespace internal 553 } // namespace internal
554 } // namespace v8 554 } // namespace v8
OLDNEW
« no previous file with comments | « src/transitions.h ('k') | src/transitions-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698