| OLD | NEW |
| 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 2484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2495 | 2495 |
| 2496 if (number == DescriptorLookupCache::kAbsent) { | 2496 if (number == DescriptorLookupCache::kAbsent) { |
| 2497 number = Search(name, number_of_own_descriptors); | 2497 number = Search(name, number_of_own_descriptors); |
| 2498 cache->Update(map, name, number); | 2498 cache->Update(map, name, number); |
| 2499 } | 2499 } |
| 2500 | 2500 |
| 2501 return number; | 2501 return number; |
| 2502 } | 2502 } |
| 2503 | 2503 |
| 2504 | 2504 |
| 2505 PropertyDetails Map::GetLastDescriptorDetails() { |
| 2506 return instance_descriptors()->GetDetails(LastAdded()); |
| 2507 } |
| 2508 |
| 2509 |
| 2505 void Map::LookupDescriptor(JSObject* holder, | 2510 void Map::LookupDescriptor(JSObject* holder, |
| 2506 Name* name, | 2511 Name* name, |
| 2507 LookupResult* result) { | 2512 LookupResult* result) { |
| 2508 DescriptorArray* descriptors = this->instance_descriptors(); | 2513 DescriptorArray* descriptors = this->instance_descriptors(); |
| 2509 int number = descriptors->SearchWithCache(name, this); | 2514 int number = descriptors->SearchWithCache(name, this); |
| 2510 if (number == DescriptorArray::kNotFound) return result->NotFound(); | 2515 if (number == DescriptorArray::kNotFound) return result->NotFound(); |
| 2511 result->DescriptorResult(holder, descriptors->GetDetails(number), number); | 2516 result->DescriptorResult(holder, descriptors->GetDetails(number), number); |
| 2512 } | 2517 } |
| 2513 | 2518 |
| 2514 | 2519 |
| 2515 void Map::LookupTransition(JSObject* holder, | 2520 void Map::LookupTransition(JSObject* holder, |
| 2516 Name* name, | 2521 Name* name, |
| 2517 LookupResult* result) { | 2522 LookupResult* result) { |
| 2518 if (HasTransitionArray()) { | 2523 if (HasTransitionArray()) { |
| 2519 TransitionArray* transition_array = transitions(); | 2524 TransitionArray* transition_array = transitions(); |
| 2520 int number = transition_array->Search(name); | 2525 int number = transition_array->Search(name); |
| 2521 if (number != TransitionArray::kNotFound) { | 2526 if (number != TransitionArray::kNotFound) { |
| 2522 return result->TransitionResult(holder, number); | 2527 return result->TransitionResult( |
| 2528 holder, transition_array->GetTarget(number)); |
| 2523 } | 2529 } |
| 2524 } | 2530 } |
| 2525 result->NotFound(); | 2531 result->NotFound(); |
| 2526 } | 2532 } |
| 2527 | 2533 |
| 2528 | 2534 |
| 2529 Object** DescriptorArray::GetKeySlot(int descriptor_number) { | 2535 Object** DescriptorArray::GetKeySlot(int descriptor_number) { |
| 2530 ASSERT(descriptor_number < number_of_descriptors()); | 2536 ASSERT(descriptor_number < number_of_descriptors()); |
| 2531 return RawFieldOfElementAt(ToKeyIndex(descriptor_number)); | 2537 return RawFieldOfElementAt(ToKeyIndex(descriptor_number)); |
| 2532 } | 2538 } |
| (...skipping 4257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6790 #undef READ_UINT32_FIELD | 6796 #undef READ_UINT32_FIELD |
| 6791 #undef WRITE_UINT32_FIELD | 6797 #undef WRITE_UINT32_FIELD |
| 6792 #undef READ_SHORT_FIELD | 6798 #undef READ_SHORT_FIELD |
| 6793 #undef WRITE_SHORT_FIELD | 6799 #undef WRITE_SHORT_FIELD |
| 6794 #undef READ_BYTE_FIELD | 6800 #undef READ_BYTE_FIELD |
| 6795 #undef WRITE_BYTE_FIELD | 6801 #undef WRITE_BYTE_FIELD |
| 6796 | 6802 |
| 6797 } } // namespace v8::internal | 6803 } } // namespace v8::internal |
| 6798 | 6804 |
| 6799 #endif // V8_OBJECTS_INL_H_ | 6805 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |