 Chromium Code Reviews
 Chromium Code Reviews Issue 11567007:
  Cleanup object printer declaration.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 11567007:
  Cleanup object printer declaration.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| 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 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 749 | 749 | 
| 750 // A template-ized version of the IsXXX functions. | 750 // A template-ized version of the IsXXX functions. | 
| 751 template <class C> static inline bool Is(Object* obj); | 751 template <class C> static inline bool Is(Object* obj); | 
| 752 | 752 | 
| 753 #ifdef VERIFY_HEAP | 753 #ifdef VERIFY_HEAP | 
| 754 #define DECLARE_VERIFIER(Name) void Name##Verify(); | 754 #define DECLARE_VERIFIER(Name) void Name##Verify(); | 
| 755 #else | 755 #else | 
| 756 #define DECLARE_VERIFIER(Name) | 756 #define DECLARE_VERIFIER(Name) | 
| 757 #endif | 757 #endif | 
| 758 | 758 | 
| 759 #ifdef OBJECT_PRINT | |
| 760 #define DECLARE_PRINTER(Name) \ | |
| 761 inline void Name##Print() { Name##Print(stdout); } \ | |
| 
Sven Panne
2012/12/13 10:05:11
Drop this...
 | |
| 762 void Name##Print(FILE* out); | |
| 
Sven Panne
2012/12/13 10:05:11
... and use "FILE* out = stdout" here, it's cleane
 | |
| 763 #else | |
| 764 #define DECLARE_PRINTER(Name) | |
| 765 #endif | |
| 766 | |
| 759 class MaybeObject BASE_EMBEDDED { | 767 class MaybeObject BASE_EMBEDDED { | 
| 760 public: | 768 public: | 
| 761 inline bool IsFailure(); | 769 inline bool IsFailure(); | 
| 762 inline bool IsRetryAfterGC(); | 770 inline bool IsRetryAfterGC(); | 
| 763 inline bool IsOutOfMemory(); | 771 inline bool IsOutOfMemory(); | 
| 764 inline bool IsException(); | 772 inline bool IsException(); | 
| 765 INLINE(bool IsTheHole()); | 773 INLINE(bool IsTheHole()); | 
| 766 inline bool ToObject(Object** obj) { | 774 inline bool ToObject(Object** obj) { | 
| 767 if (IsFailure()) return false; | 775 if (IsFailure()) return false; | 
| 768 *obj = reinterpret_cast<Object*>(this); | 776 *obj = reinterpret_cast<Object*>(this); | 
| (...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2102 // Casting. | 2110 // Casting. | 
| 2103 static inline JSObject* cast(Object* obj); | 2111 static inline JSObject* cast(Object* obj); | 
| 2104 | 2112 | 
| 2105 // Disalow further properties to be added to the object. | 2113 // Disalow further properties to be added to the object. | 
| 2106 static Handle<Object> PreventExtensions(Handle<JSObject> object); | 2114 static Handle<Object> PreventExtensions(Handle<JSObject> object); | 
| 2107 MUST_USE_RESULT MaybeObject* PreventExtensions(); | 2115 MUST_USE_RESULT MaybeObject* PreventExtensions(); | 
| 2108 | 2116 | 
| 2109 | 2117 | 
| 2110 // Dispatched behavior. | 2118 // Dispatched behavior. | 
| 2111 void JSObjectShortPrint(StringStream* accumulator); | 2119 void JSObjectShortPrint(StringStream* accumulator); | 
| 2112 #ifdef OBJECT_PRINT | 2120 DECLARE_PRINTER(JSObject) | 
| 2113 inline void JSObjectPrint() { | |
| 2114 JSObjectPrint(stdout); | |
| 2115 } | |
| 2116 void JSObjectPrint(FILE* out); | |
| 2117 #endif | |
| 2118 DECLARE_VERIFIER(JSObject) | 2121 DECLARE_VERIFIER(JSObject) | 
| 2119 #ifdef OBJECT_PRINT | 2122 #ifdef OBJECT_PRINT | 
| 2120 inline void PrintProperties() { | 2123 inline void PrintProperties() { | 
| 2121 PrintProperties(stdout); | 2124 PrintProperties(stdout); | 
| 2122 } | 2125 } | 
| 2123 void PrintProperties(FILE* out); | 2126 void PrintProperties(FILE* out); | 
| 2124 | 2127 | 
| 2125 inline void PrintElements() { | 2128 inline void PrintElements() { | 
| 2126 PrintElements(stdout); | 2129 PrintElements(stdout); | 
| 2127 } | 2130 } | 
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2401 static inline FixedArray* cast(Object* obj); | 2404 static inline FixedArray* cast(Object* obj); | 
| 2402 | 2405 | 
| 2403 // Maximal allowed size, in bytes, of a single FixedArray. | 2406 // Maximal allowed size, in bytes, of a single FixedArray. | 
| 2404 // Prevents overflowing size computations, as well as extreme memory | 2407 // Prevents overflowing size computations, as well as extreme memory | 
| 2405 // consumption. | 2408 // consumption. | 
| 2406 static const int kMaxSize = 128 * MB * kPointerSize; | 2409 static const int kMaxSize = 128 * MB * kPointerSize; | 
| 2407 // Maximally allowed length of a FixedArray. | 2410 // Maximally allowed length of a FixedArray. | 
| 2408 static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize; | 2411 static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize; | 
| 2409 | 2412 | 
| 2410 // Dispatched behavior. | 2413 // Dispatched behavior. | 
| 2411 #ifdef OBJECT_PRINT | 2414 DECLARE_PRINTER(FixedArray) | 
| 2412 inline void FixedArrayPrint() { | |
| 2413 FixedArrayPrint(stdout); | |
| 2414 } | |
| 2415 void FixedArrayPrint(FILE* out); | |
| 2416 #endif | |
| 2417 DECLARE_VERIFIER(FixedArray) | 2415 DECLARE_VERIFIER(FixedArray) | 
| 2418 #ifdef DEBUG | 2416 #ifdef DEBUG | 
| 2419 // Checks if two FixedArrays have identical contents. | 2417 // Checks if two FixedArrays have identical contents. | 
| 2420 bool IsEqualTo(FixedArray* other); | 2418 bool IsEqualTo(FixedArray* other); | 
| 2421 #endif | 2419 #endif | 
| 2422 | 2420 | 
| 2423 // Swap two elements in a pair of arrays. If this array and the | 2421 // Swap two elements in a pair of arrays. If this array and the | 
| 2424 // numbers array are the same object, the elements are only swapped | 2422 // numbers array are the same object, the elements are only swapped | 
| 2425 // once. | 2423 // once. | 
| 2426 void SwapPairs(FixedArray* numbers, int i, int j); | 2424 void SwapPairs(FixedArray* numbers, int i, int j); | 
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2493 static inline FixedDoubleArray* cast(Object* obj); | 2491 static inline FixedDoubleArray* cast(Object* obj); | 
| 2494 | 2492 | 
| 2495 // Maximal allowed size, in bytes, of a single FixedDoubleArray. | 2493 // Maximal allowed size, in bytes, of a single FixedDoubleArray. | 
| 2496 // Prevents overflowing size computations, as well as extreme memory | 2494 // Prevents overflowing size computations, as well as extreme memory | 
| 2497 // consumption. | 2495 // consumption. | 
| 2498 static const int kMaxSize = 512 * MB; | 2496 static const int kMaxSize = 512 * MB; | 
| 2499 // Maximally allowed length of a FixedArray. | 2497 // Maximally allowed length of a FixedArray. | 
| 2500 static const int kMaxLength = (kMaxSize - kHeaderSize) / kDoubleSize; | 2498 static const int kMaxLength = (kMaxSize - kHeaderSize) / kDoubleSize; | 
| 2501 | 2499 | 
| 2502 // Dispatched behavior. | 2500 // Dispatched behavior. | 
| 2503 #ifdef OBJECT_PRINT | 2501 DECLARE_PRINTER(FixedDoubleArray) | 
| 2504 inline void FixedDoubleArrayPrint() { | |
| 2505 FixedDoubleArrayPrint(stdout); | |
| 2506 } | |
| 2507 void FixedDoubleArrayPrint(FILE* out); | |
| 2508 #endif | |
| 2509 DECLARE_VERIFIER(FixedDoubleArray) | 2502 DECLARE_VERIFIER(FixedDoubleArray) | 
| 2510 | 2503 | 
| 2511 private: | 2504 private: | 
| 2512 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedDoubleArray); | 2505 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedDoubleArray); | 
| 2513 }; | 2506 }; | 
| 2514 | 2507 | 
| 2515 | 2508 | 
| 2516 // DescriptorArrays are fixed arrays used to hold instance descriptors. | 2509 // DescriptorArrays are fixed arrays used to hold instance descriptors. | 
| 2517 // The format of the these objects is: | 2510 // The format of the these objects is: | 
| 2518 // [0]: Number of descriptors | 2511 // [0]: Number of descriptors | 
| (...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3698 // Returns a pointer to the ByteArray object for a given data start address. | 3691 // Returns a pointer to the ByteArray object for a given data start address. | 
| 3699 static inline ByteArray* FromDataStartAddress(Address address); | 3692 static inline ByteArray* FromDataStartAddress(Address address); | 
| 3700 | 3693 | 
| 3701 // Casting. | 3694 // Casting. | 
| 3702 static inline ByteArray* cast(Object* obj); | 3695 static inline ByteArray* cast(Object* obj); | 
| 3703 | 3696 | 
| 3704 // Dispatched behavior. | 3697 // Dispatched behavior. | 
| 3705 inline int ByteArraySize() { | 3698 inline int ByteArraySize() { | 
| 3706 return SizeFor(this->length()); | 3699 return SizeFor(this->length()); | 
| 3707 } | 3700 } | 
| 3708 #ifdef OBJECT_PRINT | 3701 DECLARE_PRINTER(ByteArray) | 
| 3709 inline void ByteArrayPrint() { | |
| 3710 ByteArrayPrint(stdout); | |
| 3711 } | |
| 3712 void ByteArrayPrint(FILE* out); | |
| 3713 #endif | |
| 3714 DECLARE_VERIFIER(ByteArray) | 3702 DECLARE_VERIFIER(ByteArray) | 
| 3715 | 3703 | 
| 3716 // Layout description. | 3704 // Layout description. | 
| 3717 static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize); | 3705 static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize); | 
| 3718 | 3706 | 
| 3719 // Maximal memory consumption for a single ByteArray. | 3707 // Maximal memory consumption for a single ByteArray. | 
| 3720 static const int kMaxSize = 512 * MB; | 3708 static const int kMaxSize = 512 * MB; | 
| 3721 // Maximal length of a single ByteArray. | 3709 // Maximal length of a single ByteArray. | 
| 3722 static const int kMaxLength = kMaxSize - kHeaderSize; | 3710 static const int kMaxLength = kMaxSize - kHeaderSize; | 
| 3723 | 3711 | 
| 3724 private: | 3712 private: | 
| 3725 DISALLOW_IMPLICIT_CONSTRUCTORS(ByteArray); | 3713 DISALLOW_IMPLICIT_CONSTRUCTORS(ByteArray); | 
| 3726 }; | 3714 }; | 
| 3727 | 3715 | 
| 3728 | 3716 | 
| 3729 // FreeSpace represents fixed sized areas of the heap that are not currently in | 3717 // FreeSpace represents fixed sized areas of the heap that are not currently in | 
| 3730 // use. Used by the heap and GC. | 3718 // use. Used by the heap and GC. | 
| 3731 class FreeSpace: public HeapObject { | 3719 class FreeSpace: public HeapObject { | 
| 3732 public: | 3720 public: | 
| 3733 // [size]: size of the free space including the header. | 3721 // [size]: size of the free space including the header. | 
| 3734 inline int size(); | 3722 inline int size(); | 
| 3735 inline void set_size(int value); | 3723 inline void set_size(int value); | 
| 3736 | 3724 | 
| 3737 inline int Size() { return size(); } | 3725 inline int Size() { return size(); } | 
| 3738 | 3726 | 
| 3739 // Casting. | 3727 // Casting. | 
| 3740 static inline FreeSpace* cast(Object* obj); | 3728 static inline FreeSpace* cast(Object* obj); | 
| 3741 | 3729 | 
| 3742 #ifdef OBJECT_PRINT | 3730 // Dispatched behavior. | 
| 3743 inline void FreeSpacePrint() { | 3731 DECLARE_PRINTER(FreeSpace) | 
| 3744 FreeSpacePrint(stdout); | |
| 3745 } | |
| 3746 void FreeSpacePrint(FILE* out); | |
| 3747 #endif | |
| 3748 DECLARE_VERIFIER(FreeSpace) | 3732 DECLARE_VERIFIER(FreeSpace) | 
| 3749 | 3733 | 
| 3750 // Layout description. | 3734 // Layout description. | 
| 3751 // Size is smi tagged when it is stored. | 3735 // Size is smi tagged when it is stored. | 
| 3752 static const int kSizeOffset = HeapObject::kHeaderSize; | 3736 static const int kSizeOffset = HeapObject::kHeaderSize; | 
| 3753 static const int kHeaderSize = kSizeOffset + kPointerSize; | 3737 static const int kHeaderSize = kSizeOffset + kPointerSize; | 
| 3754 | 3738 | 
| 3755 static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize); | 3739 static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize); | 
| 3756 | 3740 | 
| 3757 private: | 3741 private: | 
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3812 MUST_USE_RESULT inline MaybeObject* get(int index); | 3796 MUST_USE_RESULT inline MaybeObject* get(int index); | 
| 3813 inline void set(int index, uint8_t value); | 3797 inline void set(int index, uint8_t value); | 
| 3814 | 3798 | 
| 3815 // This accessor applies the correct conversion from Smi, HeapNumber and | 3799 // This accessor applies the correct conversion from Smi, HeapNumber and | 
| 3816 // undefined and clamps the converted value between 0 and 255. | 3800 // undefined and clamps the converted value between 0 and 255. | 
| 3817 Object* SetValue(uint32_t index, Object* value); | 3801 Object* SetValue(uint32_t index, Object* value); | 
| 3818 | 3802 | 
| 3819 // Casting. | 3803 // Casting. | 
| 3820 static inline ExternalPixelArray* cast(Object* obj); | 3804 static inline ExternalPixelArray* cast(Object* obj); | 
| 3821 | 3805 | 
| 3822 #ifdef OBJECT_PRINT | 3806 // Dispatched behavior. | 
| 3823 inline void ExternalPixelArrayPrint() { | 3807 DECLARE_PRINTER(ExternalPixelArray) | 
| 3824 ExternalPixelArrayPrint(stdout); | |
| 3825 } | |
| 3826 void ExternalPixelArrayPrint(FILE* out); | |
| 3827 #endif | |
| 3828 DECLARE_VERIFIER(ExternalPixelArray) | 3808 DECLARE_VERIFIER(ExternalPixelArray) | 
| 3829 | 3809 | 
| 3830 private: | 3810 private: | 
| 3831 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalPixelArray); | 3811 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalPixelArray); | 
| 3832 }; | 3812 }; | 
| 3833 | 3813 | 
| 3834 | 3814 | 
| 3835 class ExternalByteArray: public ExternalArray { | 3815 class ExternalByteArray: public ExternalArray { | 
| 3836 public: | 3816 public: | 
| 3837 // Setter and getter. | 3817 // Setter and getter. | 
| 3838 inline int8_t get_scalar(int index); | 3818 inline int8_t get_scalar(int index); | 
| 3839 MUST_USE_RESULT inline MaybeObject* get(int index); | 3819 MUST_USE_RESULT inline MaybeObject* get(int index); | 
| 3840 inline void set(int index, int8_t value); | 3820 inline void set(int index, int8_t value); | 
| 3841 | 3821 | 
| 3842 // This accessor applies the correct conversion from Smi, HeapNumber | 3822 // This accessor applies the correct conversion from Smi, HeapNumber | 
| 3843 // and undefined. | 3823 // and undefined. | 
| 3844 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3824 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 
| 3845 | 3825 | 
| 3846 // Casting. | 3826 // Casting. | 
| 3847 static inline ExternalByteArray* cast(Object* obj); | 3827 static inline ExternalByteArray* cast(Object* obj); | 
| 3848 | 3828 | 
| 3849 #ifdef OBJECT_PRINT | 3829 // Dispatched behavior. | 
| 3850 inline void ExternalByteArrayPrint() { | 3830 DECLARE_PRINTER(ExternalByteArray) | 
| 3851 ExternalByteArrayPrint(stdout); | |
| 3852 } | |
| 3853 void ExternalByteArrayPrint(FILE* out); | |
| 3854 #endif | |
| 3855 DECLARE_VERIFIER(ExternalByteArray) | 3831 DECLARE_VERIFIER(ExternalByteArray) | 
| 3856 | 3832 | 
| 3857 private: | 3833 private: | 
| 3858 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalByteArray); | 3834 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalByteArray); | 
| 3859 }; | 3835 }; | 
| 3860 | 3836 | 
| 3861 | 3837 | 
| 3862 class ExternalUnsignedByteArray: public ExternalArray { | 3838 class ExternalUnsignedByteArray: public ExternalArray { | 
| 3863 public: | 3839 public: | 
| 3864 // Setter and getter. | 3840 // Setter and getter. | 
| 3865 inline uint8_t get_scalar(int index); | 3841 inline uint8_t get_scalar(int index); | 
| 3866 MUST_USE_RESULT inline MaybeObject* get(int index); | 3842 MUST_USE_RESULT inline MaybeObject* get(int index); | 
| 3867 inline void set(int index, uint8_t value); | 3843 inline void set(int index, uint8_t value); | 
| 3868 | 3844 | 
| 3869 // This accessor applies the correct conversion from Smi, HeapNumber | 3845 // This accessor applies the correct conversion from Smi, HeapNumber | 
| 3870 // and undefined. | 3846 // and undefined. | 
| 3871 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3847 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 
| 3872 | 3848 | 
| 3873 // Casting. | 3849 // Casting. | 
| 3874 static inline ExternalUnsignedByteArray* cast(Object* obj); | 3850 static inline ExternalUnsignedByteArray* cast(Object* obj); | 
| 3875 | 3851 | 
| 3876 #ifdef OBJECT_PRINT | 3852 // Dispatched behavior. | 
| 3877 inline void ExternalUnsignedByteArrayPrint() { | 3853 DECLARE_PRINTER(ExternalUnsignedByteArray) | 
| 3878 ExternalUnsignedByteArrayPrint(stdout); | |
| 3879 } | |
| 3880 void ExternalUnsignedByteArrayPrint(FILE* out); | |
| 3881 #endif | |
| 3882 DECLARE_VERIFIER(ExternalUnsignedByteArray) | 3854 DECLARE_VERIFIER(ExternalUnsignedByteArray) | 
| 3883 | 3855 | 
| 3884 private: | 3856 private: | 
| 3885 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedByteArray); | 3857 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedByteArray); | 
| 3886 }; | 3858 }; | 
| 3887 | 3859 | 
| 3888 | 3860 | 
| 3889 class ExternalShortArray: public ExternalArray { | 3861 class ExternalShortArray: public ExternalArray { | 
| 3890 public: | 3862 public: | 
| 3891 // Setter and getter. | 3863 // Setter and getter. | 
| 3892 inline int16_t get_scalar(int index); | 3864 inline int16_t get_scalar(int index); | 
| 3893 MUST_USE_RESULT inline MaybeObject* get(int index); | 3865 MUST_USE_RESULT inline MaybeObject* get(int index); | 
| 3894 inline void set(int index, int16_t value); | 3866 inline void set(int index, int16_t value); | 
| 3895 | 3867 | 
| 3896 // This accessor applies the correct conversion from Smi, HeapNumber | 3868 // This accessor applies the correct conversion from Smi, HeapNumber | 
| 3897 // and undefined. | 3869 // and undefined. | 
| 3898 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3870 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 
| 3899 | 3871 | 
| 3900 // Casting. | 3872 // Casting. | 
| 3901 static inline ExternalShortArray* cast(Object* obj); | 3873 static inline ExternalShortArray* cast(Object* obj); | 
| 3902 | 3874 | 
| 3903 #ifdef OBJECT_PRINT | 3875 // Dispatched behavior. | 
| 3904 inline void ExternalShortArrayPrint() { | 3876 DECLARE_PRINTER(ExternalShortArray) | 
| 3905 ExternalShortArrayPrint(stdout); | |
| 3906 } | |
| 3907 void ExternalShortArrayPrint(FILE* out); | |
| 3908 #endif | |
| 3909 DECLARE_VERIFIER(ExternalShortArray) | 3877 DECLARE_VERIFIER(ExternalShortArray) | 
| 3910 | 3878 | 
| 3911 private: | 3879 private: | 
| 3912 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalShortArray); | 3880 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalShortArray); | 
| 3913 }; | 3881 }; | 
| 3914 | 3882 | 
| 3915 | 3883 | 
| 3916 class ExternalUnsignedShortArray: public ExternalArray { | 3884 class ExternalUnsignedShortArray: public ExternalArray { | 
| 3917 public: | 3885 public: | 
| 3918 // Setter and getter. | 3886 // Setter and getter. | 
| 3919 inline uint16_t get_scalar(int index); | 3887 inline uint16_t get_scalar(int index); | 
| 3920 MUST_USE_RESULT inline MaybeObject* get(int index); | 3888 MUST_USE_RESULT inline MaybeObject* get(int index); | 
| 3921 inline void set(int index, uint16_t value); | 3889 inline void set(int index, uint16_t value); | 
| 3922 | 3890 | 
| 3923 // This accessor applies the correct conversion from Smi, HeapNumber | 3891 // This accessor applies the correct conversion from Smi, HeapNumber | 
| 3924 // and undefined. | 3892 // and undefined. | 
| 3925 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3893 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 
| 3926 | 3894 | 
| 3927 // Casting. | 3895 // Casting. | 
| 3928 static inline ExternalUnsignedShortArray* cast(Object* obj); | 3896 static inline ExternalUnsignedShortArray* cast(Object* obj); | 
| 3929 | 3897 | 
| 3930 #ifdef OBJECT_PRINT | 3898 // Dispatched behavior. | 
| 3931 inline void ExternalUnsignedShortArrayPrint() { | 3899 DECLARE_PRINTER(ExternalUnsignedShortArray) | 
| 3932 ExternalUnsignedShortArrayPrint(stdout); | |
| 3933 } | |
| 3934 void ExternalUnsignedShortArrayPrint(FILE* out); | |
| 3935 #endif | |
| 3936 DECLARE_VERIFIER(ExternalUnsignedShortArray) | 3900 DECLARE_VERIFIER(ExternalUnsignedShortArray) | 
| 3937 | 3901 | 
| 3938 private: | 3902 private: | 
| 3939 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedShortArray); | 3903 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedShortArray); | 
| 3940 }; | 3904 }; | 
| 3941 | 3905 | 
| 3942 | 3906 | 
| 3943 class ExternalIntArray: public ExternalArray { | 3907 class ExternalIntArray: public ExternalArray { | 
| 3944 public: | 3908 public: | 
| 3945 // Setter and getter. | 3909 // Setter and getter. | 
| 3946 inline int32_t get_scalar(int index); | 3910 inline int32_t get_scalar(int index); | 
| 3947 MUST_USE_RESULT inline MaybeObject* get(int index); | 3911 MUST_USE_RESULT inline MaybeObject* get(int index); | 
| 3948 inline void set(int index, int32_t value); | 3912 inline void set(int index, int32_t value); | 
| 3949 | 3913 | 
| 3950 // This accessor applies the correct conversion from Smi, HeapNumber | 3914 // This accessor applies the correct conversion from Smi, HeapNumber | 
| 3951 // and undefined. | 3915 // and undefined. | 
| 3952 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3916 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 
| 3953 | 3917 | 
| 3954 // Casting. | 3918 // Casting. | 
| 3955 static inline ExternalIntArray* cast(Object* obj); | 3919 static inline ExternalIntArray* cast(Object* obj); | 
| 3956 | 3920 | 
| 3957 #ifdef OBJECT_PRINT | 3921 // Dispatched behavior. | 
| 3958 inline void ExternalIntArrayPrint() { | 3922 DECLARE_PRINTER(ExternalIntArray) | 
| 3959 ExternalIntArrayPrint(stdout); | |
| 3960 } | |
| 3961 void ExternalIntArrayPrint(FILE* out); | |
| 3962 #endif | |
| 3963 DECLARE_VERIFIER(ExternalIntArray) | 3923 DECLARE_VERIFIER(ExternalIntArray) | 
| 3964 | 3924 | 
| 3965 private: | 3925 private: | 
| 3966 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalIntArray); | 3926 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalIntArray); | 
| 3967 }; | 3927 }; | 
| 3968 | 3928 | 
| 3969 | 3929 | 
| 3970 class ExternalUnsignedIntArray: public ExternalArray { | 3930 class ExternalUnsignedIntArray: public ExternalArray { | 
| 3971 public: | 3931 public: | 
| 3972 // Setter and getter. | 3932 // Setter and getter. | 
| 3973 inline uint32_t get_scalar(int index); | 3933 inline uint32_t get_scalar(int index); | 
| 3974 MUST_USE_RESULT inline MaybeObject* get(int index); | 3934 MUST_USE_RESULT inline MaybeObject* get(int index); | 
| 3975 inline void set(int index, uint32_t value); | 3935 inline void set(int index, uint32_t value); | 
| 3976 | 3936 | 
| 3977 // This accessor applies the correct conversion from Smi, HeapNumber | 3937 // This accessor applies the correct conversion from Smi, HeapNumber | 
| 3978 // and undefined. | 3938 // and undefined. | 
| 3979 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3939 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 
| 3980 | 3940 | 
| 3981 // Casting. | 3941 // Casting. | 
| 3982 static inline ExternalUnsignedIntArray* cast(Object* obj); | 3942 static inline ExternalUnsignedIntArray* cast(Object* obj); | 
| 3983 | 3943 | 
| 3984 #ifdef OBJECT_PRINT | 3944 // Dispatched behavior. | 
| 3985 inline void ExternalUnsignedIntArrayPrint() { | 3945 DECLARE_PRINTER(ExternalUnsignedIntArray) | 
| 3986 ExternalUnsignedIntArrayPrint(stdout); | |
| 3987 } | |
| 3988 void ExternalUnsignedIntArrayPrint(FILE* out); | |
| 3989 #endif | |
| 3990 DECLARE_VERIFIER(ExternalUnsignedIntArray) | 3946 DECLARE_VERIFIER(ExternalUnsignedIntArray) | 
| 3991 | 3947 | 
| 3992 private: | 3948 private: | 
| 3993 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedIntArray); | 3949 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedIntArray); | 
| 3994 }; | 3950 }; | 
| 3995 | 3951 | 
| 3996 | 3952 | 
| 3997 class ExternalFloatArray: public ExternalArray { | 3953 class ExternalFloatArray: public ExternalArray { | 
| 3998 public: | 3954 public: | 
| 3999 // Setter and getter. | 3955 // Setter and getter. | 
| 4000 inline float get_scalar(int index); | 3956 inline float get_scalar(int index); | 
| 4001 MUST_USE_RESULT inline MaybeObject* get(int index); | 3957 MUST_USE_RESULT inline MaybeObject* get(int index); | 
| 4002 inline void set(int index, float value); | 3958 inline void set(int index, float value); | 
| 4003 | 3959 | 
| 4004 // This accessor applies the correct conversion from Smi, HeapNumber | 3960 // This accessor applies the correct conversion from Smi, HeapNumber | 
| 4005 // and undefined. | 3961 // and undefined. | 
| 4006 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3962 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 
| 4007 | 3963 | 
| 4008 // Casting. | 3964 // Casting. | 
| 4009 static inline ExternalFloatArray* cast(Object* obj); | 3965 static inline ExternalFloatArray* cast(Object* obj); | 
| 4010 | 3966 | 
| 4011 #ifdef OBJECT_PRINT | 3967 // Dispatched behavior. | 
| 4012 inline void ExternalFloatArrayPrint() { | 3968 DECLARE_PRINTER(ExternalFloatArray) | 
| 4013 ExternalFloatArrayPrint(stdout); | |
| 4014 } | |
| 4015 void ExternalFloatArrayPrint(FILE* out); | |
| 4016 #endif | |
| 4017 DECLARE_VERIFIER(ExternalFloatArray) | 3969 DECLARE_VERIFIER(ExternalFloatArray) | 
| 4018 | 3970 | 
| 4019 private: | 3971 private: | 
| 4020 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloatArray); | 3972 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloatArray); | 
| 4021 }; | 3973 }; | 
| 4022 | 3974 | 
| 4023 | 3975 | 
| 4024 class ExternalDoubleArray: public ExternalArray { | 3976 class ExternalDoubleArray: public ExternalArray { | 
| 4025 public: | 3977 public: | 
| 4026 // Setter and getter. | 3978 // Setter and getter. | 
| 4027 inline double get_scalar(int index); | 3979 inline double get_scalar(int index); | 
| 4028 MUST_USE_RESULT inline MaybeObject* get(int index); | 3980 MUST_USE_RESULT inline MaybeObject* get(int index); | 
| 4029 inline void set(int index, double value); | 3981 inline void set(int index, double value); | 
| 4030 | 3982 | 
| 4031 // This accessor applies the correct conversion from Smi, HeapNumber | 3983 // This accessor applies the correct conversion from Smi, HeapNumber | 
| 4032 // and undefined. | 3984 // and undefined. | 
| 4033 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 3985 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 
| 4034 | 3986 | 
| 4035 // Casting. | 3987 // Casting. | 
| 4036 static inline ExternalDoubleArray* cast(Object* obj); | 3988 static inline ExternalDoubleArray* cast(Object* obj); | 
| 4037 | 3989 | 
| 4038 #ifdef OBJECT_PRINT | 3990 // Dispatched behavior. | 
| 4039 inline void ExternalDoubleArrayPrint() { | 3991 DECLARE_PRINTER(ExternalDoubleArray) | 
| 4040 ExternalDoubleArrayPrint(stdout); | |
| 4041 } | |
| 4042 void ExternalDoubleArrayPrint(FILE* out); | |
| 4043 #endif // OBJECT_PRINT | |
| 4044 DECLARE_VERIFIER(ExternalDoubleArray) | 3992 DECLARE_VERIFIER(ExternalDoubleArray) | 
| 4045 | 3993 | 
| 4046 private: | 3994 private: | 
| 4047 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalDoubleArray); | 3995 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalDoubleArray); | 
| 4048 }; | 3996 }; | 
| 4049 | 3997 | 
| 4050 | 3998 | 
| 4051 // DeoptimizationInputData is a fixed array used to hold the deoptimization | 3999 // DeoptimizationInputData is a fixed array used to hold the deoptimization | 
| 4052 // data for code generated by the Hydrogen/Lithium compiler. It also | 4000 // data for code generated by the Hydrogen/Lithium compiler. It also | 
| 4053 // contains information about functions that were inlined. If N different | 4001 // contains information about functions that were inlined. If N different | 
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4545 | 4493 | 
| 4546 // Casting. | 4494 // Casting. | 
| 4547 static inline Code* cast(Object* obj); | 4495 static inline Code* cast(Object* obj); | 
| 4548 | 4496 | 
| 4549 // Dispatched behavior. | 4497 // Dispatched behavior. | 
| 4550 int CodeSize() { return SizeFor(body_size()); } | 4498 int CodeSize() { return SizeFor(body_size()); } | 
| 4551 inline void CodeIterateBody(ObjectVisitor* v); | 4499 inline void CodeIterateBody(ObjectVisitor* v); | 
| 4552 | 4500 | 
| 4553 template<typename StaticVisitor> | 4501 template<typename StaticVisitor> | 
| 4554 inline void CodeIterateBody(Heap* heap); | 4502 inline void CodeIterateBody(Heap* heap); | 
| 4555 #ifdef OBJECT_PRINT | 4503 | 
| 4556 inline void CodePrint() { | 4504 DECLARE_PRINTER(Code) | 
| 4557 CodePrint(stdout); | |
| 4558 } | |
| 4559 void CodePrint(FILE* out); | |
| 4560 #endif | |
| 4561 DECLARE_VERIFIER(Code) | 4505 DECLARE_VERIFIER(Code) | 
| 4562 | 4506 | 
| 4563 void ClearInlineCaches(); | 4507 void ClearInlineCaches(); | 
| 4564 void ClearTypeFeedbackCells(Heap* heap); | 4508 void ClearTypeFeedbackCells(Heap* heap); | 
| 4565 | 4509 | 
| 4566 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, | 4510 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, | 
| 4567 enum Age { | 4511 enum Age { | 
| 4568 kNoAge = 0, | 4512 kNoAge = 0, | 
| 4569 CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) | 4513 CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) | 
| 4570 kAfterLastCodeAge, | 4514 kAfterLastCodeAge, | 
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5126 // Zaps the contents of backing data structures. Note that the | 5070 // Zaps the contents of backing data structures. Note that the | 
| 5127 // heap verifier (i.e. VerifyMarkingVisitor) relies on zapping of objects | 5071 // heap verifier (i.e. VerifyMarkingVisitor) relies on zapping of objects | 
| 5128 // holding weak references when incremental marking is used, because it also | 5072 // holding weak references when incremental marking is used, because it also | 
| 5129 // iterates over objects that are otherwise unreachable. | 5073 // iterates over objects that are otherwise unreachable. | 
| 5130 // In general we only want to call these functions in release mode when | 5074 // In general we only want to call these functions in release mode when | 
| 5131 // heap verification is turned on. | 5075 // heap verification is turned on. | 
| 5132 void ZapPrototypeTransitions(); | 5076 void ZapPrototypeTransitions(); | 
| 5133 void ZapTransitions(); | 5077 void ZapTransitions(); | 
| 5134 | 5078 | 
| 5135 // Dispatched behavior. | 5079 // Dispatched behavior. | 
| 5136 #ifdef OBJECT_PRINT | 5080 DECLARE_PRINTER(Map) | 
| 5137 inline void MapPrint() { | |
| 5138 MapPrint(stdout); | |
| 5139 } | |
| 5140 void MapPrint(FILE* out); | |
| 5141 #endif | |
| 5142 DECLARE_VERIFIER(Map) | 5081 DECLARE_VERIFIER(Map) | 
| 5143 | 5082 | 
| 5144 #ifdef VERIFY_HEAP | 5083 #ifdef VERIFY_HEAP | 
| 5145 void SharedMapVerify(); | 5084 void SharedMapVerify(); | 
| 5146 #endif | 5085 #endif | 
| 5147 | 5086 | 
| 5148 inline int visitor_id(); | 5087 inline int visitor_id(); | 
| 5149 inline void set_visitor_id(int visitor_id); | 5088 inline void set_visitor_id(int visitor_id); | 
| 5150 | 5089 | 
| 5151 typedef void (*TraverseCallback)(Map* map, void* data); | 5090 typedef void (*TraverseCallback)(Map* map, void* data); | 
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5332 // [eval_from_instructions_offset]: the instruction offset in the code for the | 5271 // [eval_from_instructions_offset]: the instruction offset in the code for the | 
| 5333 // function from which eval was called where eval was called. | 5272 // function from which eval was called where eval was called. | 
| 5334 DECL_ACCESSORS(eval_from_instructions_offset, Smi) | 5273 DECL_ACCESSORS(eval_from_instructions_offset, Smi) | 
| 5335 | 5274 | 
| 5336 static inline Script* cast(Object* obj); | 5275 static inline Script* cast(Object* obj); | 
| 5337 | 5276 | 
| 5338 // If script source is an external string, check that the underlying | 5277 // If script source is an external string, check that the underlying | 
| 5339 // resource is accessible. Otherwise, always return true. | 5278 // resource is accessible. Otherwise, always return true. | 
| 5340 inline bool HasValidSource(); | 5279 inline bool HasValidSource(); | 
| 5341 | 5280 | 
| 5342 #ifdef OBJECT_PRINT | 5281 // Dispatched behavior. | 
| 5343 inline void ScriptPrint() { | 5282 DECLARE_PRINTER(Script) | 
| 5344 ScriptPrint(stdout); | |
| 5345 } | |
| 5346 void ScriptPrint(FILE* out); | |
| 5347 #endif | |
| 5348 DECLARE_VERIFIER(Script) | 5283 DECLARE_VERIFIER(Script) | 
| 5349 | 5284 | 
| 5350 static const int kSourceOffset = HeapObject::kHeaderSize; | 5285 static const int kSourceOffset = HeapObject::kHeaderSize; | 
| 5351 static const int kNameOffset = kSourceOffset + kPointerSize; | 5286 static const int kNameOffset = kSourceOffset + kPointerSize; | 
| 5352 static const int kLineOffsetOffset = kNameOffset + kPointerSize; | 5287 static const int kLineOffsetOffset = kNameOffset + kPointerSize; | 
| 5353 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; | 5288 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; | 
| 5354 static const int kDataOffset = kColumnOffsetOffset + kPointerSize; | 5289 static const int kDataOffset = kColumnOffsetOffset + kPointerSize; | 
| 5355 static const int kContextOffset = kDataOffset + kPointerSize; | 5290 static const int kContextOffset = kDataOffset + kPointerSize; | 
| 5356 static const int kWrapperOffset = kContextOffset + kPointerSize; | 5291 static const int kWrapperOffset = kContextOffset + kPointerSize; | 
| 5357 static const int kTypeOffset = kWrapperOffset + kPointerSize; | 5292 static const int kTypeOffset = kWrapperOffset + kPointerSize; | 
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5812 | 5747 | 
| 5813 // Calculate the instance size. | 5748 // Calculate the instance size. | 
| 5814 int CalculateInstanceSize(); | 5749 int CalculateInstanceSize(); | 
| 5815 | 5750 | 
| 5816 // Calculate the number of in-object properties. | 5751 // Calculate the number of in-object properties. | 
| 5817 int CalculateInObjectProperties(); | 5752 int CalculateInObjectProperties(); | 
| 5818 | 5753 | 
| 5819 // Dispatched behavior. | 5754 // Dispatched behavior. | 
| 5820 // Set max_length to -1 for unlimited length. | 5755 // Set max_length to -1 for unlimited length. | 
| 5821 void SourceCodePrint(StringStream* accumulator, int max_length); | 5756 void SourceCodePrint(StringStream* accumulator, int max_length); | 
| 5822 #ifdef OBJECT_PRINT | 5757 DECLARE_PRINTER(SharedFunctionInfo) | 
| 5823 inline void SharedFunctionInfoPrint() { | |
| 5824 SharedFunctionInfoPrint(stdout); | |
| 5825 } | |
| 5826 void SharedFunctionInfoPrint(FILE* out); | |
| 5827 #endif | |
| 5828 DECLARE_VERIFIER(SharedFunctionInfo) | 5758 DECLARE_VERIFIER(SharedFunctionInfo) | 
| 5829 | 5759 | 
| 5830 void ResetForNewContext(int new_ic_age); | 5760 void ResetForNewContext(int new_ic_age); | 
| 5831 | 5761 | 
| 5832 // Helper to compile the shared code. Returns true on success, false on | 5762 // Helper to compile the shared code. Returns true on success, false on | 
| 5833 // failure (e.g., stack overflow during compilation). This is only used by | 5763 // failure (e.g., stack overflow during compilation). This is only used by | 
| 5834 // the debugger, it is not possible to compile without a context otherwise. | 5764 // the debugger, it is not possible to compile without a context otherwise. | 
| 5835 static bool CompileLazy(Handle<SharedFunctionInfo> shared, | 5765 static bool CompileLazy(Handle<SharedFunctionInfo> shared, | 
| 5836 ClearExceptionFlag flag); | 5766 ClearExceptionFlag flag); | 
| 5837 | 5767 | 
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6046 // [context]: the context holding the module's locals, or undefined if none. | 5976 // [context]: the context holding the module's locals, or undefined if none. | 
| 6047 DECL_ACCESSORS(context, Object) | 5977 DECL_ACCESSORS(context, Object) | 
| 6048 | 5978 | 
| 6049 // [scope_info]: Scope info. | 5979 // [scope_info]: Scope info. | 
| 6050 DECL_ACCESSORS(scope_info, ScopeInfo) | 5980 DECL_ACCESSORS(scope_info, ScopeInfo) | 
| 6051 | 5981 | 
| 6052 // Casting. | 5982 // Casting. | 
| 6053 static inline JSModule* cast(Object* obj); | 5983 static inline JSModule* cast(Object* obj); | 
| 6054 | 5984 | 
| 6055 // Dispatched behavior. | 5985 // Dispatched behavior. | 
| 6056 #ifdef OBJECT_PRINT | 5986 DECLARE_PRINTER(JSModule) | 
| 6057 inline void JSModulePrint() { | |
| 6058 JSModulePrint(stdout); | |
| 6059 } | |
| 6060 void JSModulePrint(FILE* out); | |
| 6061 #endif | |
| 6062 DECLARE_VERIFIER(JSModule) | 5987 DECLARE_VERIFIER(JSModule) | 
| 6063 | 5988 | 
| 6064 // Layout description. | 5989 // Layout description. | 
| 6065 static const int kContextOffset = JSObject::kHeaderSize; | 5990 static const int kContextOffset = JSObject::kHeaderSize; | 
| 6066 static const int kScopeInfoOffset = kContextOffset + kPointerSize; | 5991 static const int kScopeInfoOffset = kContextOffset + kPointerSize; | 
| 6067 static const int kSize = kScopeInfoOffset + kPointerSize; | 5992 static const int kSize = kScopeInfoOffset + kPointerSize; | 
| 6068 | 5993 | 
| 6069 private: | 5994 private: | 
| 6070 DISALLOW_IMPLICIT_CONSTRUCTORS(JSModule); | 5995 DISALLOW_IMPLICIT_CONSTRUCTORS(JSModule); | 
| 6071 }; | 5996 }; | 
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6205 void PrintName(FILE* out); | 6130 void PrintName(FILE* out); | 
| 6206 | 6131 | 
| 6207 // Casting. | 6132 // Casting. | 
| 6208 static inline JSFunction* cast(Object* obj); | 6133 static inline JSFunction* cast(Object* obj); | 
| 6209 | 6134 | 
| 6210 // Iterates the objects, including code objects indirectly referenced | 6135 // Iterates the objects, including code objects indirectly referenced | 
| 6211 // through pointers to the first instruction in the code object. | 6136 // through pointers to the first instruction in the code object. | 
| 6212 void JSFunctionIterateBody(int object_size, ObjectVisitor* v); | 6137 void JSFunctionIterateBody(int object_size, ObjectVisitor* v); | 
| 6213 | 6138 | 
| 6214 // Dispatched behavior. | 6139 // Dispatched behavior. | 
| 6215 #ifdef OBJECT_PRINT | 6140 DECLARE_PRINTER(JSFunction) | 
| 6216 inline void JSFunctionPrint() { | |
| 6217 JSFunctionPrint(stdout); | |
| 6218 } | |
| 6219 void JSFunctionPrint(FILE* out); | |
| 6220 #endif | |
| 6221 DECLARE_VERIFIER(JSFunction) | 6141 DECLARE_VERIFIER(JSFunction) | 
| 6222 | 6142 | 
| 6223 // Returns the number of allocated literals. | 6143 // Returns the number of allocated literals. | 
| 6224 inline int NumberOfLiterals(); | 6144 inline int NumberOfLiterals(); | 
| 6225 | 6145 | 
| 6226 // Retrieve the native context from a function's literal array. | 6146 // Retrieve the native context from a function's literal array. | 
| 6227 static Context* NativeContextFromLiterals(FixedArray* literals); | 6147 static Context* NativeContextFromLiterals(FixedArray* literals); | 
| 6228 | 6148 | 
| 6229 // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to | 6149 // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to | 
| 6230 // kSize) is weak and has special handling during garbage collection. | 6150 // kSize) is weak and has special handling during garbage collection. | 
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6264 class JSGlobalProxy : public JSObject { | 6184 class JSGlobalProxy : public JSObject { | 
| 6265 public: | 6185 public: | 
| 6266 // [native_context]: the owner native context of this global proxy object. | 6186 // [native_context]: the owner native context of this global proxy object. | 
| 6267 // It is null value if this object is not used by any context. | 6187 // It is null value if this object is not used by any context. | 
| 6268 DECL_ACCESSORS(native_context, Object) | 6188 DECL_ACCESSORS(native_context, Object) | 
| 6269 | 6189 | 
| 6270 // Casting. | 6190 // Casting. | 
| 6271 static inline JSGlobalProxy* cast(Object* obj); | 6191 static inline JSGlobalProxy* cast(Object* obj); | 
| 6272 | 6192 | 
| 6273 // Dispatched behavior. | 6193 // Dispatched behavior. | 
| 6274 #ifdef OBJECT_PRINT | 6194 DECLARE_PRINTER(JSGlobalProxy) | 
| 6275 inline void JSGlobalProxyPrint() { | |
| 6276 JSGlobalProxyPrint(stdout); | |
| 6277 } | |
| 6278 void JSGlobalProxyPrint(FILE* out); | |
| 6279 #endif | |
| 6280 DECLARE_VERIFIER(JSGlobalProxy) | 6195 DECLARE_VERIFIER(JSGlobalProxy) | 
| 6281 | 6196 | 
| 6282 // Layout description. | 6197 // Layout description. | 
| 6283 static const int kNativeContextOffset = JSObject::kHeaderSize; | 6198 static const int kNativeContextOffset = JSObject::kHeaderSize; | 
| 6284 static const int kSize = kNativeContextOffset + kPointerSize; | 6199 static const int kSize = kNativeContextOffset + kPointerSize; | 
| 6285 | 6200 | 
| 6286 private: | 6201 private: | 
| 6287 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalProxy); | 6202 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalProxy); | 
| 6288 }; | 6203 }; | 
| 6289 | 6204 | 
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6342 }; | 6257 }; | 
| 6343 | 6258 | 
| 6344 | 6259 | 
| 6345 // JavaScript global object. | 6260 // JavaScript global object. | 
| 6346 class JSGlobalObject: public GlobalObject { | 6261 class JSGlobalObject: public GlobalObject { | 
| 6347 public: | 6262 public: | 
| 6348 // Casting. | 6263 // Casting. | 
| 6349 static inline JSGlobalObject* cast(Object* obj); | 6264 static inline JSGlobalObject* cast(Object* obj); | 
| 6350 | 6265 | 
| 6351 // Dispatched behavior. | 6266 // Dispatched behavior. | 
| 6352 #ifdef OBJECT_PRINT | 6267 DECLARE_PRINTER(JSGlobalObject) | 
| 6353 inline void JSGlobalObjectPrint() { | |
| 6354 JSGlobalObjectPrint(stdout); | |
| 6355 } | |
| 6356 void JSGlobalObjectPrint(FILE* out); | |
| 6357 #endif | |
| 6358 DECLARE_VERIFIER(JSGlobalObject) | 6268 DECLARE_VERIFIER(JSGlobalObject) | 
| 6359 | 6269 | 
| 6360 // Layout description. | 6270 // Layout description. | 
| 6361 static const int kSize = GlobalObject::kHeaderSize; | 6271 static const int kSize = GlobalObject::kHeaderSize; | 
| 6362 | 6272 | 
| 6363 private: | 6273 private: | 
| 6364 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject); | 6274 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject); | 
| 6365 }; | 6275 }; | 
| 6366 | 6276 | 
| 6367 | 6277 | 
| 6368 // Builtins global object which holds the runtime routines written in | 6278 // Builtins global object which holds the runtime routines written in | 
| 6369 // JavaScript. | 6279 // JavaScript. | 
| 6370 class JSBuiltinsObject: public GlobalObject { | 6280 class JSBuiltinsObject: public GlobalObject { | 
| 6371 public: | 6281 public: | 
| 6372 // Accessors for the runtime routines written in JavaScript. | 6282 // Accessors for the runtime routines written in JavaScript. | 
| 6373 inline Object* javascript_builtin(Builtins::JavaScript id); | 6283 inline Object* javascript_builtin(Builtins::JavaScript id); | 
| 6374 inline void set_javascript_builtin(Builtins::JavaScript id, Object* value); | 6284 inline void set_javascript_builtin(Builtins::JavaScript id, Object* value); | 
| 6375 | 6285 | 
| 6376 // Accessors for code of the runtime routines written in JavaScript. | 6286 // Accessors for code of the runtime routines written in JavaScript. | 
| 6377 inline Code* javascript_builtin_code(Builtins::JavaScript id); | 6287 inline Code* javascript_builtin_code(Builtins::JavaScript id); | 
| 6378 inline void set_javascript_builtin_code(Builtins::JavaScript id, Code* value); | 6288 inline void set_javascript_builtin_code(Builtins::JavaScript id, Code* value); | 
| 6379 | 6289 | 
| 6380 // Casting. | 6290 // Casting. | 
| 6381 static inline JSBuiltinsObject* cast(Object* obj); | 6291 static inline JSBuiltinsObject* cast(Object* obj); | 
| 6382 | 6292 | 
| 6383 // Dispatched behavior. | 6293 // Dispatched behavior. | 
| 6384 #ifdef OBJECT_PRINT | 6294 DECLARE_PRINTER(JSBuiltinsObject) | 
| 6385 inline void JSBuiltinsObjectPrint() { | |
| 6386 JSBuiltinsObjectPrint(stdout); | |
| 6387 } | |
| 6388 void JSBuiltinsObjectPrint(FILE* out); | |
| 6389 #endif | |
| 6390 DECLARE_VERIFIER(JSBuiltinsObject) | 6295 DECLARE_VERIFIER(JSBuiltinsObject) | 
| 6391 | 6296 | 
| 6392 // Layout description. The size of the builtins object includes | 6297 // Layout description. The size of the builtins object includes | 
| 6393 // room for two pointers per runtime routine written in javascript | 6298 // room for two pointers per runtime routine written in javascript | 
| 6394 // (function and code object). | 6299 // (function and code object). | 
| 6395 static const int kJSBuiltinsCount = Builtins::id_count; | 6300 static const int kJSBuiltinsCount = Builtins::id_count; | 
| 6396 static const int kJSBuiltinsOffset = GlobalObject::kHeaderSize; | 6301 static const int kJSBuiltinsOffset = GlobalObject::kHeaderSize; | 
| 6397 static const int kJSBuiltinsCodeOffset = | 6302 static const int kJSBuiltinsCodeOffset = | 
| 6398 GlobalObject::kHeaderSize + (kJSBuiltinsCount * kPointerSize); | 6303 GlobalObject::kHeaderSize + (kJSBuiltinsCount * kPointerSize); | 
| 6399 static const int kSize = | 6304 static const int kSize = | 
| (...skipping 15 matching lines...) Expand all Loading... | |
| 6415 // Representation for JS Wrapper objects, String, Number, Boolean, etc. | 6320 // Representation for JS Wrapper objects, String, Number, Boolean, etc. | 
| 6416 class JSValue: public JSObject { | 6321 class JSValue: public JSObject { | 
| 6417 public: | 6322 public: | 
| 6418 // [value]: the object being wrapped. | 6323 // [value]: the object being wrapped. | 
| 6419 DECL_ACCESSORS(value, Object) | 6324 DECL_ACCESSORS(value, Object) | 
| 6420 | 6325 | 
| 6421 // Casting. | 6326 // Casting. | 
| 6422 static inline JSValue* cast(Object* obj); | 6327 static inline JSValue* cast(Object* obj); | 
| 6423 | 6328 | 
| 6424 // Dispatched behavior. | 6329 // Dispatched behavior. | 
| 6425 #ifdef OBJECT_PRINT | 6330 DECLARE_PRINTER(JSValue) | 
| 6426 inline void JSValuePrint() { | |
| 6427 JSValuePrint(stdout); | |
| 6428 } | |
| 6429 void JSValuePrint(FILE* out); | |
| 6430 #endif | |
| 6431 DECLARE_VERIFIER(JSValue) | 6331 DECLARE_VERIFIER(JSValue) | 
| 6432 | 6332 | 
| 6433 // Layout description. | 6333 // Layout description. | 
| 6434 static const int kValueOffset = JSObject::kHeaderSize; | 6334 static const int kValueOffset = JSObject::kHeaderSize; | 
| 6435 static const int kSize = kValueOffset + kPointerSize; | 6335 static const int kSize = kValueOffset + kPointerSize; | 
| 6436 | 6336 | 
| 6437 private: | 6337 private: | 
| 6438 DISALLOW_IMPLICIT_CONSTRUCTORS(JSValue); | 6338 DISALLOW_IMPLICIT_CONSTRUCTORS(JSValue); | 
| 6439 }; | 6339 }; | 
| 6440 | 6340 | 
| (...skipping 28 matching lines...) Expand all Loading... | |
| 6469 static inline JSDate* cast(Object* obj); | 6369 static inline JSDate* cast(Object* obj); | 
| 6470 | 6370 | 
| 6471 // Returns the date field with the specified index. | 6371 // Returns the date field with the specified index. | 
| 6472 // See FieldIndex for the list of date fields. | 6372 // See FieldIndex for the list of date fields. | 
| 6473 static Object* GetField(Object* date, Smi* index); | 6373 static Object* GetField(Object* date, Smi* index); | 
| 6474 | 6374 | 
| 6475 void SetValue(Object* value, bool is_value_nan); | 6375 void SetValue(Object* value, bool is_value_nan); | 
| 6476 | 6376 | 
| 6477 | 6377 | 
| 6478 // Dispatched behavior. | 6378 // Dispatched behavior. | 
| 6479 #ifdef OBJECT_PRINT | 6379 DECLARE_PRINTER(JSDate) | 
| 6480 inline void JSDatePrint() { | |
| 6481 JSDatePrint(stdout); | |
| 6482 } | |
| 6483 void JSDatePrint(FILE* out); | |
| 6484 #endif | |
| 6485 DECLARE_VERIFIER(JSDate) | 6380 DECLARE_VERIFIER(JSDate) | 
| 6486 | 6381 | 
| 6487 // The order is important. It must be kept in sync with date macros | 6382 // The order is important. It must be kept in sync with date macros | 
| 6488 // in macros.py. | 6383 // in macros.py. | 
| 6489 enum FieldIndex { | 6384 enum FieldIndex { | 
| 6490 kDateValue, | 6385 kDateValue, | 
| 6491 kYear, | 6386 kYear, | 
| 6492 kMonth, | 6387 kMonth, | 
| 6493 kDay, | 6388 kDay, | 
| 6494 kWeekday, | 6389 kWeekday, | 
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6566 inline void set_start_position(int value); | 6461 inline void set_start_position(int value); | 
| 6567 | 6462 | 
| 6568 // [end_position]: the end position in the script for the error message. | 6463 // [end_position]: the end position in the script for the error message. | 
| 6569 inline int end_position(); | 6464 inline int end_position(); | 
| 6570 inline void set_end_position(int value); | 6465 inline void set_end_position(int value); | 
| 6571 | 6466 | 
| 6572 // Casting. | 6467 // Casting. | 
| 6573 static inline JSMessageObject* cast(Object* obj); | 6468 static inline JSMessageObject* cast(Object* obj); | 
| 6574 | 6469 | 
| 6575 // Dispatched behavior. | 6470 // Dispatched behavior. | 
| 6576 #ifdef OBJECT_PRINT | 6471 DECLARE_PRINTER(JSMessageObject) | 
| 6577 inline void JSMessageObjectPrint() { | |
| 6578 JSMessageObjectPrint(stdout); | |
| 6579 } | |
| 6580 void JSMessageObjectPrint(FILE* out); | |
| 6581 #endif | |
| 6582 DECLARE_VERIFIER(JSMessageObject) | 6472 DECLARE_VERIFIER(JSMessageObject) | 
| 6583 | 6473 | 
| 6584 // Layout description. | 6474 // Layout description. | 
| 6585 static const int kTypeOffset = JSObject::kHeaderSize; | 6475 static const int kTypeOffset = JSObject::kHeaderSize; | 
| 6586 static const int kArgumentsOffset = kTypeOffset + kPointerSize; | 6476 static const int kArgumentsOffset = kTypeOffset + kPointerSize; | 
| 6587 static const int kScriptOffset = kArgumentsOffset + kPointerSize; | 6477 static const int kScriptOffset = kArgumentsOffset + kPointerSize; | 
| 6588 static const int kStackTraceOffset = kScriptOffset + kPointerSize; | 6478 static const int kStackTraceOffset = kScriptOffset + kPointerSize; | 
| 6589 static const int kStackFramesOffset = kStackTraceOffset + kPointerSize; | 6479 static const int kStackFramesOffset = kStackTraceOffset + kPointerSize; | 
| 6590 static const int kStartPositionOffset = kStackFramesOffset + kPointerSize; | 6480 static const int kStartPositionOffset = kStackFramesOffset + kPointerSize; | 
| 6591 static const int kEndPositionOffset = kStartPositionOffset + kPointerSize; | 6481 static const int kEndPositionOffset = kStartPositionOffset + kPointerSize; | 
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6812 // code object is not in that cache. This index can be used to later call | 6702 // code object is not in that cache. This index can be used to later call | 
| 6813 // RemoveByIndex. The cache cannot be modified between a call to GetIndex and | 6703 // RemoveByIndex. The cache cannot be modified between a call to GetIndex and | 
| 6814 // RemoveByIndex. | 6704 // RemoveByIndex. | 
| 6815 int GetIndex(Object* name, Code* code); | 6705 int GetIndex(Object* name, Code* code); | 
| 6816 | 6706 | 
| 6817 // Remove an object from the cache with the provided internal index. | 6707 // Remove an object from the cache with the provided internal index. | 
| 6818 void RemoveByIndex(Object* name, Code* code, int index); | 6708 void RemoveByIndex(Object* name, Code* code, int index); | 
| 6819 | 6709 | 
| 6820 static inline CodeCache* cast(Object* obj); | 6710 static inline CodeCache* cast(Object* obj); | 
| 6821 | 6711 | 
| 6822 #ifdef OBJECT_PRINT | 6712 // Dispatched behavior. | 
| 6823 inline void CodeCachePrint() { | 6713 DECLARE_PRINTER(CodeCache) | 
| 6824 CodeCachePrint(stdout); | |
| 6825 } | |
| 6826 void CodeCachePrint(FILE* out); | |
| 6827 #endif | |
| 6828 DECLARE_VERIFIER(CodeCache) | 6714 DECLARE_VERIFIER(CodeCache) | 
| 6829 | 6715 | 
| 6830 static const int kDefaultCacheOffset = HeapObject::kHeaderSize; | 6716 static const int kDefaultCacheOffset = HeapObject::kHeaderSize; | 
| 6831 static const int kNormalTypeCacheOffset = | 6717 static const int kNormalTypeCacheOffset = | 
| 6832 kDefaultCacheOffset + kPointerSize; | 6718 kDefaultCacheOffset + kPointerSize; | 
| 6833 static const int kSize = kNormalTypeCacheOffset + kPointerSize; | 6719 static const int kSize = kNormalTypeCacheOffset + kPointerSize; | 
| 6834 | 6720 | 
| 6835 private: | 6721 private: | 
| 6836 MUST_USE_RESULT MaybeObject* UpdateDefaultCache(String* name, Code* code); | 6722 MUST_USE_RESULT MaybeObject* UpdateDefaultCache(String* name, Code* code); | 
| 6837 MUST_USE_RESULT MaybeObject* UpdateNormalTypeCache(String* name, Code* code); | 6723 MUST_USE_RESULT MaybeObject* UpdateNormalTypeCache(String* name, Code* code); | 
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6901 | 6787 | 
| 6902 MUST_USE_RESULT MaybeObject* Update(MapHandleList* maps, | 6788 MUST_USE_RESULT MaybeObject* Update(MapHandleList* maps, | 
| 6903 Code::Flags flags, | 6789 Code::Flags flags, | 
| 6904 Code* code); | 6790 Code* code); | 
| 6905 | 6791 | 
| 6906 // Returns an undefined value if the entry is not found. | 6792 // Returns an undefined value if the entry is not found. | 
| 6907 Handle<Object> Lookup(MapHandleList* maps, Code::Flags flags); | 6793 Handle<Object> Lookup(MapHandleList* maps, Code::Flags flags); | 
| 6908 | 6794 | 
| 6909 static inline PolymorphicCodeCache* cast(Object* obj); | 6795 static inline PolymorphicCodeCache* cast(Object* obj); | 
| 6910 | 6796 | 
| 6911 #ifdef OBJECT_PRINT | 6797 // Dispatched behavior. | 
| 6912 inline void PolymorphicCodeCachePrint() { | 6798 DECLARE_PRINTER(PolymorphicCodeCache) | 
| 6913 PolymorphicCodeCachePrint(stdout); | |
| 6914 } | |
| 6915 void PolymorphicCodeCachePrint(FILE* out); | |
| 6916 #endif | |
| 6917 DECLARE_VERIFIER(PolymorphicCodeCache) | 6799 DECLARE_VERIFIER(PolymorphicCodeCache) | 
| 6918 | 6800 | 
| 6919 static const int kCacheOffset = HeapObject::kHeaderSize; | 6801 static const int kCacheOffset = HeapObject::kHeaderSize; | 
| 6920 static const int kSize = kCacheOffset + kPointerSize; | 6802 static const int kSize = kCacheOffset + kPointerSize; | 
| 6921 | 6803 | 
| 6922 private: | 6804 private: | 
| 6923 DISALLOW_IMPLICIT_CONSTRUCTORS(PolymorphicCodeCache); | 6805 DISALLOW_IMPLICIT_CONSTRUCTORS(PolymorphicCodeCache); | 
| 6924 }; | 6806 }; | 
| 6925 | 6807 | 
| 6926 | 6808 | 
| (...skipping 27 matching lines...) Expand all Loading... | |
| 6954 inline void change_own_type_change_checksum(); | 6836 inline void change_own_type_change_checksum(); | 
| 6955 inline int own_type_change_checksum(); | 6837 inline int own_type_change_checksum(); | 
| 6956 | 6838 | 
| 6957 inline void set_inlined_type_change_checksum(int checksum); | 6839 inline void set_inlined_type_change_checksum(int checksum); | 
| 6958 inline bool matches_inlined_type_change_checksum(int checksum); | 6840 inline bool matches_inlined_type_change_checksum(int checksum); | 
| 6959 | 6841 | 
| 6960 DECL_ACCESSORS(type_feedback_cells, TypeFeedbackCells) | 6842 DECL_ACCESSORS(type_feedback_cells, TypeFeedbackCells) | 
| 6961 | 6843 | 
| 6962 static inline TypeFeedbackInfo* cast(Object* obj); | 6844 static inline TypeFeedbackInfo* cast(Object* obj); | 
| 6963 | 6845 | 
| 6964 #ifdef OBJECT_PRINT | 6846 // Dispatched behavior. | 
| 6965 inline void TypeFeedbackInfoPrint() { | 6847 DECLARE_PRINTER(TypeFeedbackInfo) | 
| 6966 TypeFeedbackInfoPrint(stdout); | |
| 6967 } | |
| 6968 void TypeFeedbackInfoPrint(FILE* out); | |
| 6969 #endif | |
| 6970 DECLARE_VERIFIER(TypeFeedbackInfo) | 6848 DECLARE_VERIFIER(TypeFeedbackInfo) | 
| 6971 | 6849 | 
| 6972 static const int kStorage1Offset = HeapObject::kHeaderSize; | 6850 static const int kStorage1Offset = HeapObject::kHeaderSize; | 
| 6973 static const int kStorage2Offset = kStorage1Offset + kPointerSize; | 6851 static const int kStorage2Offset = kStorage1Offset + kPointerSize; | 
| 6974 static const int kTypeFeedbackCellsOffset = kStorage2Offset + kPointerSize; | 6852 static const int kTypeFeedbackCellsOffset = kStorage2Offset + kPointerSize; | 
| 6975 static const int kSize = kTypeFeedbackCellsOffset + kPointerSize; | 6853 static const int kSize = kTypeFeedbackCellsOffset + kPointerSize; | 
| 6976 | 6854 | 
| 6977 private: | 6855 private: | 
| 6978 static const int kTypeChangeChecksumBits = 7; | 6856 static const int kTypeChangeChecksumBits = 7; | 
| 6979 | 6857 | 
| (...skipping 20 matching lines...) Expand all Loading... | |
| 7000 // - the parameter map contains no fast alias mapping (i.e. the hole) | 6878 // - the parameter map contains no fast alias mapping (i.e. the hole) | 
| 7001 // - this struct (in the slow backing store) contains an index into the context | 6879 // - this struct (in the slow backing store) contains an index into the context | 
| 7002 // - all attributes are available as part if the property details | 6880 // - all attributes are available as part if the property details | 
| 7003 class AliasedArgumentsEntry: public Struct { | 6881 class AliasedArgumentsEntry: public Struct { | 
| 7004 public: | 6882 public: | 
| 7005 inline int aliased_context_slot(); | 6883 inline int aliased_context_slot(); | 
| 7006 inline void set_aliased_context_slot(int count); | 6884 inline void set_aliased_context_slot(int count); | 
| 7007 | 6885 | 
| 7008 static inline AliasedArgumentsEntry* cast(Object* obj); | 6886 static inline AliasedArgumentsEntry* cast(Object* obj); | 
| 7009 | 6887 | 
| 7010 #ifdef OBJECT_PRINT | 6888 // Dispatched behavior. | 
| 7011 inline void AliasedArgumentsEntryPrint() { | 6889 DECLARE_PRINTER(AliasedArgumentsEntry) | 
| 7012 AliasedArgumentsEntryPrint(stdout); | |
| 7013 } | |
| 7014 void AliasedArgumentsEntryPrint(FILE* out); | |
| 7015 #endif | |
| 7016 DECLARE_VERIFIER(AliasedArgumentsEntry) | 6890 DECLARE_VERIFIER(AliasedArgumentsEntry) | 
| 7017 | 6891 | 
| 7018 static const int kAliasedContextSlot = HeapObject::kHeaderSize; | 6892 static const int kAliasedContextSlot = HeapObject::kHeaderSize; | 
| 7019 static const int kSize = kAliasedContextSlot + kPointerSize; | 6893 static const int kSize = kAliasedContextSlot + kPointerSize; | 
| 7020 | 6894 | 
| 7021 private: | 6895 private: | 
| 7022 DISALLOW_IMPLICIT_CONSTRUCTORS(AliasedArgumentsEntry); | 6896 DISALLOW_IMPLICIT_CONSTRUCTORS(AliasedArgumentsEntry); | 
| 7023 }; | 6897 }; | 
| 7024 | 6898 | 
| 7025 | 6899 | 
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8114 static inline JSGlobalPropertyCell* cast(Object* obj); | 7988 static inline JSGlobalPropertyCell* cast(Object* obj); | 
| 8115 | 7989 | 
| 8116 static inline JSGlobalPropertyCell* FromValueAddress(Address value) { | 7990 static inline JSGlobalPropertyCell* FromValueAddress(Address value) { | 
| 8117 return cast(FromAddress(value - kValueOffset)); | 7991 return cast(FromAddress(value - kValueOffset)); | 
| 8118 } | 7992 } | 
| 8119 | 7993 | 
| 8120 inline Address ValueAddress() { | 7994 inline Address ValueAddress() { | 
| 8121 return address() + kValueOffset; | 7995 return address() + kValueOffset; | 
| 8122 } | 7996 } | 
| 8123 | 7997 | 
| 7998 // Dispatched behavior. | |
| 7999 DECLARE_PRINTER(JSGlobalPropertyCell) | |
| 8124 DECLARE_VERIFIER(JSGlobalPropertyCell) | 8000 DECLARE_VERIFIER(JSGlobalPropertyCell) | 
| 8125 | 8001 | 
| 8126 #ifdef OBJECT_PRINT | |
| 8127 inline void JSGlobalPropertyCellPrint() { | |
| 8128 JSGlobalPropertyCellPrint(stdout); | |
| 8129 } | |
| 8130 void JSGlobalPropertyCellPrint(FILE* out); | |
| 8131 #endif | |
| 8132 | |
| 8133 // Layout description. | 8002 // Layout description. | 
| 8134 static const int kValueOffset = HeapObject::kHeaderSize; | 8003 static const int kValueOffset = HeapObject::kHeaderSize; | 
| 8135 static const int kSize = kValueOffset + kPointerSize; | 8004 static const int kSize = kValueOffset + kPointerSize; | 
| 8136 | 8005 | 
| 8137 typedef FixedBodyDescriptor<kValueOffset, | 8006 typedef FixedBodyDescriptor<kValueOffset, | 
| 8138 kValueOffset + kPointerSize, | 8007 kValueOffset + kPointerSize, | 
| 8139 kSize> BodyDescriptor; | 8008 kSize> BodyDescriptor; | 
| 8140 | 8009 | 
| 8141 private: | 8010 private: | 
| 8142 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalPropertyCell); | 8011 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalPropertyCell); | 
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8212 inline void InitializeBody(int object_size, Object* value); | 8081 inline void InitializeBody(int object_size, Object* value); | 
| 8213 | 8082 | 
| 8214 // Invoke a trap by name. If the trap does not exist on this's handler, | 8083 // Invoke a trap by name. If the trap does not exist on this's handler, | 
| 8215 // but derived_trap is non-NULL, invoke that instead. May cause GC. | 8084 // but derived_trap is non-NULL, invoke that instead. May cause GC. | 
| 8216 Handle<Object> CallTrap(const char* name, | 8085 Handle<Object> CallTrap(const char* name, | 
| 8217 Handle<Object> derived_trap, | 8086 Handle<Object> derived_trap, | 
| 8218 int argc, | 8087 int argc, | 
| 8219 Handle<Object> args[]); | 8088 Handle<Object> args[]); | 
| 8220 | 8089 | 
| 8221 // Dispatched behavior. | 8090 // Dispatched behavior. | 
| 8222 #ifdef OBJECT_PRINT | 8091 DECLARE_PRINTER(JSProxy) | 
| 8223 inline void JSProxyPrint() { | |
| 8224 JSProxyPrint(stdout); | |
| 8225 } | |
| 8226 void JSProxyPrint(FILE* out); | |
| 8227 #endif | |
| 8228 DECLARE_VERIFIER(JSProxy) | 8092 DECLARE_VERIFIER(JSProxy) | 
| 8229 | 8093 | 
| 8230 // Layout description. We add padding so that a proxy has the same | 8094 // Layout description. We add padding so that a proxy has the same | 
| 8231 // size as a virgin JSObject. This is essential for becoming a JSObject | 8095 // size as a virgin JSObject. This is essential for becoming a JSObject | 
| 8232 // upon freeze. | 8096 // upon freeze. | 
| 8233 static const int kHandlerOffset = HeapObject::kHeaderSize; | 8097 static const int kHandlerOffset = HeapObject::kHeaderSize; | 
| 8234 static const int kHashOffset = kHandlerOffset + kPointerSize; | 8098 static const int kHashOffset = kHandlerOffset + kPointerSize; | 
| 8235 static const int kPaddingOffset = kHashOffset + kPointerSize; | 8099 static const int kPaddingOffset = kHashOffset + kPointerSize; | 
| 8236 static const int kSize = JSObject::kHeaderSize; | 8100 static const int kSize = JSObject::kHeaderSize; | 
| 8237 static const int kHeaderSize = kPaddingOffset; | 8101 static const int kHeaderSize = kPaddingOffset; | 
| (...skipping 15 matching lines...) Expand all Loading... | |
| 8253 // [call_trap]: The call trap. | 8117 // [call_trap]: The call trap. | 
| 8254 DECL_ACCESSORS(call_trap, Object) | 8118 DECL_ACCESSORS(call_trap, Object) | 
| 8255 | 8119 | 
| 8256 // [construct_trap]: The construct trap. | 8120 // [construct_trap]: The construct trap. | 
| 8257 DECL_ACCESSORS(construct_trap, Object) | 8121 DECL_ACCESSORS(construct_trap, Object) | 
| 8258 | 8122 | 
| 8259 // Casting. | 8123 // Casting. | 
| 8260 static inline JSFunctionProxy* cast(Object* obj); | 8124 static inline JSFunctionProxy* cast(Object* obj); | 
| 8261 | 8125 | 
| 8262 // Dispatched behavior. | 8126 // Dispatched behavior. | 
| 8263 #ifdef OBJECT_PRINT | 8127 DECLARE_PRINTER(JSFunctionProxy) | 
| 8264 inline void JSFunctionProxyPrint() { | |
| 8265 JSFunctionProxyPrint(stdout); | |
| 8266 } | |
| 8267 void JSFunctionProxyPrint(FILE* out); | |
| 8268 #endif | |
| 8269 DECLARE_VERIFIER(JSFunctionProxy) | 8128 DECLARE_VERIFIER(JSFunctionProxy) | 
| 8270 | 8129 | 
| 8271 // Layout description. | 8130 // Layout description. | 
| 8272 static const int kCallTrapOffset = JSProxy::kPaddingOffset; | 8131 static const int kCallTrapOffset = JSProxy::kPaddingOffset; | 
| 8273 static const int kConstructTrapOffset = kCallTrapOffset + kPointerSize; | 8132 static const int kConstructTrapOffset = kCallTrapOffset + kPointerSize; | 
| 8274 static const int kPaddingOffset = kConstructTrapOffset + kPointerSize; | 8133 static const int kPaddingOffset = kConstructTrapOffset + kPointerSize; | 
| 8275 static const int kSize = JSFunction::kSize; | 8134 static const int kSize = JSFunction::kSize; | 
| 8276 static const int kPaddingSize = kSize - kPaddingOffset; | 8135 static const int kPaddingSize = kSize - kPaddingOffset; | 
| 8277 | 8136 | 
| 8278 STATIC_CHECK(kPaddingSize >= 0); | 8137 STATIC_CHECK(kPaddingSize >= 0); | 
| 8279 | 8138 | 
| 8280 typedef FixedBodyDescriptor<kHandlerOffset, | 8139 typedef FixedBodyDescriptor<kHandlerOffset, | 
| 8281 kConstructTrapOffset + kPointerSize, | 8140 kConstructTrapOffset + kPointerSize, | 
| 8282 kSize> BodyDescriptor; | 8141 kSize> BodyDescriptor; | 
| 8283 | 8142 | 
| 8284 private: | 8143 private: | 
| 8285 DISALLOW_IMPLICIT_CONSTRUCTORS(JSFunctionProxy); | 8144 DISALLOW_IMPLICIT_CONSTRUCTORS(JSFunctionProxy); | 
| 8286 }; | 8145 }; | 
| 8287 | 8146 | 
| 8288 | 8147 | 
| 8289 // The JSSet describes EcmaScript Harmony sets | 8148 // The JSSet describes EcmaScript Harmony sets | 
| 8290 class JSSet: public JSObject { | 8149 class JSSet: public JSObject { | 
| 8291 public: | 8150 public: | 
| 8292 // [set]: the backing hash set containing keys. | 8151 // [set]: the backing hash set containing keys. | 
| 8293 DECL_ACCESSORS(table, Object) | 8152 DECL_ACCESSORS(table, Object) | 
| 8294 | 8153 | 
| 8295 // Casting. | 8154 // Casting. | 
| 8296 static inline JSSet* cast(Object* obj); | 8155 static inline JSSet* cast(Object* obj); | 
| 8297 | 8156 | 
| 8298 #ifdef OBJECT_PRINT | 8157 // Dispatched behavior. | 
| 8299 inline void JSSetPrint() { | 8158 DECLARE_PRINTER(JSSet) | 
| 8300 JSSetPrint(stdout); | |
| 8301 } | |
| 8302 void JSSetPrint(FILE* out); | |
| 8303 #endif | |
| 8304 DECLARE_VERIFIER(JSSet) | 8159 DECLARE_VERIFIER(JSSet) | 
| 8305 | 8160 | 
| 8306 static const int kTableOffset = JSObject::kHeaderSize; | 8161 static const int kTableOffset = JSObject::kHeaderSize; | 
| 8307 static const int kSize = kTableOffset + kPointerSize; | 8162 static const int kSize = kTableOffset + kPointerSize; | 
| 8308 | 8163 | 
| 8309 private: | 8164 private: | 
| 8310 DISALLOW_IMPLICIT_CONSTRUCTORS(JSSet); | 8165 DISALLOW_IMPLICIT_CONSTRUCTORS(JSSet); | 
| 8311 }; | 8166 }; | 
| 8312 | 8167 | 
| 8313 | 8168 | 
| 8314 // The JSMap describes EcmaScript Harmony maps | 8169 // The JSMap describes EcmaScript Harmony maps | 
| 8315 class JSMap: public JSObject { | 8170 class JSMap: public JSObject { | 
| 8316 public: | 8171 public: | 
| 8317 // [table]: the backing hash table mapping keys to values. | 8172 // [table]: the backing hash table mapping keys to values. | 
| 8318 DECL_ACCESSORS(table, Object) | 8173 DECL_ACCESSORS(table, Object) | 
| 8319 | 8174 | 
| 8320 // Casting. | 8175 // Casting. | 
| 8321 static inline JSMap* cast(Object* obj); | 8176 static inline JSMap* cast(Object* obj); | 
| 8322 | 8177 | 
| 8323 #ifdef OBJECT_PRINT | 8178 // Dispatched behavior. | 
| 8324 inline void JSMapPrint() { | 8179 DECLARE_PRINTER(JSMap) | 
| 8325 JSMapPrint(stdout); | |
| 8326 } | |
| 8327 void JSMapPrint(FILE* out); | |
| 8328 #endif | |
| 8329 DECLARE_VERIFIER(JSMap) | 8180 DECLARE_VERIFIER(JSMap) | 
| 8330 | 8181 | 
| 8331 static const int kTableOffset = JSObject::kHeaderSize; | 8182 static const int kTableOffset = JSObject::kHeaderSize; | 
| 8332 static const int kSize = kTableOffset + kPointerSize; | 8183 static const int kSize = kTableOffset + kPointerSize; | 
| 8333 | 8184 | 
| 8334 private: | 8185 private: | 
| 8335 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMap); | 8186 DISALLOW_IMPLICIT_CONSTRUCTORS(JSMap); | 
| 8336 }; | 8187 }; | 
| 8337 | 8188 | 
| 8338 | 8189 | 
| 8339 // The JSWeakMap describes EcmaScript Harmony weak maps | 8190 // The JSWeakMap describes EcmaScript Harmony weak maps | 
| 8340 class JSWeakMap: public JSObject { | 8191 class JSWeakMap: public JSObject { | 
| 8341 public: | 8192 public: | 
| 8342 // [table]: the backing hash table mapping keys to values. | 8193 // [table]: the backing hash table mapping keys to values. | 
| 8343 DECL_ACCESSORS(table, Object) | 8194 DECL_ACCESSORS(table, Object) | 
| 8344 | 8195 | 
| 8345 // [next]: linked list of encountered weak maps during GC. | 8196 // [next]: linked list of encountered weak maps during GC. | 
| 8346 DECL_ACCESSORS(next, Object) | 8197 DECL_ACCESSORS(next, Object) | 
| 8347 | 8198 | 
| 8348 // Casting. | 8199 // Casting. | 
| 8349 static inline JSWeakMap* cast(Object* obj); | 8200 static inline JSWeakMap* cast(Object* obj); | 
| 8350 | 8201 | 
| 8351 #ifdef OBJECT_PRINT | 8202 // Dispatched behavior. | 
| 8352 inline void JSWeakMapPrint() { | 8203 DECLARE_PRINTER(JSWeakMap) | 
| 8353 JSWeakMapPrint(stdout); | |
| 8354 } | |
| 8355 void JSWeakMapPrint(FILE* out); | |
| 8356 #endif | |
| 8357 DECLARE_VERIFIER(JSWeakMap) | 8204 DECLARE_VERIFIER(JSWeakMap) | 
| 8358 | 8205 | 
| 8359 static const int kTableOffset = JSObject::kHeaderSize; | 8206 static const int kTableOffset = JSObject::kHeaderSize; | 
| 8360 static const int kNextOffset = kTableOffset + kPointerSize; | 8207 static const int kNextOffset = kTableOffset + kPointerSize; | 
| 8361 static const int kSize = kNextOffset + kPointerSize; | 8208 static const int kSize = kNextOffset + kPointerSize; | 
| 8362 | 8209 | 
| 8363 private: | 8210 private: | 
| 8364 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap); | 8211 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap); | 
| 8365 }; | 8212 }; | 
| 8366 | 8213 | 
| 8367 | 8214 | 
| 8368 // Foreign describes objects pointing from JavaScript to C structures. | 8215 // Foreign describes objects pointing from JavaScript to C structures. | 
| 8369 // Since they cannot contain references to JS HeapObjects they can be | 8216 // Since they cannot contain references to JS HeapObjects they can be | 
| 8370 // placed in old_data_space. | 8217 // placed in old_data_space. | 
| 8371 class Foreign: public HeapObject { | 8218 class Foreign: public HeapObject { | 
| 8372 public: | 8219 public: | 
| 8373 // [address]: field containing the address. | 8220 // [address]: field containing the address. | 
| 8374 inline Address foreign_address(); | 8221 inline Address foreign_address(); | 
| 8375 inline void set_foreign_address(Address value); | 8222 inline void set_foreign_address(Address value); | 
| 8376 | 8223 | 
| 8377 // Casting. | 8224 // Casting. | 
| 8378 static inline Foreign* cast(Object* obj); | 8225 static inline Foreign* cast(Object* obj); | 
| 8379 | 8226 | 
| 8380 // Dispatched behavior. | 8227 // Dispatched behavior. | 
| 8381 inline void ForeignIterateBody(ObjectVisitor* v); | 8228 inline void ForeignIterateBody(ObjectVisitor* v); | 
| 8382 | 8229 | 
| 8383 template<typename StaticVisitor> | 8230 template<typename StaticVisitor> | 
| 8384 inline void ForeignIterateBody(); | 8231 inline void ForeignIterateBody(); | 
| 8385 | 8232 | 
| 8386 #ifdef OBJECT_PRINT | 8233 // Dispatched behavior. | 
| 8387 inline void ForeignPrint() { | 8234 DECLARE_PRINTER(Foreign) | 
| 8388 ForeignPrint(stdout); | |
| 8389 } | |
| 8390 void ForeignPrint(FILE* out); | |
| 8391 #endif | |
| 8392 DECLARE_VERIFIER(Foreign) | 8235 DECLARE_VERIFIER(Foreign) | 
| 8393 | 8236 | 
| 8394 // Layout description. | 8237 // Layout description. | 
| 8395 | 8238 | 
| 8396 static const int kForeignAddressOffset = HeapObject::kHeaderSize; | 8239 static const int kForeignAddressOffset = HeapObject::kHeaderSize; | 
| 8397 static const int kSize = kForeignAddressOffset + kPointerSize; | 8240 static const int kSize = kForeignAddressOffset + kPointerSize; | 
| 8398 | 8241 | 
| 8399 STATIC_CHECK(kForeignAddressOffset == Internals::kForeignAddressOffset); | 8242 STATIC_CHECK(kForeignAddressOffset == Internals::kForeignAddressOffset); | 
| 8400 | 8243 | 
| 8401 private: | 8244 private: | 
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8434 MUST_USE_RESULT inline MaybeObject* SetContent(FixedArrayBase* storage); | 8277 MUST_USE_RESULT inline MaybeObject* SetContent(FixedArrayBase* storage); | 
| 8435 | 8278 | 
| 8436 // Casting. | 8279 // Casting. | 
| 8437 static inline JSArray* cast(Object* obj); | 8280 static inline JSArray* cast(Object* obj); | 
| 8438 | 8281 | 
| 8439 // Uses handles. Ensures that the fixed array backing the JSArray has at | 8282 // Uses handles. Ensures that the fixed array backing the JSArray has at | 
| 8440 // least the stated size. | 8283 // least the stated size. | 
| 8441 inline void EnsureSize(int minimum_size_of_backing_fixed_array); | 8284 inline void EnsureSize(int minimum_size_of_backing_fixed_array); | 
| 8442 | 8285 | 
| 8443 // Dispatched behavior. | 8286 // Dispatched behavior. | 
| 8444 #ifdef OBJECT_PRINT | 8287 DECLARE_PRINTER(JSArray) | 
| 8445 inline void JSArrayPrint() { | |
| 8446 JSArrayPrint(stdout); | |
| 8447 } | |
| 8448 void JSArrayPrint(FILE* out); | |
| 8449 #endif | |
| 8450 DECLARE_VERIFIER(JSArray) | 8288 DECLARE_VERIFIER(JSArray) | 
| 8451 | 8289 | 
| 8452 // Number of element slots to pre-allocate for an empty array. | 8290 // Number of element slots to pre-allocate for an empty array. | 
| 8453 static const int kPreallocatedArrayElements = 4; | 8291 static const int kPreallocatedArrayElements = 4; | 
| 8454 | 8292 | 
| 8455 // Layout description. | 8293 // Layout description. | 
| 8456 static const int kLengthOffset = JSObject::kHeaderSize; | 8294 static const int kLengthOffset = JSObject::kHeaderSize; | 
| 8457 static const int kSize = kLengthOffset + kPointerSize; | 8295 static const int kSize = kLengthOffset + kPointerSize; | 
| 8458 | 8296 | 
| 8459 private: | 8297 private: | 
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8513 inline void set_prohibits_overwriting(bool value); | 8351 inline void set_prohibits_overwriting(bool value); | 
| 8514 | 8352 | 
| 8515 inline PropertyAttributes property_attributes(); | 8353 inline PropertyAttributes property_attributes(); | 
| 8516 inline void set_property_attributes(PropertyAttributes attributes); | 8354 inline void set_property_attributes(PropertyAttributes attributes); | 
| 8517 | 8355 | 
| 8518 // Checks whether the given receiver is compatible with this accessor. | 8356 // Checks whether the given receiver is compatible with this accessor. | 
| 8519 inline bool IsCompatibleReceiver(Object* receiver); | 8357 inline bool IsCompatibleReceiver(Object* receiver); | 
| 8520 | 8358 | 
| 8521 static inline AccessorInfo* cast(Object* obj); | 8359 static inline AccessorInfo* cast(Object* obj); | 
| 8522 | 8360 | 
| 8523 #ifdef OBJECT_PRINT | 8361 // Dispatched behavior. | 
| 8524 inline void AccessorInfoPrint() { | 8362 DECLARE_PRINTER(AccessorInfo) | 
| 8525 AccessorInfoPrint(stdout); | |
| 8526 } | |
| 8527 void AccessorInfoPrint(FILE* out); | |
| 8528 #endif | |
| 8529 DECLARE_VERIFIER(AccessorInfo) | 8363 DECLARE_VERIFIER(AccessorInfo) | 
| 8530 | 8364 | 
| 8531 static const int kGetterOffset = HeapObject::kHeaderSize; | 8365 static const int kGetterOffset = HeapObject::kHeaderSize; | 
| 8532 static const int kSetterOffset = kGetterOffset + kPointerSize; | 8366 static const int kSetterOffset = kGetterOffset + kPointerSize; | 
| 8533 static const int kDataOffset = kSetterOffset + kPointerSize; | 8367 static const int kDataOffset = kSetterOffset + kPointerSize; | 
| 8534 static const int kNameOffset = kDataOffset + kPointerSize; | 8368 static const int kNameOffset = kDataOffset + kPointerSize; | 
| 8535 static const int kFlagOffset = kNameOffset + kPointerSize; | 8369 static const int kFlagOffset = kNameOffset + kPointerSize; | 
| 8536 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; | 8370 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; | 
| 8537 static const int kSize = kExpectedReceiverTypeOffset + kPointerSize; | 8371 static const int kSize = kExpectedReceiverTypeOffset + kPointerSize; | 
| 8538 | 8372 | 
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8580 // Set both components, skipping arguments which are a JavaScript null. | 8414 // Set both components, skipping arguments which are a JavaScript null. | 
| 8581 void SetComponents(Object* getter, Object* setter) { | 8415 void SetComponents(Object* getter, Object* setter) { | 
| 8582 if (!getter->IsNull()) set_getter(getter); | 8416 if (!getter->IsNull()) set_getter(getter); | 
| 8583 if (!setter->IsNull()) set_setter(setter); | 8417 if (!setter->IsNull()) set_setter(setter); | 
| 8584 } | 8418 } | 
| 8585 | 8419 | 
| 8586 bool ContainsAccessor() { | 8420 bool ContainsAccessor() { | 
| 8587 return IsJSAccessor(getter()) || IsJSAccessor(setter()); | 8421 return IsJSAccessor(getter()) || IsJSAccessor(setter()); | 
| 8588 } | 8422 } | 
| 8589 | 8423 | 
| 8590 #ifdef OBJECT_PRINT | 8424 // Dispatched behavior. | 
| 8591 void AccessorPairPrint(FILE* out = stdout); | 8425 DECLARE_PRINTER(AccessorPair) | 
| 8592 #endif | |
| 8593 DECLARE_VERIFIER(AccessorPair) | 8426 DECLARE_VERIFIER(AccessorPair) | 
| 8594 | 8427 | 
| 8595 static const int kGetterOffset = HeapObject::kHeaderSize; | 8428 static const int kGetterOffset = HeapObject::kHeaderSize; | 
| 8596 static const int kSetterOffset = kGetterOffset + kPointerSize; | 8429 static const int kSetterOffset = kGetterOffset + kPointerSize; | 
| 8597 static const int kSize = kSetterOffset + kPointerSize; | 8430 static const int kSize = kSetterOffset + kPointerSize; | 
| 8598 | 8431 | 
| 8599 private: | 8432 private: | 
| 8600 // Strangely enough, in addition to functions and harmony proxies, the spec | 8433 // Strangely enough, in addition to functions and harmony proxies, the spec | 
| 8601 // requires us to consider undefined as a kind of accessor, too: | 8434 // requires us to consider undefined as a kind of accessor, too: | 
| 8602 // var obj = {}; | 8435 // var obj = {}; | 
| 8603 // Object.defineProperty(obj, "foo", {get: undefined}); | 8436 // Object.defineProperty(obj, "foo", {get: undefined}); | 
| 8604 // assertTrue("foo" in obj); | 8437 // assertTrue("foo" in obj); | 
| 8605 bool IsJSAccessor(Object* obj) { | 8438 bool IsJSAccessor(Object* obj) { | 
| 8606 return obj->IsSpecFunction() || obj->IsUndefined(); | 8439 return obj->IsSpecFunction() || obj->IsUndefined(); | 
| 8607 } | 8440 } | 
| 8608 | 8441 | 
| 8609 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorPair); | 8442 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorPair); | 
| 8610 }; | 8443 }; | 
| 8611 | 8444 | 
| 8612 | 8445 | 
| 8613 class AccessCheckInfo: public Struct { | 8446 class AccessCheckInfo: public Struct { | 
| 8614 public: | 8447 public: | 
| 8615 DECL_ACCESSORS(named_callback, Object) | 8448 DECL_ACCESSORS(named_callback, Object) | 
| 8616 DECL_ACCESSORS(indexed_callback, Object) | 8449 DECL_ACCESSORS(indexed_callback, Object) | 
| 8617 DECL_ACCESSORS(data, Object) | 8450 DECL_ACCESSORS(data, Object) | 
| 8618 | 8451 | 
| 8619 static inline AccessCheckInfo* cast(Object* obj); | 8452 static inline AccessCheckInfo* cast(Object* obj); | 
| 8620 | 8453 | 
| 8621 #ifdef OBJECT_PRINT | 8454 // Dispatched behavior. | 
| 8622 inline void AccessCheckInfoPrint() { | 8455 DECLARE_PRINTER(AccessCheckInfo) | 
| 8623 AccessCheckInfoPrint(stdout); | |
| 8624 } | |
| 8625 void AccessCheckInfoPrint(FILE* out); | |
| 8626 #endif | |
| 8627 DECLARE_VERIFIER(AccessCheckInfo) | 8456 DECLARE_VERIFIER(AccessCheckInfo) | 
| 8628 | 8457 | 
| 8629 static const int kNamedCallbackOffset = HeapObject::kHeaderSize; | 8458 static const int kNamedCallbackOffset = HeapObject::kHeaderSize; | 
| 8630 static const int kIndexedCallbackOffset = kNamedCallbackOffset + kPointerSize; | 8459 static const int kIndexedCallbackOffset = kNamedCallbackOffset + kPointerSize; | 
| 8631 static const int kDataOffset = kIndexedCallbackOffset + kPointerSize; | 8460 static const int kDataOffset = kIndexedCallbackOffset + kPointerSize; | 
| 8632 static const int kSize = kDataOffset + kPointerSize; | 8461 static const int kSize = kDataOffset + kPointerSize; | 
| 8633 | 8462 | 
| 8634 private: | 8463 private: | 
| 8635 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessCheckInfo); | 8464 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessCheckInfo); | 
| 8636 }; | 8465 }; | 
| 8637 | 8466 | 
| 8638 | 8467 | 
| 8639 class InterceptorInfo: public Struct { | 8468 class InterceptorInfo: public Struct { | 
| 8640 public: | 8469 public: | 
| 8641 DECL_ACCESSORS(getter, Object) | 8470 DECL_ACCESSORS(getter, Object) | 
| 8642 DECL_ACCESSORS(setter, Object) | 8471 DECL_ACCESSORS(setter, Object) | 
| 8643 DECL_ACCESSORS(query, Object) | 8472 DECL_ACCESSORS(query, Object) | 
| 8644 DECL_ACCESSORS(deleter, Object) | 8473 DECL_ACCESSORS(deleter, Object) | 
| 8645 DECL_ACCESSORS(enumerator, Object) | 8474 DECL_ACCESSORS(enumerator, Object) | 
| 8646 DECL_ACCESSORS(data, Object) | 8475 DECL_ACCESSORS(data, Object) | 
| 8647 | 8476 | 
| 8648 static inline InterceptorInfo* cast(Object* obj); | 8477 static inline InterceptorInfo* cast(Object* obj); | 
| 8649 | 8478 | 
| 8650 #ifdef OBJECT_PRINT | 8479 // Dispatched behavior. | 
| 8651 inline void InterceptorInfoPrint() { | 8480 DECLARE_PRINTER(InterceptorInfo) | 
| 8652 InterceptorInfoPrint(stdout); | |
| 8653 } | |
| 8654 void InterceptorInfoPrint(FILE* out); | |
| 8655 #endif | |
| 8656 DECLARE_VERIFIER(InterceptorInfo) | 8481 DECLARE_VERIFIER(InterceptorInfo) | 
| 8657 | 8482 | 
| 8658 static const int kGetterOffset = HeapObject::kHeaderSize; | 8483 static const int kGetterOffset = HeapObject::kHeaderSize; | 
| 8659 static const int kSetterOffset = kGetterOffset + kPointerSize; | 8484 static const int kSetterOffset = kGetterOffset + kPointerSize; | 
| 8660 static const int kQueryOffset = kSetterOffset + kPointerSize; | 8485 static const int kQueryOffset = kSetterOffset + kPointerSize; | 
| 8661 static const int kDeleterOffset = kQueryOffset + kPointerSize; | 8486 static const int kDeleterOffset = kQueryOffset + kPointerSize; | 
| 8662 static const int kEnumeratorOffset = kDeleterOffset + kPointerSize; | 8487 static const int kEnumeratorOffset = kDeleterOffset + kPointerSize; | 
| 8663 static const int kDataOffset = kEnumeratorOffset + kPointerSize; | 8488 static const int kDataOffset = kEnumeratorOffset + kPointerSize; | 
| 8664 static const int kSize = kDataOffset + kPointerSize; | 8489 static const int kSize = kDataOffset + kPointerSize; | 
| 8665 | 8490 | 
| 8666 private: | 8491 private: | 
| 8667 DISALLOW_IMPLICIT_CONSTRUCTORS(InterceptorInfo); | 8492 DISALLOW_IMPLICIT_CONSTRUCTORS(InterceptorInfo); | 
| 8668 }; | 8493 }; | 
| 8669 | 8494 | 
| 8670 | 8495 | 
| 8671 class CallHandlerInfo: public Struct { | 8496 class CallHandlerInfo: public Struct { | 
| 8672 public: | 8497 public: | 
| 8673 DECL_ACCESSORS(callback, Object) | 8498 DECL_ACCESSORS(callback, Object) | 
| 8674 DECL_ACCESSORS(data, Object) | 8499 DECL_ACCESSORS(data, Object) | 
| 8675 | 8500 | 
| 8676 static inline CallHandlerInfo* cast(Object* obj); | 8501 static inline CallHandlerInfo* cast(Object* obj); | 
| 8677 | 8502 | 
| 8678 #ifdef OBJECT_PRINT | 8503 // Dispatched behavior. | 
| 8679 inline void CallHandlerInfoPrint() { | 8504 DECLARE_PRINTER(CallHandlerInfo) | 
| 8680 CallHandlerInfoPrint(stdout); | |
| 8681 } | |
| 8682 void CallHandlerInfoPrint(FILE* out); | |
| 8683 #endif | |
| 8684 DECLARE_VERIFIER(CallHandlerInfo) | 8505 DECLARE_VERIFIER(CallHandlerInfo) | 
| 8685 | 8506 | 
| 8686 static const int kCallbackOffset = HeapObject::kHeaderSize; | 8507 static const int kCallbackOffset = HeapObject::kHeaderSize; | 
| 8687 static const int kDataOffset = kCallbackOffset + kPointerSize; | 8508 static const int kDataOffset = kCallbackOffset + kPointerSize; | 
| 8688 static const int kSize = kDataOffset + kPointerSize; | 8509 static const int kSize = kDataOffset + kPointerSize; | 
| 8689 | 8510 | 
| 8690 private: | 8511 private: | 
| 8691 DISALLOW_IMPLICIT_CONSTRUCTORS(CallHandlerInfo); | 8512 DISALLOW_IMPLICIT_CONSTRUCTORS(CallHandlerInfo); | 
| 8692 }; | 8513 }; | 
| 8693 | 8514 | 
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8727 // Following properties use flag bits. | 8548 // Following properties use flag bits. | 
| 8728 DECL_BOOLEAN_ACCESSORS(hidden_prototype) | 8549 DECL_BOOLEAN_ACCESSORS(hidden_prototype) | 
| 8729 DECL_BOOLEAN_ACCESSORS(undetectable) | 8550 DECL_BOOLEAN_ACCESSORS(undetectable) | 
| 8730 // If the bit is set, object instances created by this function | 8551 // If the bit is set, object instances created by this function | 
| 8731 // requires access check. | 8552 // requires access check. | 
| 8732 DECL_BOOLEAN_ACCESSORS(needs_access_check) | 8553 DECL_BOOLEAN_ACCESSORS(needs_access_check) | 
| 8733 DECL_BOOLEAN_ACCESSORS(read_only_prototype) | 8554 DECL_BOOLEAN_ACCESSORS(read_only_prototype) | 
| 8734 | 8555 | 
| 8735 static inline FunctionTemplateInfo* cast(Object* obj); | 8556 static inline FunctionTemplateInfo* cast(Object* obj); | 
| 8736 | 8557 | 
| 8737 #ifdef OBJECT_PRINT | 8558 // Dispatched behavior. | 
| 8738 inline void FunctionTemplateInfoPrint() { | 8559 DECLARE_PRINTER(FunctionTemplateInfo) | 
| 8739 FunctionTemplateInfoPrint(stdout); | |
| 8740 } | |
| 8741 void FunctionTemplateInfoPrint(FILE* out); | |
| 8742 #endif | |
| 8743 DECLARE_VERIFIER(FunctionTemplateInfo) | 8560 DECLARE_VERIFIER(FunctionTemplateInfo) | 
| 8744 | 8561 | 
| 8745 static const int kSerialNumberOffset = TemplateInfo::kHeaderSize; | 8562 static const int kSerialNumberOffset = TemplateInfo::kHeaderSize; | 
| 8746 static const int kCallCodeOffset = kSerialNumberOffset + kPointerSize; | 8563 static const int kCallCodeOffset = kSerialNumberOffset + kPointerSize; | 
| 8747 static const int kPropertyAccessorsOffset = kCallCodeOffset + kPointerSize; | 8564 static const int kPropertyAccessorsOffset = kCallCodeOffset + kPointerSize; | 
| 8748 static const int kPrototypeTemplateOffset = | 8565 static const int kPrototypeTemplateOffset = | 
| 8749 kPropertyAccessorsOffset + kPointerSize; | 8566 kPropertyAccessorsOffset + kPointerSize; | 
| 8750 static const int kParentTemplateOffset = | 8567 static const int kParentTemplateOffset = | 
| 8751 kPrototypeTemplateOffset + kPointerSize; | 8568 kPrototypeTemplateOffset + kPointerSize; | 
| 8752 static const int kNamedPropertyHandlerOffset = | 8569 static const int kNamedPropertyHandlerOffset = | 
| (...skipping 21 matching lines...) Expand all Loading... | |
| 8774 }; | 8591 }; | 
| 8775 | 8592 | 
| 8776 | 8593 | 
| 8777 class ObjectTemplateInfo: public TemplateInfo { | 8594 class ObjectTemplateInfo: public TemplateInfo { | 
| 8778 public: | 8595 public: | 
| 8779 DECL_ACCESSORS(constructor, Object) | 8596 DECL_ACCESSORS(constructor, Object) | 
| 8780 DECL_ACCESSORS(internal_field_count, Object) | 8597 DECL_ACCESSORS(internal_field_count, Object) | 
| 8781 | 8598 | 
| 8782 static inline ObjectTemplateInfo* cast(Object* obj); | 8599 static inline ObjectTemplateInfo* cast(Object* obj); | 
| 8783 | 8600 | 
| 8784 #ifdef OBJECT_PRINT | 8601 // Dispatched behavior. | 
| 8785 inline void ObjectTemplateInfoPrint() { | 8602 DECLARE_PRINTER(ObjectTemplateInfo) | 
| 8786 ObjectTemplateInfoPrint(stdout); | |
| 8787 } | |
| 8788 void ObjectTemplateInfoPrint(FILE* out); | |
| 8789 #endif | |
| 8790 DECLARE_VERIFIER(ObjectTemplateInfo) | 8603 DECLARE_VERIFIER(ObjectTemplateInfo) | 
| 8791 | 8604 | 
| 8792 static const int kConstructorOffset = TemplateInfo::kHeaderSize; | 8605 static const int kConstructorOffset = TemplateInfo::kHeaderSize; | 
| 8793 static const int kInternalFieldCountOffset = | 8606 static const int kInternalFieldCountOffset = | 
| 8794 kConstructorOffset + kPointerSize; | 8607 kConstructorOffset + kPointerSize; | 
| 8795 static const int kSize = kInternalFieldCountOffset + kPointerSize; | 8608 static const int kSize = kInternalFieldCountOffset + kPointerSize; | 
| 8796 }; | 8609 }; | 
| 8797 | 8610 | 
| 8798 | 8611 | 
| 8799 class SignatureInfo: public Struct { | 8612 class SignatureInfo: public Struct { | 
| 8800 public: | 8613 public: | 
| 8801 DECL_ACCESSORS(receiver, Object) | 8614 DECL_ACCESSORS(receiver, Object) | 
| 8802 DECL_ACCESSORS(args, Object) | 8615 DECL_ACCESSORS(args, Object) | 
| 8803 | 8616 | 
| 8804 static inline SignatureInfo* cast(Object* obj); | 8617 static inline SignatureInfo* cast(Object* obj); | 
| 8805 | 8618 | 
| 8806 #ifdef OBJECT_PRINT | 8619 // Dispatched behavior. | 
| 8807 inline void SignatureInfoPrint() { | 8620 DECLARE_PRINTER(SignatureInfo) | 
| 8808 SignatureInfoPrint(stdout); | |
| 8809 } | |
| 8810 void SignatureInfoPrint(FILE* out); | |
| 8811 #endif | |
| 8812 DECLARE_VERIFIER(SignatureInfo) | 8621 DECLARE_VERIFIER(SignatureInfo) | 
| 8813 | 8622 | 
| 8814 static const int kReceiverOffset = Struct::kHeaderSize; | 8623 static const int kReceiverOffset = Struct::kHeaderSize; | 
| 8815 static const int kArgsOffset = kReceiverOffset + kPointerSize; | 8624 static const int kArgsOffset = kReceiverOffset + kPointerSize; | 
| 8816 static const int kSize = kArgsOffset + kPointerSize; | 8625 static const int kSize = kArgsOffset + kPointerSize; | 
| 8817 | 8626 | 
| 8818 private: | 8627 private: | 
| 8819 DISALLOW_IMPLICIT_CONSTRUCTORS(SignatureInfo); | 8628 DISALLOW_IMPLICIT_CONSTRUCTORS(SignatureInfo); | 
| 8820 }; | 8629 }; | 
| 8821 | 8630 | 
| 8822 | 8631 | 
| 8823 class TypeSwitchInfo: public Struct { | 8632 class TypeSwitchInfo: public Struct { | 
| 8824 public: | 8633 public: | 
| 8825 DECL_ACCESSORS(types, Object) | 8634 DECL_ACCESSORS(types, Object) | 
| 8826 | 8635 | 
| 8827 static inline TypeSwitchInfo* cast(Object* obj); | 8636 static inline TypeSwitchInfo* cast(Object* obj); | 
| 8828 | 8637 | 
| 8829 #ifdef OBJECT_PRINT | 8638 // Dispatched behavior. | 
| 8830 inline void TypeSwitchInfoPrint() { | 8639 DECLARE_PRINTER(TypeSwitchInfo) | 
| 8831 TypeSwitchInfoPrint(stdout); | |
| 8832 } | |
| 8833 void TypeSwitchInfoPrint(FILE* out); | |
| 8834 #endif | |
| 8835 DECLARE_VERIFIER(TypeSwitchInfo) | 8640 DECLARE_VERIFIER(TypeSwitchInfo) | 
| 8836 | 8641 | 
| 8837 static const int kTypesOffset = Struct::kHeaderSize; | 8642 static const int kTypesOffset = Struct::kHeaderSize; | 
| 8838 static const int kSize = kTypesOffset + kPointerSize; | 8643 static const int kSize = kTypesOffset + kPointerSize; | 
| 8839 }; | 8644 }; | 
| 8840 | 8645 | 
| 8841 | 8646 | 
| 8842 #ifdef ENABLE_DEBUGGER_SUPPORT | 8647 #ifdef ENABLE_DEBUGGER_SUPPORT | 
| 8843 // The DebugInfo class holds additional information for a function being | 8648 // The DebugInfo class holds additional information for a function being | 
| 8844 // debugged. | 8649 // debugged. | 
| (...skipping 24 matching lines...) Expand all Loading... | |
| 8869 // Get the break point objects for a code position. | 8674 // Get the break point objects for a code position. | 
| 8870 Object* GetBreakPointObjects(int code_position); | 8675 Object* GetBreakPointObjects(int code_position); | 
| 8871 // Find the break point info holding this break point object. | 8676 // Find the break point info holding this break point object. | 
| 8872 static Object* FindBreakPointInfo(Handle<DebugInfo> debug_info, | 8677 static Object* FindBreakPointInfo(Handle<DebugInfo> debug_info, | 
| 8873 Handle<Object> break_point_object); | 8678 Handle<Object> break_point_object); | 
| 8874 // Get the number of break points for this function. | 8679 // Get the number of break points for this function. | 
| 8875 int GetBreakPointCount(); | 8680 int GetBreakPointCount(); | 
| 8876 | 8681 | 
| 8877 static inline DebugInfo* cast(Object* obj); | 8682 static inline DebugInfo* cast(Object* obj); | 
| 8878 | 8683 | 
| 8879 #ifdef OBJECT_PRINT | 8684 // Dispatched behavior. | 
| 8880 inline void DebugInfoPrint() { | 8685 DECLARE_PRINTER(DebugInfo) | 
| 8881 DebugInfoPrint(stdout); | |
| 8882 } | |
| 8883 void DebugInfoPrint(FILE* out); | |
| 8884 #endif | |
| 8885 DECLARE_VERIFIER(DebugInfo) | 8686 DECLARE_VERIFIER(DebugInfo) | 
| 8886 | 8687 | 
| 8887 static const int kSharedFunctionInfoIndex = Struct::kHeaderSize; | 8688 static const int kSharedFunctionInfoIndex = Struct::kHeaderSize; | 
| 8888 static const int kOriginalCodeIndex = kSharedFunctionInfoIndex + kPointerSize; | 8689 static const int kOriginalCodeIndex = kSharedFunctionInfoIndex + kPointerSize; | 
| 8889 static const int kPatchedCodeIndex = kOriginalCodeIndex + kPointerSize; | 8690 static const int kPatchedCodeIndex = kOriginalCodeIndex + kPointerSize; | 
| 8890 static const int kActiveBreakPointsCountIndex = | 8691 static const int kActiveBreakPointsCountIndex = | 
| 8891 kPatchedCodeIndex + kPointerSize; | 8692 kPatchedCodeIndex + kPointerSize; | 
| 8892 static const int kBreakPointsStateIndex = | 8693 static const int kBreakPointsStateIndex = | 
| 8893 kActiveBreakPointsCountIndex + kPointerSize; | 8694 kActiveBreakPointsCountIndex + kPointerSize; | 
| 8894 static const int kSize = kBreakPointsStateIndex + kPointerSize; | 8695 static const int kSize = kBreakPointsStateIndex + kPointerSize; | 
| (...skipping 30 matching lines...) Expand all Loading... | |
| 8925 static void SetBreakPoint(Handle<BreakPointInfo> info, | 8726 static void SetBreakPoint(Handle<BreakPointInfo> info, | 
| 8926 Handle<Object> break_point_object); | 8727 Handle<Object> break_point_object); | 
| 8927 // Check if break point info has this break point object. | 8728 // Check if break point info has this break point object. | 
| 8928 static bool HasBreakPointObject(Handle<BreakPointInfo> info, | 8729 static bool HasBreakPointObject(Handle<BreakPointInfo> info, | 
| 8929 Handle<Object> break_point_object); | 8730 Handle<Object> break_point_object); | 
| 8930 // Get the number of break points for this code position. | 8731 // Get the number of break points for this code position. | 
| 8931 int GetBreakPointCount(); | 8732 int GetBreakPointCount(); | 
| 8932 | 8733 | 
| 8933 static inline BreakPointInfo* cast(Object* obj); | 8734 static inline BreakPointInfo* cast(Object* obj); | 
| 8934 | 8735 | 
| 8935 #ifdef OBJECT_PRINT | 8736 // Dispatched behavior. | 
| 8936 inline void BreakPointInfoPrint() { | 8737 DECLARE_PRINTER(BreakPointInfo) | 
| 8937 BreakPointInfoPrint(stdout); | |
| 8938 } | |
| 8939 void BreakPointInfoPrint(FILE* out); | |
| 8940 #endif | |
| 8941 DECLARE_VERIFIER(BreakPointInfo) | 8738 DECLARE_VERIFIER(BreakPointInfo) | 
| 8942 | 8739 | 
| 8943 static const int kCodePositionIndex = Struct::kHeaderSize; | 8740 static const int kCodePositionIndex = Struct::kHeaderSize; | 
| 8944 static const int kSourcePositionIndex = kCodePositionIndex + kPointerSize; | 8741 static const int kSourcePositionIndex = kCodePositionIndex + kPointerSize; | 
| 8945 static const int kStatementPositionIndex = | 8742 static const int kStatementPositionIndex = | 
| 8946 kSourcePositionIndex + kPointerSize; | 8743 kSourcePositionIndex + kPointerSize; | 
| 8947 static const int kBreakPointObjectsIndex = | 8744 static const int kBreakPointObjectsIndex = | 
| 8948 kStatementPositionIndex + kPointerSize; | 8745 kStatementPositionIndex + kPointerSize; | 
| 8949 static const int kSize = kBreakPointObjectsIndex + kPointerSize; | 8746 static const int kSize = kBreakPointObjectsIndex + kPointerSize; | 
| 8950 | 8747 | 
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9083 } else { | 8880 } else { | 
| 9084 value &= ~(1 << bit_position); | 8881 value &= ~(1 << bit_position); | 
| 9085 } | 8882 } | 
| 9086 return value; | 8883 return value; | 
| 9087 } | 8884 } | 
| 9088 }; | 8885 }; | 
| 9089 | 8886 | 
| 9090 } } // namespace v8::internal | 8887 } } // namespace v8::internal | 
| 9091 | 8888 | 
| 9092 #endif // V8_OBJECTS_H_ | 8889 #endif // V8_OBJECTS_H_ | 
| OLD | NEW |