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 #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 Loading... |
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 Loading... |
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 |
OLD | NEW |