| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_PROPERTY_H_ | 5 #ifndef V8_PROPERTY_H_ |
| 6 #define V8_PROPERTY_H_ | 6 #define V8_PROPERTY_H_ |
| 7 | 7 |
| 8 #include "src/factory.h" | 8 #include "src/factory.h" |
| 9 #include "src/field-index.h" | 9 #include "src/field-index.h" |
| 10 #include "src/field-index-inl.h" | 10 #include "src/field-index-inl.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 return GetFieldOwnerFromMap(holder()->map()); | 453 return GetFieldOwnerFromMap(holder()->map()); |
| 454 } | 454 } |
| 455 | 455 |
| 456 Map* GetFieldOwnerFromMap(Map* map) const { | 456 Map* GetFieldOwnerFromMap(Map* map) const { |
| 457 ASSERT(lookup_type_ == DESCRIPTOR_TYPE || | 457 ASSERT(lookup_type_ == DESCRIPTOR_TYPE || |
| 458 lookup_type_ == TRANSITION_TYPE); | 458 lookup_type_ == TRANSITION_TYPE); |
| 459 ASSERT(number_ < map->NumberOfOwnDescriptors()); | 459 ASSERT(number_ < map->NumberOfOwnDescriptors()); |
| 460 return map->FindFieldOwner(number_); | 460 return map->FindFieldOwner(number_); |
| 461 } | 461 } |
| 462 | 462 |
| 463 bool ReceiverIsHolder(Handle<Object> receiver) { |
| 464 if (*receiver == holder()) return true; |
| 465 if (lookup_type_ == TRANSITION_TYPE) return true; |
| 466 return false; |
| 467 } |
| 468 |
| 463 void Iterate(ObjectVisitor* visitor); | 469 void Iterate(ObjectVisitor* visitor); |
| 464 | 470 |
| 465 private: | 471 private: |
| 466 Isolate* isolate_; | 472 Isolate* isolate_; |
| 467 LookupResult* next_; | 473 LookupResult* next_; |
| 468 | 474 |
| 469 // Where did we find the result; | 475 // Where did we find the result; |
| 470 enum { | 476 enum { |
| 471 NOT_FOUND, | 477 NOT_FOUND, |
| 472 DESCRIPTOR_TYPE, | 478 DESCRIPTOR_TYPE, |
| 473 TRANSITION_TYPE, | 479 TRANSITION_TYPE, |
| 474 DICTIONARY_TYPE, | 480 DICTIONARY_TYPE, |
| 475 HANDLER_TYPE, | 481 HANDLER_TYPE, |
| 476 INTERCEPTOR_TYPE | 482 INTERCEPTOR_TYPE |
| 477 } lookup_type_; | 483 } lookup_type_; |
| 478 | 484 |
| 479 JSReceiver* holder_; | 485 JSReceiver* holder_; |
| 480 Map* transition_; | 486 Map* transition_; |
| 481 int number_; | 487 int number_; |
| 482 bool cacheable_; | 488 bool cacheable_; |
| 483 PropertyDetails details_; | 489 PropertyDetails details_; |
| 484 }; | 490 }; |
| 485 | 491 |
| 486 | 492 |
| 487 OStream& operator<<(OStream& os, const LookupResult& r); | 493 OStream& operator<<(OStream& os, const LookupResult& r); |
| 488 } } // namespace v8::internal | 494 } } // namespace v8::internal |
| 489 | 495 |
| 490 #endif // V8_PROPERTY_H_ | 496 #endif // V8_PROPERTY_H_ |
| OLD | NEW |