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