| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 if (details.type() != DATA) return Handle<String>::null(); | 216 if (details.type() != DATA) return Handle<String>::null(); |
| 217 if (details.attributes() != NONE) return Handle<String>::null(); | 217 if (details.attributes() != NONE) return Handle<String>::null(); |
| 218 Name* name = GetSimpleTransitionKey(target); | 218 Name* name = GetSimpleTransitionKey(target); |
| 219 if (!name->IsString()) return Handle<String>::null(); | 219 if (!name->IsString()) return Handle<String>::null(); |
| 220 return Handle<String>(String::cast(name)); | 220 return Handle<String>(String::cast(name)); |
| 221 } | 221 } |
| 222 | 222 |
| 223 | 223 |
| 224 // static | 224 // static |
| 225 bool TransitionArray::CanHaveMoreTransitions(Handle<Map> map) { | 225 bool TransitionArray::CanHaveMoreTransitions(Handle<Map> map) { |
| 226 if (map->is_dictionary_map()) return false; |
| 226 Object* raw_transitions = map->raw_transitions(); | 227 Object* raw_transitions = map->raw_transitions(); |
| 227 if (IsFullTransitionArray(raw_transitions)) { | 228 if (IsFullTransitionArray(raw_transitions)) { |
| 228 TransitionArray* transitions = TransitionArray::cast(raw_transitions); | 229 TransitionArray* transitions = TransitionArray::cast(raw_transitions); |
| 229 return transitions->number_of_transitions() < kMaxNumberOfTransitions; | 230 return transitions->number_of_transitions() < kMaxNumberOfTransitions; |
| 230 } | 231 } |
| 231 return true; | 232 return true; |
| 232 } | 233 } |
| 233 | 234 |
| 234 | 235 |
| 235 // static | 236 // static |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 PropertyAttributes attributes, | 514 PropertyAttributes attributes, |
| 514 int* out_insertion_index) { | 515 int* out_insertion_index) { |
| 515 int transition = SearchName(name, out_insertion_index); | 516 int transition = SearchName(name, out_insertion_index); |
| 516 if (transition == kNotFound) { | 517 if (transition == kNotFound) { |
| 517 return kNotFound; | 518 return kNotFound; |
| 518 } | 519 } |
| 519 return SearchDetails(transition, kind, attributes, out_insertion_index); | 520 return SearchDetails(transition, kind, attributes, out_insertion_index); |
| 520 } | 521 } |
| 521 } // namespace internal | 522 } // namespace internal |
| 522 } // namespace v8 | 523 } // namespace v8 |
| OLD | NEW |