| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 if (!map->HasTransitionArray()) { | 90 if (!map->HasTransitionArray()) { |
| 91 return TransitionArray::NewWith(map, name, target, flag); | 91 return TransitionArray::NewWith(map, name, target, flag); |
| 92 } | 92 } |
| 93 | 93 |
| 94 int number_of_transitions = map->transitions()->number_of_transitions(); | 94 int number_of_transitions = map->transitions()->number_of_transitions(); |
| 95 int new_nof = number_of_transitions; | 95 int new_nof = number_of_transitions; |
| 96 | 96 |
| 97 bool is_special_transition = flag == SPECIAL_TRANSITION; | 97 bool is_special_transition = flag == SPECIAL_TRANSITION; |
| 98 DCHECK_EQ(is_special_transition, IsSpecialTransition(*name)); | 98 DCHECK_EQ(is_special_transition, IsSpecialTransition(*name)); |
| 99 PropertyDetails details = is_special_transition | 99 PropertyDetails details = is_special_transition |
| 100 ? PropertyDetails(NONE, FIELD, 0) | 100 ? PropertyDetails(NONE, DATA, 0) |
| 101 : GetTargetDetails(*name, *target); | 101 : GetTargetDetails(*name, *target); |
| 102 | 102 |
| 103 int insertion_index = kNotFound; | 103 int insertion_index = kNotFound; |
| 104 int index = | 104 int index = |
| 105 is_special_transition | 105 is_special_transition |
| 106 ? map->transitions()->SearchSpecial(Symbol::cast(*name), | 106 ? map->transitions()->SearchSpecial(Symbol::cast(*name), |
| 107 &insertion_index) | 107 &insertion_index) |
| 108 : map->transitions()->Search(details.kind(), *name, | 108 : map->transitions()->Search(details.kind(), *name, |
| 109 details.attributes(), &insertion_index); | 109 details.attributes(), &insertion_index); |
| 110 if (index == kNotFound) { | 110 if (index == kNotFound) { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 int TransitionArray::Search(PropertyKind kind, Name* name, | 216 int TransitionArray::Search(PropertyKind kind, Name* name, |
| 217 PropertyAttributes attributes, | 217 PropertyAttributes attributes, |
| 218 int* out_insertion_index) { | 218 int* out_insertion_index) { |
| 219 int transition = SearchName(name, out_insertion_index); | 219 int transition = SearchName(name, out_insertion_index); |
| 220 if (transition == kNotFound) { | 220 if (transition == kNotFound) { |
| 221 return kNotFound; | 221 return kNotFound; |
| 222 } | 222 } |
| 223 return SearchDetails(transition, kind, attributes, out_insertion_index); | 223 return SearchDetails(transition, kind, attributes, out_insertion_index); |
| 224 } | 224 } |
| 225 } } // namespace v8::internal | 225 } } // namespace v8::internal |
| OLD | NEW |