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 #ifndef V8_TRANSITIONS_H_ | 5 #ifndef V8_TRANSITIONS_H_ |
6 #define V8_TRANSITIONS_H_ | 6 #define V8_TRANSITIONS_H_ |
7 | 7 |
8 #include "src/checks.h" | 8 #include "src/checks.h" |
9 #include "src/elements-kind.h" | 9 #include "src/elements-kind.h" |
10 #include "src/heap/heap.h" | 10 #include "src/heap/heap.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // Return a transition array, using the array from the owning map if it | 93 // Return a transition array, using the array from the owning map if it |
94 // already has one (copying into a larger array if necessary), otherwise | 94 // already has one (copying into a larger array if necessary), otherwise |
95 // creating a new one according to flag. | 95 // creating a new one according to flag. |
96 // TODO(verwaest): This should not cause an existing transition to be | 96 // TODO(verwaest): This should not cause an existing transition to be |
97 // overwritten. | 97 // overwritten. |
98 static Handle<TransitionArray> Insert(Handle<Map> map, Handle<Name> name, | 98 static Handle<TransitionArray> Insert(Handle<Map> map, Handle<Name> name, |
99 Handle<Map> target, | 99 Handle<Map> target, |
100 SimpleTransitionFlag flag); | 100 SimpleTransitionFlag flag); |
101 | 101 |
102 // Search a transition for a given property name. | 102 // Search a transition for a given property name. |
103 inline int Search(Name* name); | 103 inline int Search(Name* name, int* out_insertion_index = NULL); |
104 | 104 |
105 // Allocates a TransitionArray. | 105 // Allocates a TransitionArray. |
106 static Handle<TransitionArray> Allocate(Isolate* isolate, | 106 static Handle<TransitionArray> Allocate(Isolate* isolate, |
107 int number_of_transitions, | 107 int number_of_transitions, |
108 int slack = 0); | 108 int slack = 0); |
109 | 109 |
110 bool IsSimpleTransition() { | 110 bool IsSimpleTransition() { |
111 return length() == kSimpleTransitionSize && | 111 return length() == kSimpleTransitionSize && |
112 get(kSimpleTransitionTarget)->IsHeapObject() && | 112 get(kSimpleTransitionTarget)->IsHeapObject() && |
113 // The IntrusivePrototypeTransitionIterator may have set the map of the | 113 // The IntrusivePrototypeTransitionIterator may have set the map of the |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 int origin_transition, | 211 int origin_transition, |
212 int target_transition); | 212 int target_transition); |
213 | 213 |
214 DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray); | 214 DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray); |
215 }; | 215 }; |
216 | 216 |
217 | 217 |
218 } } // namespace v8::internal | 218 } } // namespace v8::internal |
219 | 219 |
220 #endif // V8_TRANSITIONS_H_ | 220 #endif // V8_TRANSITIONS_H_ |
OLD | NEW |