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

Side by Side Diff: src/transitions.cc

Issue 2624903003: [runtime] Use PropertyKind/PropertyLocation instead of PropertyType. (Closed)
Patch Set: Addressing comments 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
« no previous file with comments | « src/string-stream.cc ('k') | src/value-serializer.cc » ('j') | 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 // 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 DCHECK_EQ(kData, details.kind());
206 return Handle<Map>(target); 207 return Handle<Map>(target);
207 } 208 }
208 209
209 210
210 // static 211 // static
211 Handle<String> TransitionArray::ExpectedTransitionKey(Handle<Map> map) { 212 Handle<String> TransitionArray::ExpectedTransitionKey(Handle<Map> map) {
212 DisallowHeapAllocation no_gc; 213 DisallowHeapAllocation no_gc;
213 Object* raw_transition = map->raw_transitions(); 214 Object* raw_transition = map->raw_transitions();
214 if (!IsSimpleTransition(raw_transition)) return Handle<String>::null(); 215 if (!IsSimpleTransition(raw_transition)) return Handle<String>::null();
215 Map* target = GetSimpleTransition(raw_transition); 216 Map* target = GetSimpleTransition(raw_transition);
216 PropertyDetails details = GetSimpleTargetDetails(target); 217 PropertyDetails details = GetSimpleTargetDetails(target);
217 if (details.type() != DATA) return Handle<String>::null(); 218 if (details.location() != kField) return Handle<String>::null();
219 DCHECK_EQ(kData, details.kind());
218 if (details.attributes() != NONE) return Handle<String>::null(); 220 if (details.attributes() != NONE) return Handle<String>::null();
219 Name* name = GetSimpleTransitionKey(target); 221 Name* name = GetSimpleTransitionKey(target);
220 if (!name->IsString()) return Handle<String>::null(); 222 if (!name->IsString()) return Handle<String>::null();
221 return Handle<String>(String::cast(name)); 223 return Handle<String>(String::cast(name));
222 } 224 }
223 225
224 226
225 // static 227 // static
226 bool TransitionArray::CanHaveMoreTransitions(Handle<Map> map) { 228 bool TransitionArray::CanHaveMoreTransitions(Handle<Map> map) {
227 if (map->is_dictionary_map()) return false; 229 if (map->is_dictionary_map()) return false;
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 546
545 int TransitionArray::Search(PropertyKind kind, Name* name, 547 int TransitionArray::Search(PropertyKind kind, Name* name,
546 PropertyAttributes attributes, 548 PropertyAttributes attributes,
547 int* out_insertion_index) { 549 int* out_insertion_index) {
548 int transition = SearchName(name, out_insertion_index); 550 int transition = SearchName(name, out_insertion_index);
549 if (transition == kNotFound) return kNotFound; 551 if (transition == kNotFound) return kNotFound;
550 return SearchDetails(transition, kind, attributes, out_insertion_index); 552 return SearchDetails(transition, kind, attributes, out_insertion_index);
551 } 553 }
552 } // namespace internal 554 } // namespace internal
553 } // namespace v8 555 } // namespace v8
OLDNEW
« no previous file with comments | « src/string-stream.cc ('k') | src/value-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698