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 23 matching lines...) Expand all Loading... |
34 // [2 + number of transitions * kTransitionSize]: start of slack | 34 // [2 + number of transitions * kTransitionSize]: start of slack |
35 class TransitionArray: public FixedArray { | 35 class TransitionArray: public FixedArray { |
36 public: | 36 public: |
37 // Insert a new transition into |map|'s transition array, extending it | 37 // Insert a new transition into |map|'s transition array, extending it |
38 // as necessary. | 38 // as necessary. |
39 static void Insert(Handle<Map> map, Handle<Name> name, Handle<Map> target, | 39 static void Insert(Handle<Map> map, Handle<Name> name, Handle<Map> target, |
40 SimpleTransitionFlag flag); | 40 SimpleTransitionFlag flag); |
41 | 41 |
42 static Map* SearchTransition(Map* map, PropertyKind kind, Name* name, | 42 static Map* SearchTransition(Map* map, PropertyKind kind, Name* name, |
43 PropertyAttributes attributes); | 43 PropertyAttributes attributes); |
| 44 static MaybeHandle<Map> SearchTransition(Handle<Map> map, PropertyKind kind, |
| 45 Handle<Name> name, |
| 46 PropertyAttributes attributes) { |
| 47 if (Map* transition = SearchTransition(*map, kind, *name, attributes)) { |
| 48 return handle(transition); |
| 49 } |
| 50 return MaybeHandle<Map>(); |
| 51 } |
44 | 52 |
45 static Map* SearchSpecial(Map* map, Symbol* name); | 53 static Map* SearchSpecial(Map* map, Symbol* name); |
46 | 54 |
47 static Handle<Map> FindTransitionToField(Handle<Map> map, Handle<Name> name); | 55 static Handle<Map> FindTransitionToField(Handle<Map> map, Handle<Name> name); |
48 | 56 |
49 static Handle<String> ExpectedTransitionKey(Handle<Map> map); | 57 static Handle<String> ExpectedTransitionKey(Handle<Map> map); |
50 | 58 |
51 static Handle<Map> ExpectedTransitionTarget(Handle<Map> map) { | 59 static Handle<Map> ExpectedTransitionTarget(Handle<Map> map) { |
52 DCHECK(!ExpectedTransitionKey(map).is_null()); | 60 DCHECK(!ExpectedTransitionKey(map).is_null()); |
53 return Handle<Map>(GetSimpleTransition(map->raw_transitions())); | 61 return Handle<Map>(GetSimpleTransition(map->raw_transitions())); |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 #endif | 307 #endif |
300 | 308 |
301 DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray); | 309 DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray); |
302 }; | 310 }; |
303 | 311 |
304 | 312 |
305 } // namespace internal | 313 } // namespace internal |
306 } // namespace v8 | 314 } // namespace v8 |
307 | 315 |
308 #endif // V8_TRANSITIONS_H_ | 316 #endif // V8_TRANSITIONS_H_ |
OLD | NEW |