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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/objects.h" | 7 #include "src/objects.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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 array->SetTarget(index, array->GetTarget(index - 1)); | 99 array->SetTarget(index, array->GetTarget(index - 1)); |
100 } | 100 } |
101 array->SetKey(index, *name); | 101 array->SetKey(index, *name); |
102 array->SetTarget(index, *target); | 102 array->SetTarget(index, *target); |
103 SLOW_DCHECK(array->IsSortedNoDuplicates()); | 103 SLOW_DCHECK(array->IsSortedNoDuplicates()); |
104 return; | 104 return; |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 // We're gonna need a bigger TransitionArray. | 108 // We're gonna need a bigger TransitionArray. |
109 Handle<TransitionArray> result = Allocate( | 109 Handle<TransitionArray> result = |
110 map->GetIsolate(), new_nof, | 110 Allocate(map->GetIsolate(), new_nof, |
111 Map::SlackForArraySize(number_of_transitions, kMaxNumberOfTransitions)); | 111 Map::SlackForArraySize(false, number_of_transitions, |
| 112 kMaxNumberOfTransitions)); |
112 | 113 |
113 // The map's transition array may have shrunk during the allocation above as | 114 // The map's transition array may have shrunk during the allocation above as |
114 // it was weakly traversed, though it is guaranteed not to disappear. Trim the | 115 // it was weakly traversed, though it is guaranteed not to disappear. Trim the |
115 // result copy if needed, and recompute variables. | 116 // result copy if needed, and recompute variables. |
116 DCHECK(IsFullTransitionArray(map->raw_transitions())); | 117 DCHECK(IsFullTransitionArray(map->raw_transitions())); |
117 DisallowHeapAllocation no_gc; | 118 DisallowHeapAllocation no_gc; |
118 TransitionArray* array = TransitionArray::cast(map->raw_transitions()); | 119 TransitionArray* array = TransitionArray::cast(map->raw_transitions()); |
119 if (array->number_of_transitions() != number_of_transitions) { | 120 if (array->number_of_transitions() != number_of_transitions) { |
120 DCHECK(array->number_of_transitions() < number_of_transitions); | 121 DCHECK(array->number_of_transitions() < number_of_transitions); |
121 | 122 |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 PropertyAttributes attributes, | 515 PropertyAttributes attributes, |
515 int* out_insertion_index) { | 516 int* out_insertion_index) { |
516 int transition = SearchName(name, out_insertion_index); | 517 int transition = SearchName(name, out_insertion_index); |
517 if (transition == kNotFound) { | 518 if (transition == kNotFound) { |
518 return kNotFound; | 519 return kNotFound; |
519 } | 520 } |
520 return SearchDetails(transition, kind, attributes, out_insertion_index); | 521 return SearchDetails(transition, kind, attributes, out_insertion_index); |
521 } | 522 } |
522 } // namespace internal | 523 } // namespace internal |
523 } // namespace v8 | 524 } // namespace v8 |
OLD | NEW |