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

Side by Side Diff: src/transitions.cc

Issue 2624903003: [runtime] Use PropertyKind/PropertyLocation instead of PropertyType. (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
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 #include "src/transitions.h" 5 #include "src/transitions.h"
6 6
7 #include "src/objects-inl.h" 7 #include "src/objects-inl.h"
8 #include "src/transitions-inl.h" 8 #include "src/transitions-inl.h"
9 #include "src/utils.h" 9 #include "src/utils.h"
10 10
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 195
196 // static 196 // static
197 Handle<Map> TransitionArray::FindTransitionToField(Handle<Map> map, 197 Handle<Map> TransitionArray::FindTransitionToField(Handle<Map> map,
198 Handle<Name> name) { 198 Handle<Name> name) {
199 DCHECK(name->IsUniqueName()); 199 DCHECK(name->IsUniqueName());
200 DisallowHeapAllocation no_gc; 200 DisallowHeapAllocation no_gc;
201 Map* target = SearchTransition(*map, kData, *name, NONE); 201 Map* target = SearchTransition(*map, kData, *name, NONE);
202 if (target == NULL) return Handle<Map>::null(); 202 if (target == NULL) return Handle<Map>::null();
203 PropertyDetails details = target->GetLastDescriptorDetails(); 203 PropertyDetails details = target->GetLastDescriptorDetails();
204 DCHECK_EQ(NONE, details.attributes()); 204 DCHECK_EQ(NONE, details.attributes());
205 if (details.type() != DATA) return Handle<Map>::null(); 205 if (details.location() != kField) return Handle<Map>::null();
206 return Handle<Map>(target); 206 return Handle<Map>(target);
207 } 207 }
208 208
209 209
210 // static 210 // static
211 Handle<String> TransitionArray::ExpectedTransitionKey(Handle<Map> map) { 211 Handle<String> TransitionArray::ExpectedTransitionKey(Handle<Map> map) {
212 DisallowHeapAllocation no_gc; 212 DisallowHeapAllocation no_gc;
213 Object* raw_transition = map->raw_transitions(); 213 Object* raw_transition = map->raw_transitions();
214 if (!IsSimpleTransition(raw_transition)) return Handle<String>::null(); 214 if (!IsSimpleTransition(raw_transition)) return Handle<String>::null();
215 Map* target = GetSimpleTransition(raw_transition); 215 Map* target = GetSimpleTransition(raw_transition);
216 PropertyDetails details = GetSimpleTargetDetails(target); 216 PropertyDetails details = GetSimpleTargetDetails(target);
217 if (details.type() != DATA) return Handle<String>::null(); 217 if (details.location() != kField) return Handle<String>::null();
218 if (details.attributes() != NONE) return Handle<String>::null(); 218 if (details.attributes() != NONE) return Handle<String>::null();
219 Name* name = GetSimpleTransitionKey(target); 219 Name* name = GetSimpleTransitionKey(target);
220 if (!name->IsString()) return Handle<String>::null(); 220 if (!name->IsString()) return Handle<String>::null();
221 return Handle<String>(String::cast(name)); 221 return Handle<String>(String::cast(name));
222 } 222 }
223 223
224 224
225 // static 225 // static
226 bool TransitionArray::CanHaveMoreTransitions(Handle<Map> map) { 226 bool TransitionArray::CanHaveMoreTransitions(Handle<Map> map) {
227 if (map->is_dictionary_map()) return false; 227 if (map->is_dictionary_map()) return false;
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 544
545 int TransitionArray::Search(PropertyKind kind, Name* name, 545 int TransitionArray::Search(PropertyKind kind, Name* name,
546 PropertyAttributes attributes, 546 PropertyAttributes attributes,
547 int* out_insertion_index) { 547 int* out_insertion_index) {
548 int transition = SearchName(name, out_insertion_index); 548 int transition = SearchName(name, out_insertion_index);
549 if (transition == kNotFound) return kNotFound; 549 if (transition == kNotFound) return kNotFound;
550 return SearchDetails(transition, kind, attributes, out_insertion_index); 550 return SearchDetails(transition, kind, attributes, out_insertion_index);
551 } 551 }
552 } // namespace internal 552 } // namespace internal
553 } // namespace v8 553 } // namespace v8
OLDNEW
« src/lookup.cc ('K') | « src/string-stream.cc ('k') | src/value-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698