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 7809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7820 TRACK_ALLOCATION_SITE, | 7820 TRACK_ALLOCATION_SITE, |
7821 LAST_ALLOCATION_SITE_MODE = TRACK_ALLOCATION_SITE | 7821 LAST_ALLOCATION_SITE_MODE = TRACK_ALLOCATION_SITE |
7822 }; | 7822 }; |
7823 | 7823 |
7824 | 7824 |
7825 class AllocationSite: public Struct { | 7825 class AllocationSite: public Struct { |
7826 public: | 7826 public: |
7827 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024; | 7827 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024; |
7828 | 7828 |
7829 DECL_ACCESSORS(transition_info, Object) | 7829 DECL_ACCESSORS(transition_info, Object) |
7830 DECL_ACCESSORS(nested_sites, Object) | |
Hannes Payer (out of office)
2013/09/24 08:04:40
I think we should call it next or nested_sit and s
mvstanton
2013/09/24 08:39:15
Done.
| |
7830 DECL_ACCESSORS(dependent_code, DependentCode) | 7831 DECL_ACCESSORS(dependent_code, DependentCode) |
7831 DECL_ACCESSORS(weak_next, Object) | 7832 DECL_ACCESSORS(weak_next, Object) |
7832 | 7833 |
7833 inline void Initialize(); | 7834 inline void Initialize(); |
7834 | 7835 |
7836 AllocationSite* GetLastNestedSite(); | |
7837 void AppendNestedSite(AllocationSite* nested_site); | |
7838 | |
7835 ElementsKind GetElementsKind() { | 7839 ElementsKind GetElementsKind() { |
7836 ASSERT(!IsLiteralSite()); | 7840 ASSERT(!IsLiteralSite()); |
7837 return static_cast<ElementsKind>(Smi::cast(transition_info())->value()); | 7841 return static_cast<ElementsKind>(Smi::cast(transition_info())->value()); |
7838 } | 7842 } |
7839 | 7843 |
7840 void SetElementsKind(ElementsKind kind) { | 7844 void SetElementsKind(ElementsKind kind) { |
7841 set_transition_info(Smi::FromInt(static_cast<int>(kind))); | 7845 set_transition_info(Smi::FromInt(static_cast<int>(kind))); |
7842 } | 7846 } |
7843 | 7847 |
7844 bool IsLiteralSite() { | 7848 bool IsLiteralSite() { |
7845 // If transition_info is a smi, then it represents an ElementsKind | 7849 // If transition_info is a smi, then it represents an ElementsKind |
7846 // for a constructed array. Otherwise, it must be a boilerplate | 7850 // for a constructed array. Otherwise, it must be a boilerplate |
7847 // for an array literal | 7851 // for an array literal |
7848 return transition_info()->IsJSArray(); | 7852 return transition_info()->IsJSArray(); |
7849 } | 7853 } |
7850 | 7854 |
7851 DECLARE_PRINTER(AllocationSite) | 7855 DECLARE_PRINTER(AllocationSite) |
7852 DECLARE_VERIFIER(AllocationSite) | 7856 DECLARE_VERIFIER(AllocationSite) |
7853 | 7857 |
7854 static inline AllocationSite* cast(Object* obj); | 7858 static inline AllocationSite* cast(Object* obj); |
7855 static inline AllocationSiteMode GetMode( | 7859 static inline AllocationSiteMode GetMode( |
7856 ElementsKind boilerplate_elements_kind); | 7860 ElementsKind boilerplate_elements_kind); |
7857 static inline AllocationSiteMode GetMode(ElementsKind from, ElementsKind to); | 7861 static inline AllocationSiteMode GetMode(ElementsKind from, ElementsKind to); |
7858 static inline bool CanTrack(InstanceType type); | 7862 static inline bool CanTrack(InstanceType type); |
7859 | 7863 |
7860 static const int kTransitionInfoOffset = HeapObject::kHeaderSize; | 7864 static const int kTransitionInfoOffset = HeapObject::kHeaderSize; |
7861 static const int kDependentCodeOffset = kTransitionInfoOffset + kPointerSize; | 7865 static const int kNestedSitesOffset = kTransitionInfoOffset + kPointerSize; |
Hannes Payer (out of office)
2013/09/24 08:04:40
kNextOffset or kNestedSiteOffset
mvstanton
2013/09/24 08:39:15
Done.
| |
7866 static const int kDependentCodeOffset = kNestedSitesOffset + kPointerSize; | |
7862 static const int kWeakNextOffset = kDependentCodeOffset + kPointerSize; | 7867 static const int kWeakNextOffset = kDependentCodeOffset + kPointerSize; |
7863 static const int kSize = kWeakNextOffset + kPointerSize; | 7868 static const int kSize = kWeakNextOffset + kPointerSize; |
7864 | 7869 |
7865 typedef FixedBodyDescriptor<HeapObject::kHeaderSize, | 7870 typedef FixedBodyDescriptor<HeapObject::kHeaderSize, |
7866 kDependentCodeOffset + kPointerSize, | 7871 kDependentCodeOffset + kPointerSize, |
7867 kSize> BodyDescriptor; | 7872 kSize> BodyDescriptor; |
7868 | 7873 |
7869 private: | 7874 private: |
7870 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSite); | 7875 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSite); |
7871 }; | 7876 }; |
(...skipping 2360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10232 } else { | 10237 } else { |
10233 value &= ~(1 << bit_position); | 10238 value &= ~(1 << bit_position); |
10234 } | 10239 } |
10235 return value; | 10240 return value; |
10236 } | 10241 } |
10237 }; | 10242 }; |
10238 | 10243 |
10239 } } // namespace v8::internal | 10244 } } // namespace v8::internal |
10240 | 10245 |
10241 #endif // V8_OBJECTS_H_ | 10246 #endif // V8_OBJECTS_H_ |
OLD | NEW |