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

Side by Side Diff: src/transitions-inl.h

Issue 11189089: Fast path for searching through simple transitions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: u Created 8 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 PropertyDetails TransitionArray::GetTargetDetails(int transition_number) { 185 PropertyDetails TransitionArray::GetTargetDetails(int transition_number) {
186 Map* map = GetTarget(transition_number); 186 Map* map = GetTarget(transition_number);
187 DescriptorArray* descriptors = map->instance_descriptors(); 187 DescriptorArray* descriptors = map->instance_descriptors();
188 int descriptor = map->LastAdded(); 188 int descriptor = map->LastAdded();
189 return descriptors->GetDetails(descriptor); 189 return descriptors->GetDetails(descriptor);
190 } 190 }
191 191
192 192
193 int TransitionArray::Search(String* name) { 193 int TransitionArray::Search(String* name) {
194 if (IsSimpleTransition()) {
195 String* key = GetKey(kSimpleTransitionIndex);
196 if (key->Equals(name)) return kSimpleTransitionIndex;
197 return kNotFound;
198 }
194 return internal::Search<ALL_ENTRIES>(this, name); 199 return internal::Search<ALL_ENTRIES>(this, name);
195 } 200 }
196 201
197 202
198 void TransitionArray::NoIncrementalWriteBarrierSet(int transition_number, 203 void TransitionArray::NoIncrementalWriteBarrierSet(int transition_number,
199 String* key, 204 String* key,
200 Map* target) { 205 Map* target) {
201 FixedArray::NoIncrementalWriteBarrierSet( 206 FixedArray::NoIncrementalWriteBarrierSet(
202 this, ToKeyIndex(transition_number), key); 207 this, ToKeyIndex(transition_number), key);
203 FixedArray::NoIncrementalWriteBarrierSet( 208 FixedArray::NoIncrementalWriteBarrierSet(
204 this, ToTargetIndex(transition_number), target); 209 this, ToTargetIndex(transition_number), target);
205 } 210 }
206 211
207 212
208 #undef FIELD_ADDR 213 #undef FIELD_ADDR
209 #undef WRITE_FIELD 214 #undef WRITE_FIELD
210 #undef CONDITIONAL_WRITE_BARRIER 215 #undef CONDITIONAL_WRITE_BARRIER
211 216
212 217
213 } } // namespace v8::internal 218 } } // namespace v8::internal
214 219
215 #endif // V8_TRANSITIONS_INL_H_ 220 #endif // V8_TRANSITIONS_INL_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698