Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/transitions.h

Issue 228333003: Handlefy Descriptor and other code in objects.cc (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Allocate a new transition array with a single entry. 98 // Allocate a new transition array with a single entry.
99 static MUST_USE_RESULT MaybeObject* NewWith( 99 static MUST_USE_RESULT MaybeObject* NewWith(
100 SimpleTransitionFlag flag, 100 SimpleTransitionFlag flag,
101 Name* key, 101 Name* key,
102 Map* target, 102 Map* target,
103 Object* back_pointer); 103 Object* back_pointer);
104 104
105 static Handle<TransitionArray> NewWithHandle(
106 SimpleTransitionFlag flag,
107 Handle<Name> key,
108 Handle<Map> target,
109 Handle<Object> back_pointer);
110
105 MUST_USE_RESULT MaybeObject* ExtendToFullTransitionArray(); 111 MUST_USE_RESULT MaybeObject* ExtendToFullTransitionArray();
106 112
107 // Copy the transition array, inserting a new transition. 113 // Copy the transition array, inserting a new transition.
108 // TODO(verwaest): This should not cause an existing transition to be 114 // TODO(verwaest): This should not cause an existing transition to be
109 // overwritten. 115 // overwritten.
110 MUST_USE_RESULT MaybeObject* CopyInsert(Name* name, Map* target); 116 static Handle<TransitionArray> CopyInsert(Handle<TransitionArray> array,
117 Handle<Name> name,
118 Handle<Map> target);
119
120 MUST_USE_RESULT MaybeObject* CopyInsert(Name* name,
121 Map* target);
111 122
112 // Copy a single transition from the origin array. 123 // Copy a single transition from the origin array.
113 inline void NoIncrementalWriteBarrierCopyFrom(TransitionArray* origin, 124 inline void NoIncrementalWriteBarrierCopyFrom(TransitionArray* origin,
114 int origin_transition, 125 int origin_transition,
115 int target_transition); 126 int target_transition);
116 127
117 // Search a transition for a given property name. 128 // Search a transition for a given property name.
118 inline int Search(Name* name); 129 inline int Search(Name* name);
119 130
120 // Allocates a TransitionArray. 131 // Allocates a TransitionArray.
132 static Handle<TransitionArray> AllocateHandle(
133 Isolate* isolate, int number_of_transitions);
134
121 MUST_USE_RESULT static MaybeObject* Allocate( 135 MUST_USE_RESULT static MaybeObject* Allocate(
122 Isolate* isolate, int number_of_transitions); 136 Isolate* isolate, int number_of_transitions);
123 137
124 bool IsSimpleTransition() { 138 bool IsSimpleTransition() {
125 return length() == kSimpleTransitionSize && 139 return length() == kSimpleTransitionSize &&
126 get(kSimpleTransitionTarget)->IsHeapObject() && 140 get(kSimpleTransitionTarget)->IsHeapObject() &&
127 // The IntrusivePrototypeTransitionIterator may have set the map of the 141 // The IntrusivePrototypeTransitionIterator may have set the map of the
128 // prototype transitions array to a smi. In that case, there are 142 // prototype transitions array to a smi. In that case, there are
129 // prototype transitions, hence this transition array is a full 143 // prototype transitions, hence this transition array is a full
130 // transition array. 144 // transition array.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 Name* key, 216 Name* key,
203 Map* target); 217 Map* target);
204 218
205 DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray); 219 DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray);
206 }; 220 };
207 221
208 222
209 } } // namespace v8::internal 223 } } // namespace v8::internal
210 224
211 #endif // V8_TRANSITIONS_H_ 225 #endif // V8_TRANSITIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698