OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 // Returns the number of transitions in the array. | 89 // Returns the number of transitions in the array. |
90 int number_of_transitions() { | 90 int number_of_transitions() { |
91 if (IsSimpleTransition()) return 1; | 91 if (IsSimpleTransition()) return 1; |
92 int len = length(); | 92 int len = length(); |
93 return len <= kFirstIndex ? 0 : (len - kFirstIndex) / kTransitionSize; | 93 return len <= kFirstIndex ? 0 : (len - kFirstIndex) / kTransitionSize; |
94 } | 94 } |
95 | 95 |
96 inline int number_of_entries() { return number_of_transitions(); } | 96 inline int number_of_entries() { return number_of_transitions(); } |
97 | 97 |
| 98 // Creates a FullTransitionArray from a SimpleTransitionArray in |
| 99 // containing_map. |
98 static Handle<TransitionArray> ExtendToFullTransitionArray( | 100 static Handle<TransitionArray> ExtendToFullTransitionArray( |
99 Handle<TransitionArray> array); | 101 Handle<Map> containing_map); |
100 | 102 |
101 // Create a transition array, copying from the owning map if it already has | 103 // Create a transition array, copying from the owning map if it already has |
102 // one, otherwise creating a new one according to flag. | 104 // one, otherwise creating a new one according to flag. |
103 // TODO(verwaest): This should not cause an existing transition to be | 105 // TODO(verwaest): This should not cause an existing transition to be |
104 // overwritten. | 106 // overwritten. |
105 static Handle<TransitionArray> CopyInsert(Handle<Map> map, | 107 static Handle<TransitionArray> CopyInsert(Handle<Map> map, |
106 Handle<Name> name, | 108 Handle<Name> name, |
107 Handle<Map> target, | 109 Handle<Map> target, |
108 SimpleTransitionFlag flag); | 110 SimpleTransitionFlag flag); |
109 | 111 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 int origin_transition, | 211 int origin_transition, |
210 int target_transition); | 212 int target_transition); |
211 | 213 |
212 DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray); | 214 DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray); |
213 }; | 215 }; |
214 | 216 |
215 | 217 |
216 } } // namespace v8::internal | 218 } } // namespace v8::internal |
217 | 219 |
218 #endif // V8_TRANSITIONS_H_ | 220 #endif // V8_TRANSITIONS_H_ |
OLD | NEW |