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

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

Issue 170343003: Directly store the transition target on LookupResult in TransitionResult. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 | « src/objects.h ('k') | src/property.h » ('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 // 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 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after
2490 2490
2491 if (number == DescriptorLookupCache::kAbsent) { 2491 if (number == DescriptorLookupCache::kAbsent) {
2492 number = Search(name, number_of_own_descriptors); 2492 number = Search(name, number_of_own_descriptors);
2493 cache->Update(map, name, number); 2493 cache->Update(map, name, number);
2494 } 2494 }
2495 2495
2496 return number; 2496 return number;
2497 } 2497 }
2498 2498
2499 2499
2500 PropertyDetails Map::GetLastDescriptorDetails() {
2501 return instance_descriptors()->GetDetails(LastAdded());
2502 }
2503
2504
2500 void Map::LookupDescriptor(JSObject* holder, 2505 void Map::LookupDescriptor(JSObject* holder,
2501 Name* name, 2506 Name* name,
2502 LookupResult* result) { 2507 LookupResult* result) {
2503 DescriptorArray* descriptors = this->instance_descriptors(); 2508 DescriptorArray* descriptors = this->instance_descriptors();
2504 int number = descriptors->SearchWithCache(name, this); 2509 int number = descriptors->SearchWithCache(name, this);
2505 if (number == DescriptorArray::kNotFound) return result->NotFound(); 2510 if (number == DescriptorArray::kNotFound) return result->NotFound();
2506 result->DescriptorResult(holder, descriptors->GetDetails(number), number); 2511 result->DescriptorResult(holder, descriptors->GetDetails(number), number);
2507 } 2512 }
2508 2513
2509 2514
2510 void Map::LookupTransition(JSObject* holder, 2515 void Map::LookupTransition(JSObject* holder,
2511 Name* name, 2516 Name* name,
2512 LookupResult* result) { 2517 LookupResult* result) {
2513 if (HasTransitionArray()) { 2518 if (HasTransitionArray()) {
2514 TransitionArray* transition_array = transitions(); 2519 TransitionArray* transition_array = transitions();
2515 int number = transition_array->Search(name); 2520 int number = transition_array->Search(name);
2516 if (number != TransitionArray::kNotFound) { 2521 if (number != TransitionArray::kNotFound) {
2517 return result->TransitionResult(holder, number); 2522 return result->TransitionResult(
2523 holder, transition_array->GetTarget(number));
2518 } 2524 }
2519 } 2525 }
2520 result->NotFound(); 2526 result->NotFound();
2521 } 2527 }
2522 2528
2523 2529
2524 Object** DescriptorArray::GetKeySlot(int descriptor_number) { 2530 Object** DescriptorArray::GetKeySlot(int descriptor_number) {
2525 ASSERT(descriptor_number < number_of_descriptors()); 2531 ASSERT(descriptor_number < number_of_descriptors());
2526 return RawFieldOfElementAt(ToKeyIndex(descriptor_number)); 2532 return RawFieldOfElementAt(ToKeyIndex(descriptor_number));
2527 } 2533 }
(...skipping 4211 matching lines...) Expand 10 before | Expand all | Expand 10 after
6739 #undef READ_UINT32_FIELD 6745 #undef READ_UINT32_FIELD
6740 #undef WRITE_UINT32_FIELD 6746 #undef WRITE_UINT32_FIELD
6741 #undef READ_SHORT_FIELD 6747 #undef READ_SHORT_FIELD
6742 #undef WRITE_SHORT_FIELD 6748 #undef WRITE_SHORT_FIELD
6743 #undef READ_BYTE_FIELD 6749 #undef READ_BYTE_FIELD
6744 #undef WRITE_BYTE_FIELD 6750 #undef WRITE_BYTE_FIELD
6745 6751
6746 } } // namespace v8::internal 6752 } } // namespace v8::internal
6747 6753
6748 #endif // V8_OBJECTS_INL_H_ 6754 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/property.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698