Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Side by Side Diff: src/objects.h

Issue 5998001: 1. Added support for object printing for release mode using the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/flag-definitions.h ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 } 600 }
601 inline Object* ToObjectUnchecked() { 601 inline Object* ToObjectUnchecked() {
602 ASSERT(!IsFailure()); 602 ASSERT(!IsFailure());
603 return reinterpret_cast<Object*>(this); 603 return reinterpret_cast<Object*>(this);
604 } 604 }
605 inline Object* ToObjectChecked() { 605 inline Object* ToObjectChecked() {
606 CHECK(!IsFailure()); 606 CHECK(!IsFailure());
607 return reinterpret_cast<Object*>(this); 607 return reinterpret_cast<Object*>(this);
608 } 608 }
609 609
610 #ifdef OBJECT_PRINT
611 // Prints this object with details.
612 inline void Print() {
613 Print(stdout);
614 };
615 inline void PrintLn() {
616 PrintLn(stdout);
617 }
618 void Print(FILE* out);
619 void PrintLn(FILE* out);
620 #endif
610 #ifdef DEBUG 621 #ifdef DEBUG
611 // Prints this object with details.
612 void Print();
613 void PrintLn();
614 // Verifies the object. 622 // Verifies the object.
615 void Verify(); 623 void Verify();
616 #endif 624 #endif
617 }; 625 };
618 626
619 // Object is the abstract superclass for all classes in the 627 // Object is the abstract superclass for all classes in the
620 // object hierarchy. 628 // object hierarchy.
621 // Object does not use any virtual functions to avoid the 629 // Object does not use any virtual functions to avoid the
622 // allocation of the C++ vtable. 630 // allocation of the C++ vtable.
623 // Since Smi and Failure are subclasses of Object no 631 // Since Smi and Failure are subclasses of Object no
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 // Returns true if this is a JSValue containing a string and the index is 763 // Returns true if this is a JSValue containing a string and the index is
756 // < the length of the string. Used to implement [] on strings. 764 // < the length of the string. Used to implement [] on strings.
757 inline bool IsStringObjectWithCharacterAt(uint32_t index); 765 inline bool IsStringObjectWithCharacterAt(uint32_t index);
758 766
759 #ifdef DEBUG 767 #ifdef DEBUG
760 // Verify a pointer is a valid object pointer. 768 // Verify a pointer is a valid object pointer.
761 static void VerifyPointer(Object* p); 769 static void VerifyPointer(Object* p);
762 #endif 770 #endif
763 771
764 // Prints this object without details. 772 // Prints this object without details.
765 void ShortPrint(); 773 inline void ShortPrint() {
774 ShortPrint(stdout);
775 }
776 void ShortPrint(FILE* out);
766 777
767 // Prints this object without details to a message accumulator. 778 // Prints this object without details to a message accumulator.
768 void ShortPrint(StringStream* accumulator); 779 void ShortPrint(StringStream* accumulator);
769 780
770 // Casting: This cast is only needed to satisfy macros in objects-inl.h. 781 // Casting: This cast is only needed to satisfy macros in objects-inl.h.
771 static Object* cast(Object* value) { return value; } 782 static Object* cast(Object* value) { return value; }
772 783
773 // Layout description. 784 // Layout description.
774 static const int kHeaderSize = 0; // Object does not take up any space. 785 static const int kHeaderSize = 0; // Object does not take up any space.
775 786
(...skipping 18 matching lines...) Expand all
794 805
795 static inline Smi* FromIntptr(intptr_t value); 806 static inline Smi* FromIntptr(intptr_t value);
796 807
797 // Returns whether value can be represented in a Smi. 808 // Returns whether value can be represented in a Smi.
798 static inline bool IsValid(intptr_t value); 809 static inline bool IsValid(intptr_t value);
799 810
800 // Casting. 811 // Casting.
801 static inline Smi* cast(Object* object); 812 static inline Smi* cast(Object* object);
802 813
803 // Dispatched behavior. 814 // Dispatched behavior.
804 void SmiPrint(); 815 inline void SmiPrint() {
816 SmiPrint(stdout);
817 }
818 void SmiPrint(FILE* out);
805 void SmiPrint(StringStream* accumulator); 819 void SmiPrint(StringStream* accumulator);
806 #ifdef DEBUG 820 #ifdef DEBUG
807 void SmiVerify(); 821 void SmiVerify();
808 #endif 822 #endif
809 823
810 static const int kMinValue = (-1 << (kSmiValueSize - 1)); 824 static const int kMinValue = (-1 << (kSmiValueSize - 1));
811 static const int kMaxValue = -(kMinValue + 1); 825 static const int kMaxValue = -(kMinValue + 1);
812 826
813 private: 827 private:
814 DISALLOW_IMPLICIT_CONSTRUCTORS(Smi); 828 DISALLOW_IMPLICIT_CONSTRUCTORS(Smi);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 877
864 static inline Failure* RetryAfterGC(AllocationSpace space); 878 static inline Failure* RetryAfterGC(AllocationSpace space);
865 static inline Failure* RetryAfterGC(); // NEW_SPACE 879 static inline Failure* RetryAfterGC(); // NEW_SPACE
866 static inline Failure* Exception(); 880 static inline Failure* Exception();
867 static inline Failure* InternalError(); 881 static inline Failure* InternalError();
868 static inline Failure* OutOfMemoryException(); 882 static inline Failure* OutOfMemoryException();
869 // Casting. 883 // Casting.
870 static inline Failure* cast(MaybeObject* object); 884 static inline Failure* cast(MaybeObject* object);
871 885
872 // Dispatched behavior. 886 // Dispatched behavior.
873 void FailurePrint(); 887 void FailurePrint(FILE* out);
874 void FailurePrint(StringStream* accumulator); 888 void FailurePrint(StringStream* accumulator);
875 #ifdef DEBUG 889 #ifdef DEBUG
876 void FailureVerify(); 890 void FailureVerify();
877 #endif 891 #endif
878 892
879 private: 893 private:
880 inline intptr_t value() const; 894 inline intptr_t value() const;
881 static inline Failure* Construct(Type type, intptr_t value = 0); 895 static inline Failure* Construct(Type type, intptr_t value = 0);
882 896
883 DISALLOW_IMPLICIT_CONSTRUCTORS(Failure); 897 DISALLOW_IMPLICIT_CONSTRUCTORS(Failure);
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 1106
1093 // Return the write barrier mode for this. Callers of this function 1107 // Return the write barrier mode for this. Callers of this function
1094 // must be able to present a reference to an AssertNoAllocation 1108 // must be able to present a reference to an AssertNoAllocation
1095 // object as a sign that they are not going to use this function 1109 // object as a sign that they are not going to use this function
1096 // from code that allocates and thus invalidates the returned write 1110 // from code that allocates and thus invalidates the returned write
1097 // barrier mode. 1111 // barrier mode.
1098 inline WriteBarrierMode GetWriteBarrierMode(const AssertNoAllocation&); 1112 inline WriteBarrierMode GetWriteBarrierMode(const AssertNoAllocation&);
1099 1113
1100 // Dispatched behavior. 1114 // Dispatched behavior.
1101 void HeapObjectShortPrint(StringStream* accumulator); 1115 void HeapObjectShortPrint(StringStream* accumulator);
1116 #ifdef OBJECT_PRINT
1117 inline void HeapObjectPrint() {
1118 HeapObjectPrint(stdout);
1119 }
1120 void HeapObjectPrint(FILE* out);
1121 #endif
1102 #ifdef DEBUG 1122 #ifdef DEBUG
1103 void HeapObjectPrint();
1104 void HeapObjectVerify(); 1123 void HeapObjectVerify();
1105 inline void VerifyObjectField(int offset); 1124 inline void VerifyObjectField(int offset);
1106 inline void VerifySmiField(int offset); 1125 inline void VerifySmiField(int offset);
1126 #endif
1107 1127
1108 void PrintHeader(const char* id); 1128 #ifdef OBJECT_PRINT
1129 void PrintHeader(FILE* out, const char* id);
1130 #endif
1109 1131
1132 #ifdef DEBUG
1110 // Verify a pointer is a valid HeapObject pointer that points to object 1133 // Verify a pointer is a valid HeapObject pointer that points to object
1111 // areas in the heap. 1134 // areas in the heap.
1112 static void VerifyHeapPointer(Object* p); 1135 static void VerifyHeapPointer(Object* p);
1113 #endif 1136 #endif
1114 1137
1115 // Layout description. 1138 // Layout description.
1116 // First field in a heap object is map. 1139 // First field in a heap object is map.
1117 static const int kMapOffset = Object::kHeaderSize; 1140 static const int kMapOffset = Object::kHeaderSize;
1118 static const int kHeaderSize = kMapOffset + kPointerSize; 1141 static const int kHeaderSize = kMapOffset + kPointerSize;
1119 1142
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 public: 1205 public:
1183 // [value]: number value. 1206 // [value]: number value.
1184 inline double value(); 1207 inline double value();
1185 inline void set_value(double value); 1208 inline void set_value(double value);
1186 1209
1187 // Casting. 1210 // Casting.
1188 static inline HeapNumber* cast(Object* obj); 1211 static inline HeapNumber* cast(Object* obj);
1189 1212
1190 // Dispatched behavior. 1213 // Dispatched behavior.
1191 Object* HeapNumberToBoolean(); 1214 Object* HeapNumberToBoolean();
1192 void HeapNumberPrint(); 1215 inline void HeapNumberPrint() {
1216 HeapNumberPrint(stdout);
1217 }
1218 void HeapNumberPrint(FILE* out);
1193 void HeapNumberPrint(StringStream* accumulator); 1219 void HeapNumberPrint(StringStream* accumulator);
1194 #ifdef DEBUG 1220 #ifdef DEBUG
1195 void HeapNumberVerify(); 1221 void HeapNumberVerify();
1196 #endif 1222 #endif
1197 1223
1198 inline int get_exponent(); 1224 inline int get_exponent();
1199 inline int get_sign(); 1225 inline int get_sign();
1200 1226
1201 // Layout description. 1227 // Layout description.
1202 static const int kValueOffset = HeapObject::kHeaderSize; 1228 static const int kValueOffset = HeapObject::kHeaderSize;
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 1668
1643 // Casting. 1669 // Casting.
1644 static inline JSObject* cast(Object* obj); 1670 static inline JSObject* cast(Object* obj);
1645 1671
1646 // Disalow further properties to be added to the object. 1672 // Disalow further properties to be added to the object.
1647 MUST_USE_RESULT MaybeObject* PreventExtensions(); 1673 MUST_USE_RESULT MaybeObject* PreventExtensions();
1648 1674
1649 1675
1650 // Dispatched behavior. 1676 // Dispatched behavior.
1651 void JSObjectShortPrint(StringStream* accumulator); 1677 void JSObjectShortPrint(StringStream* accumulator);
1678 #ifdef OBJECT_PRINT
1679 inline void JSObjectPrint() {
1680 JSObjectPrint(stdout);
1681 }
1682 void JSObjectPrint(FILE* out);
1683 #endif
1652 #ifdef DEBUG 1684 #ifdef DEBUG
1653 void JSObjectPrint();
1654 void JSObjectVerify(); 1685 void JSObjectVerify();
1655 void PrintProperties(); 1686 #endif
1656 void PrintElements(); 1687 #ifdef OBJECT_PRINT
1688 inline void PrintProperties() {
1689 PrintProperties(stdout);
1690 }
1691 void PrintProperties(FILE* out);
1657 1692
1693 inline void PrintElements() {
1694 PrintElements(stdout);
1695 }
1696 void PrintElements(FILE* out);
1697 #endif
1698
1699 #ifdef DEBUG
1658 // Structure for collecting spill information about JSObjects. 1700 // Structure for collecting spill information about JSObjects.
1659 class SpillInformation { 1701 class SpillInformation {
1660 public: 1702 public:
1661 void Clear(); 1703 void Clear();
1662 void Print(); 1704 void Print();
1663 int number_of_objects_; 1705 int number_of_objects_;
1664 int number_of_objects_with_fast_properties_; 1706 int number_of_objects_with_fast_properties_;
1665 int number_of_objects_with_fast_elements_; 1707 int number_of_objects_with_fast_elements_;
1666 int number_of_fast_used_fields_; 1708 int number_of_fast_used_fields_;
1667 int number_of_fast_unused_fields_; 1709 int number_of_fast_unused_fields_;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1828 static const int kHeaderSize = kLengthOffset + kPointerSize; 1870 static const int kHeaderSize = kLengthOffset + kPointerSize;
1829 1871
1830 // Maximal allowed size, in bytes, of a single FixedArray. 1872 // Maximal allowed size, in bytes, of a single FixedArray.
1831 // Prevents overflowing size computations, as well as extreme memory 1873 // Prevents overflowing size computations, as well as extreme memory
1832 // consumption. 1874 // consumption.
1833 static const int kMaxSize = 512 * MB; 1875 static const int kMaxSize = 512 * MB;
1834 // Maximally allowed length of a FixedArray. 1876 // Maximally allowed length of a FixedArray.
1835 static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize; 1877 static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize;
1836 1878
1837 // Dispatched behavior. 1879 // Dispatched behavior.
1880 #ifdef OBJECT_PRINT
1881 inline void FixedArrayPrint() {
1882 FixedArrayPrint(stdout);
1883 }
1884 void FixedArrayPrint(FILE* out);
1885 #endif
1838 #ifdef DEBUG 1886 #ifdef DEBUG
1839 void FixedArrayPrint();
1840 void FixedArrayVerify(); 1887 void FixedArrayVerify();
1841 // Checks if two FixedArrays have identical contents. 1888 // Checks if two FixedArrays have identical contents.
1842 bool IsEqualTo(FixedArray* other); 1889 bool IsEqualTo(FixedArray* other);
1843 #endif 1890 #endif
1844 1891
1845 // Swap two elements in a pair of arrays. If this array and the 1892 // Swap two elements in a pair of arrays. If this array and the
1846 // numbers array are the same object, the elements are only swapped 1893 // numbers array are the same object, the elements are only swapped
1847 // once. 1894 // once.
1848 void SwapPairs(FixedArray* numbers, int i, int j); 1895 void SwapPairs(FixedArray* numbers, int i, int j);
1849 1896
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2005 // Layout description. 2052 // Layout description.
2006 static const int kContentArrayOffset = FixedArray::kHeaderSize; 2053 static const int kContentArrayOffset = FixedArray::kHeaderSize;
2007 static const int kEnumerationIndexOffset = kContentArrayOffset + kPointerSize; 2054 static const int kEnumerationIndexOffset = kContentArrayOffset + kPointerSize;
2008 static const int kFirstOffset = kEnumerationIndexOffset + kPointerSize; 2055 static const int kFirstOffset = kEnumerationIndexOffset + kPointerSize;
2009 2056
2010 // Layout description for the bridge array. 2057 // Layout description for the bridge array.
2011 static const int kEnumCacheBridgeEnumOffset = FixedArray::kHeaderSize; 2058 static const int kEnumCacheBridgeEnumOffset = FixedArray::kHeaderSize;
2012 static const int kEnumCacheBridgeCacheOffset = 2059 static const int kEnumCacheBridgeCacheOffset =
2013 kEnumCacheBridgeEnumOffset + kPointerSize; 2060 kEnumCacheBridgeEnumOffset + kPointerSize;
2014 2061
2062 #ifdef OBJECT_PRINT
2063 // Print all the descriptors.
2064 inline void PrintDescriptors() {
2065 PrintDescriptors(stdout);
2066 }
2067 void PrintDescriptors(FILE* out);
2068 #endif
2069
2015 #ifdef DEBUG 2070 #ifdef DEBUG
2016 // Print all the descriptors.
2017 void PrintDescriptors();
2018
2019 // Is the descriptor array sorted and without duplicates? 2071 // Is the descriptor array sorted and without duplicates?
2020 bool IsSortedNoDuplicates(); 2072 bool IsSortedNoDuplicates();
2021 2073
2022 // Are two DescriptorArrays equal? 2074 // Are two DescriptorArrays equal?
2023 bool IsEqualTo(DescriptorArray* other); 2075 bool IsEqualTo(DescriptorArray* other);
2024 #endif 2076 #endif
2025 2077
2026 // The maximum number of descriptors we want in a descriptor array (should 2078 // The maximum number of descriptors we want in a descriptor array (should
2027 // fit in a page). 2079 // fit in a page).
2028 static const int kMaxNumberOfDescriptors = 1024 + 512; 2080 static const int kMaxNumberOfDescriptors = 1024 + 512;
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
2389 int NextEnumerationIndex() { 2441 int NextEnumerationIndex() {
2390 return Smi::cast(FixedArray::get(kNextEnumerationIndexIndex))->value(); 2442 return Smi::cast(FixedArray::get(kNextEnumerationIndexIndex))->value();
2391 } 2443 }
2392 2444
2393 // Returns a new array for dictionary usage. Might return Failure. 2445 // Returns a new array for dictionary usage. Might return Failure.
2394 MUST_USE_RESULT static MaybeObject* Allocate(int at_least_space_for); 2446 MUST_USE_RESULT static MaybeObject* Allocate(int at_least_space_for);
2395 2447
2396 // Ensure enough space for n additional elements. 2448 // Ensure enough space for n additional elements.
2397 MUST_USE_RESULT MaybeObject* EnsureCapacity(int n, Key key); 2449 MUST_USE_RESULT MaybeObject* EnsureCapacity(int n, Key key);
2398 2450
2399 #ifdef DEBUG 2451 #ifdef OBJECT_PRINT
2400 void Print(); 2452 inline void Print() {
2453 Print(stdout);
2454 }
2455 void Print(FILE* out);
2401 #endif 2456 #endif
2402 // Returns the key (slow). 2457 // Returns the key (slow).
2403 Object* SlowReverseLookup(Object* value); 2458 Object* SlowReverseLookup(Object* value);
2404 2459
2405 // Sets the entry to (key, value) pair. 2460 // Sets the entry to (key, value) pair.
2406 inline void SetEntry(int entry, 2461 inline void SetEntry(int entry,
2407 Object* key, 2462 Object* key,
2408 Object* value, 2463 Object* value,
2409 PropertyDetails details); 2464 PropertyDetails details);
2410 2465
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
2612 // Returns a pointer to the ByteArray object for a given data start address. 2667 // Returns a pointer to the ByteArray object for a given data start address.
2613 static inline ByteArray* FromDataStartAddress(Address address); 2668 static inline ByteArray* FromDataStartAddress(Address address);
2614 2669
2615 // Casting. 2670 // Casting.
2616 static inline ByteArray* cast(Object* obj); 2671 static inline ByteArray* cast(Object* obj);
2617 2672
2618 // Dispatched behavior. 2673 // Dispatched behavior.
2619 inline int ByteArraySize() { 2674 inline int ByteArraySize() {
2620 return SizeFor(this->length()); 2675 return SizeFor(this->length());
2621 } 2676 }
2677 #ifdef OBJECT_PRINT
2678 inline void ByteArrayPrint() {
2679 ByteArrayPrint(stdout);
2680 }
2681 void ByteArrayPrint(FILE* out);
2682 #endif
2622 #ifdef DEBUG 2683 #ifdef DEBUG
2623 void ByteArrayPrint();
2624 void ByteArrayVerify(); 2684 void ByteArrayVerify();
2625 #endif 2685 #endif
2626 2686
2627 // Layout description. 2687 // Layout description.
2628 // Length is smi tagged when it is stored. 2688 // Length is smi tagged when it is stored.
2629 static const int kLengthOffset = HeapObject::kHeaderSize; 2689 static const int kLengthOffset = HeapObject::kHeaderSize;
2630 static const int kHeaderSize = kLengthOffset + kPointerSize; 2690 static const int kHeaderSize = kLengthOffset + kPointerSize;
2631 2691
2632 static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize); 2692 static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize);
2633 2693
(...skipping 28 matching lines...) Expand all
2662 inline uint8_t get(int index); 2722 inline uint8_t get(int index);
2663 inline void set(int index, uint8_t value); 2723 inline void set(int index, uint8_t value);
2664 2724
2665 // This accessor applies the correct conversion from Smi, HeapNumber and 2725 // This accessor applies the correct conversion from Smi, HeapNumber and
2666 // undefined and clamps the converted value between 0 and 255. 2726 // undefined and clamps the converted value between 0 and 255.
2667 Object* SetValue(uint32_t index, Object* value); 2727 Object* SetValue(uint32_t index, Object* value);
2668 2728
2669 // Casting. 2729 // Casting.
2670 static inline PixelArray* cast(Object* obj); 2730 static inline PixelArray* cast(Object* obj);
2671 2731
2732 #ifdef OBJECT_PRINT
2733 inline void PixelArrayPrint() {
2734 PixelArrayPrint(stdout);
2735 }
2736 void PixelArrayPrint(FILE* out);
2737 #endif
2672 #ifdef DEBUG 2738 #ifdef DEBUG
2673 void PixelArrayPrint();
2674 void PixelArrayVerify(); 2739 void PixelArrayVerify();
2675 #endif // DEBUG 2740 #endif // DEBUG
2676 2741
2677 // Maximal acceptable length for a pixel array. 2742 // Maximal acceptable length for a pixel array.
2678 static const int kMaxLength = 0x3fffffff; 2743 static const int kMaxLength = 0x3fffffff;
2679 2744
2680 // PixelArray headers are not quadword aligned. 2745 // PixelArray headers are not quadword aligned.
2681 static const int kLengthOffset = HeapObject::kHeaderSize; 2746 static const int kLengthOffset = HeapObject::kHeaderSize;
2682 static const int kExternalPointerOffset = 2747 static const int kExternalPointerOffset =
2683 POINTER_SIZE_ALIGN(kLengthOffset + kIntSize); 2748 POINTER_SIZE_ALIGN(kLengthOffset + kIntSize);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
2734 inline int8_t get(int index); 2799 inline int8_t get(int index);
2735 inline void set(int index, int8_t value); 2800 inline void set(int index, int8_t value);
2736 2801
2737 // This accessor applies the correct conversion from Smi, HeapNumber 2802 // This accessor applies the correct conversion from Smi, HeapNumber
2738 // and undefined. 2803 // and undefined.
2739 MaybeObject* SetValue(uint32_t index, Object* value); 2804 MaybeObject* SetValue(uint32_t index, Object* value);
2740 2805
2741 // Casting. 2806 // Casting.
2742 static inline ExternalByteArray* cast(Object* obj); 2807 static inline ExternalByteArray* cast(Object* obj);
2743 2808
2809 #ifdef OBJECT_PRINT
2810 inline void ExternalByteArrayPrint() {
2811 ExternalByteArrayPrint(stdout);
2812 }
2813 void ExternalByteArrayPrint(FILE* out);
2814 #endif
2744 #ifdef DEBUG 2815 #ifdef DEBUG
2745 void ExternalByteArrayPrint();
2746 void ExternalByteArrayVerify(); 2816 void ExternalByteArrayVerify();
2747 #endif // DEBUG 2817 #endif // DEBUG
2748 2818
2749 private: 2819 private:
2750 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalByteArray); 2820 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalByteArray);
2751 }; 2821 };
2752 2822
2753 2823
2754 class ExternalUnsignedByteArray: public ExternalArray { 2824 class ExternalUnsignedByteArray: public ExternalArray {
2755 public: 2825 public:
2756 // Setter and getter. 2826 // Setter and getter.
2757 inline uint8_t get(int index); 2827 inline uint8_t get(int index);
2758 inline void set(int index, uint8_t value); 2828 inline void set(int index, uint8_t value);
2759 2829
2760 // This accessor applies the correct conversion from Smi, HeapNumber 2830 // This accessor applies the correct conversion from Smi, HeapNumber
2761 // and undefined. 2831 // and undefined.
2762 MaybeObject* SetValue(uint32_t index, Object* value); 2832 MaybeObject* SetValue(uint32_t index, Object* value);
2763 2833
2764 // Casting. 2834 // Casting.
2765 static inline ExternalUnsignedByteArray* cast(Object* obj); 2835 static inline ExternalUnsignedByteArray* cast(Object* obj);
2766 2836
2837 #ifdef OBJECT_PRINT
2838 inline void ExternalUnsignedByteArrayPrint() {
2839 ExternalUnsignedByteArrayPrint(stdout);
2840 }
2841 void ExternalUnsignedByteArrayPrint(FILE* out);
2842 #endif
2767 #ifdef DEBUG 2843 #ifdef DEBUG
2768 void ExternalUnsignedByteArrayPrint();
2769 void ExternalUnsignedByteArrayVerify(); 2844 void ExternalUnsignedByteArrayVerify();
2770 #endif // DEBUG 2845 #endif // DEBUG
2771 2846
2772 private: 2847 private:
2773 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedByteArray); 2848 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedByteArray);
2774 }; 2849 };
2775 2850
2776 2851
2777 class ExternalShortArray: public ExternalArray { 2852 class ExternalShortArray: public ExternalArray {
2778 public: 2853 public:
2779 // Setter and getter. 2854 // Setter and getter.
2780 inline int16_t get(int index); 2855 inline int16_t get(int index);
2781 inline void set(int index, int16_t value); 2856 inline void set(int index, int16_t value);
2782 2857
2783 // This accessor applies the correct conversion from Smi, HeapNumber 2858 // This accessor applies the correct conversion from Smi, HeapNumber
2784 // and undefined. 2859 // and undefined.
2785 MaybeObject* SetValue(uint32_t index, Object* value); 2860 MaybeObject* SetValue(uint32_t index, Object* value);
2786 2861
2787 // Casting. 2862 // Casting.
2788 static inline ExternalShortArray* cast(Object* obj); 2863 static inline ExternalShortArray* cast(Object* obj);
2789 2864
2865 #ifdef OBJECT_PRINT
2866 inline void ExternalShortArrayPrint() {
2867 ExternalShortArrayPrint(stdout);
2868 }
2869 void ExternalShortArrayPrint(FILE* out);
2870 #endif
2790 #ifdef DEBUG 2871 #ifdef DEBUG
2791 void ExternalShortArrayPrint();
2792 void ExternalShortArrayVerify(); 2872 void ExternalShortArrayVerify();
2793 #endif // DEBUG 2873 #endif // DEBUG
2794 2874
2795 private: 2875 private:
2796 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalShortArray); 2876 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalShortArray);
2797 }; 2877 };
2798 2878
2799 2879
2800 class ExternalUnsignedShortArray: public ExternalArray { 2880 class ExternalUnsignedShortArray: public ExternalArray {
2801 public: 2881 public:
2802 // Setter and getter. 2882 // Setter and getter.
2803 inline uint16_t get(int index); 2883 inline uint16_t get(int index);
2804 inline void set(int index, uint16_t value); 2884 inline void set(int index, uint16_t value);
2805 2885
2806 // This accessor applies the correct conversion from Smi, HeapNumber 2886 // This accessor applies the correct conversion from Smi, HeapNumber
2807 // and undefined. 2887 // and undefined.
2808 MaybeObject* SetValue(uint32_t index, Object* value); 2888 MaybeObject* SetValue(uint32_t index, Object* value);
2809 2889
2810 // Casting. 2890 // Casting.
2811 static inline ExternalUnsignedShortArray* cast(Object* obj); 2891 static inline ExternalUnsignedShortArray* cast(Object* obj);
2812 2892
2893 #ifdef OBJECT_PRINT
2894 inline void ExternalUnsignedShortArrayPrint() {
2895 ExternalUnsignedShortArrayPrint(stdout);
2896 }
2897 void ExternalUnsignedShortArrayPrint(FILE* out);
2898 #endif
2813 #ifdef DEBUG 2899 #ifdef DEBUG
2814 void ExternalUnsignedShortArrayPrint();
2815 void ExternalUnsignedShortArrayVerify(); 2900 void ExternalUnsignedShortArrayVerify();
2816 #endif // DEBUG 2901 #endif // DEBUG
2817 2902
2818 private: 2903 private:
2819 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedShortArray); 2904 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedShortArray);
2820 }; 2905 };
2821 2906
2822 2907
2823 class ExternalIntArray: public ExternalArray { 2908 class ExternalIntArray: public ExternalArray {
2824 public: 2909 public:
2825 // Setter and getter. 2910 // Setter and getter.
2826 inline int32_t get(int index); 2911 inline int32_t get(int index);
2827 inline void set(int index, int32_t value); 2912 inline void set(int index, int32_t value);
2828 2913
2829 // This accessor applies the correct conversion from Smi, HeapNumber 2914 // This accessor applies the correct conversion from Smi, HeapNumber
2830 // and undefined. 2915 // and undefined.
2831 MaybeObject* SetValue(uint32_t index, Object* value); 2916 MaybeObject* SetValue(uint32_t index, Object* value);
2832 2917
2833 // Casting. 2918 // Casting.
2834 static inline ExternalIntArray* cast(Object* obj); 2919 static inline ExternalIntArray* cast(Object* obj);
2835 2920
2921 #ifdef OBJECT_PRINT
2922 inline void ExternalIntArrayPrint() {
2923 ExternalIntArrayPrint(stdout);
2924 }
2925 void ExternalIntArrayPrint(FILE* out);
2926 #endif
2836 #ifdef DEBUG 2927 #ifdef DEBUG
2837 void ExternalIntArrayPrint();
2838 void ExternalIntArrayVerify(); 2928 void ExternalIntArrayVerify();
2839 #endif // DEBUG 2929 #endif // DEBUG
2840 2930
2841 private: 2931 private:
2842 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalIntArray); 2932 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalIntArray);
2843 }; 2933 };
2844 2934
2845 2935
2846 class ExternalUnsignedIntArray: public ExternalArray { 2936 class ExternalUnsignedIntArray: public ExternalArray {
2847 public: 2937 public:
2848 // Setter and getter. 2938 // Setter and getter.
2849 inline uint32_t get(int index); 2939 inline uint32_t get(int index);
2850 inline void set(int index, uint32_t value); 2940 inline void set(int index, uint32_t value);
2851 2941
2852 // This accessor applies the correct conversion from Smi, HeapNumber 2942 // This accessor applies the correct conversion from Smi, HeapNumber
2853 // and undefined. 2943 // and undefined.
2854 MaybeObject* SetValue(uint32_t index, Object* value); 2944 MaybeObject* SetValue(uint32_t index, Object* value);
2855 2945
2856 // Casting. 2946 // Casting.
2857 static inline ExternalUnsignedIntArray* cast(Object* obj); 2947 static inline ExternalUnsignedIntArray* cast(Object* obj);
2858 2948
2949 #ifdef OBJECT_PRINT
2950 inline void ExternalUnsignedIntArrayPrint() {
2951 ExternalUnsignedIntArrayPrint(stdout);
2952 }
2953 void ExternalUnsignedIntArrayPrint(FILE* out);
2954 #endif
2859 #ifdef DEBUG 2955 #ifdef DEBUG
2860 void ExternalUnsignedIntArrayPrint();
2861 void ExternalUnsignedIntArrayVerify(); 2956 void ExternalUnsignedIntArrayVerify();
2862 #endif // DEBUG 2957 #endif // DEBUG
2863 2958
2864 private: 2959 private:
2865 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedIntArray); 2960 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedIntArray);
2866 }; 2961 };
2867 2962
2868 2963
2869 class ExternalFloatArray: public ExternalArray { 2964 class ExternalFloatArray: public ExternalArray {
2870 public: 2965 public:
2871 // Setter and getter. 2966 // Setter and getter.
2872 inline float get(int index); 2967 inline float get(int index);
2873 inline void set(int index, float value); 2968 inline void set(int index, float value);
2874 2969
2875 // This accessor applies the correct conversion from Smi, HeapNumber 2970 // This accessor applies the correct conversion from Smi, HeapNumber
2876 // and undefined. 2971 // and undefined.
2877 MaybeObject* SetValue(uint32_t index, Object* value); 2972 MaybeObject* SetValue(uint32_t index, Object* value);
2878 2973
2879 // Casting. 2974 // Casting.
2880 static inline ExternalFloatArray* cast(Object* obj); 2975 static inline ExternalFloatArray* cast(Object* obj);
2881 2976
2977 #ifdef OBJECT_PRINT
2978 inline void ExternalFloatArrayPrint() {
2979 ExternalFloatArrayPrint(stdout);
2980 }
2981 void ExternalFloatArrayPrint(FILE* out);
2982 #endif
2882 #ifdef DEBUG 2983 #ifdef DEBUG
2883 void ExternalFloatArrayPrint();
2884 void ExternalFloatArrayVerify(); 2984 void ExternalFloatArrayVerify();
2885 #endif // DEBUG 2985 #endif // DEBUG
2886 2986
2887 private: 2987 private:
2888 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloatArray); 2988 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloatArray);
2889 }; 2989 };
2890 2990
2891 2991
2892 // DeoptimizationInputData is a fixed array used to hold the deoptimization 2992 // DeoptimizationInputData is a fixed array used to hold the deoptimization
2893 // data for code generated by the Hydrogen/Lithium compiler. It also 2993 // data for code generated by the Hydrogen/Lithium compiler. It also
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2953 return (length() - kFirstDeoptEntryIndex) / kDeoptEntrySize; 3053 return (length() - kFirstDeoptEntryIndex) / kDeoptEntrySize;
2954 } 3054 }
2955 3055
2956 // Allocates a DeoptimizationInputData. 3056 // Allocates a DeoptimizationInputData.
2957 MUST_USE_RESULT static MaybeObject* Allocate(int deopt_entry_count, 3057 MUST_USE_RESULT static MaybeObject* Allocate(int deopt_entry_count,
2958 PretenureFlag pretenure); 3058 PretenureFlag pretenure);
2959 3059
2960 // Casting. 3060 // Casting.
2961 static inline DeoptimizationInputData* cast(Object* obj); 3061 static inline DeoptimizationInputData* cast(Object* obj);
2962 3062
2963 #ifdef DEBUG 3063 #ifdef OBJECT_PRINT
2964 void DeoptimizationInputDataPrint(); 3064 void DeoptimizationInputDataPrint(FILE* out);
2965 #endif 3065 #endif
2966 3066
2967 private: 3067 private:
2968 static int IndexForEntry(int i) { 3068 static int IndexForEntry(int i) {
2969 return kFirstDeoptEntryIndex + (i * kDeoptEntrySize); 3069 return kFirstDeoptEntryIndex + (i * kDeoptEntrySize);
2970 } 3070 }
2971 3071
2972 static int LengthFor(int entry_count) { 3072 static int LengthFor(int entry_count) {
2973 return IndexForEntry(entry_count); 3073 return IndexForEntry(entry_count);
2974 } 3074 }
(...skipping 17 matching lines...) Expand all
2992 return deopt_points * 2; 3092 return deopt_points * 2;
2993 } 3093 }
2994 3094
2995 // Allocates a DeoptimizationOutputData. 3095 // Allocates a DeoptimizationOutputData.
2996 MUST_USE_RESULT static MaybeObject* Allocate(int number_of_deopt_points, 3096 MUST_USE_RESULT static MaybeObject* Allocate(int number_of_deopt_points,
2997 PretenureFlag pretenure); 3097 PretenureFlag pretenure);
2998 3098
2999 // Casting. 3099 // Casting.
3000 static inline DeoptimizationOutputData* cast(Object* obj); 3100 static inline DeoptimizationOutputData* cast(Object* obj);
3001 3101
3002 #ifdef DEBUG 3102 #ifdef OBJECT_PRINT
3003 void DeoptimizationOutputDataPrint(); 3103 void DeoptimizationOutputDataPrint(FILE* out);
3004 #endif 3104 #endif
3005 }; 3105 };
3006 3106
3007 3107
3008 // Code describes objects with on-the-fly generated machine code. 3108 // Code describes objects with on-the-fly generated machine code.
3009 class Code: public HeapObject { 3109 class Code: public HeapObject {
3010 public: 3110 public:
3011 // Opaque data type for encapsulating code flags like kind, inline 3111 // Opaque data type for encapsulating code flags like kind, inline
3012 // cache state, and arguments count. 3112 // cache state, and arguments count.
3013 // FLAGS_MIN_VALUE and FLAGS_MAX_VALUE are specified to ensure that 3113 // FLAGS_MIN_VALUE and FLAGS_MAX_VALUE are specified to ensure that
(...skipping 28 matching lines...) Expand all
3042 3142
3043 enum { 3143 enum {
3044 NUMBER_OF_KINDS = LAST_IC_KIND + 1 3144 NUMBER_OF_KINDS = LAST_IC_KIND + 1
3045 }; 3145 };
3046 3146
3047 #ifdef ENABLE_DISASSEMBLER 3147 #ifdef ENABLE_DISASSEMBLER
3048 // Printing 3148 // Printing
3049 static const char* Kind2String(Kind kind); 3149 static const char* Kind2String(Kind kind);
3050 static const char* ICState2String(InlineCacheState state); 3150 static const char* ICState2String(InlineCacheState state);
3051 static const char* PropertyType2String(PropertyType type); 3151 static const char* PropertyType2String(PropertyType type);
3052 void Disassemble(const char* name); 3152 inline void Disassemble(const char* name) {
3153 Disassemble(name, stdout);
3154 }
3155 void Disassemble(const char* name, FILE* out);
3053 #endif // ENABLE_DISASSEMBLER 3156 #endif // ENABLE_DISASSEMBLER
3054 3157
3055 // [instruction_size]: Size of the native instructions 3158 // [instruction_size]: Size of the native instructions
3056 inline int instruction_size(); 3159 inline int instruction_size();
3057 inline void set_instruction_size(int value); 3160 inline void set_instruction_size(int value);
3058 3161
3059 // [relocation_info]: Code relocation information 3162 // [relocation_info]: Code relocation information
3060 DECL_ACCESSORS(relocation_info, ByteArray) 3163 DECL_ACCESSORS(relocation_info, ByteArray)
3061 void InvalidateRelocation(); 3164 void InvalidateRelocation();
3062 3165
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
3235 3338
3236 // Casting. 3339 // Casting.
3237 static inline Code* cast(Object* obj); 3340 static inline Code* cast(Object* obj);
3238 3341
3239 // Dispatched behavior. 3342 // Dispatched behavior.
3240 int CodeSize() { return SizeFor(body_size()); } 3343 int CodeSize() { return SizeFor(body_size()); }
3241 inline void CodeIterateBody(ObjectVisitor* v); 3344 inline void CodeIterateBody(ObjectVisitor* v);
3242 3345
3243 template<typename StaticVisitor> 3346 template<typename StaticVisitor>
3244 inline void CodeIterateBody(); 3347 inline void CodeIterateBody();
3348 #ifdef OBJECT_PRINT
3349 inline void CodePrint() {
3350 CodePrint(stdout);
3351 }
3352 void CodePrint(FILE* out);
3353 #endif
3245 #ifdef DEBUG 3354 #ifdef DEBUG
3246 void CodePrint();
3247 void CodeVerify(); 3355 void CodeVerify();
3248 #endif 3356 #endif
3249 3357
3250 // Max loop nesting marker used to postpose OSR. We don't take loop 3358 // Max loop nesting marker used to postpose OSR. We don't take loop
3251 // nesting that is deeper than 5 levels into account. 3359 // nesting that is deeper than 5 levels into account.
3252 static const int kMaxLoopNestingMarker = 6; 3360 static const int kMaxLoopNestingMarker = 6;
3253 3361
3254 // Layout description. 3362 // Layout description.
3255 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; 3363 static const int kInstructionSizeOffset = HeapObject::kHeaderSize;
3256 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; 3364 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize;
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
3524 // This is undone in MarkCompactCollector::ClearNonLiveTransitions(). 3632 // This is undone in MarkCompactCollector::ClearNonLiveTransitions().
3525 void CreateBackPointers(); 3633 void CreateBackPointers();
3526 3634
3527 // Set all map transitions from this map to dead maps to null. 3635 // Set all map transitions from this map to dead maps to null.
3528 // Also, restore the original prototype on the targets of these 3636 // Also, restore the original prototype on the targets of these
3529 // transitions, so that we do not process this map again while 3637 // transitions, so that we do not process this map again while
3530 // following back pointers. 3638 // following back pointers.
3531 void ClearNonLiveTransitions(Object* real_prototype); 3639 void ClearNonLiveTransitions(Object* real_prototype);
3532 3640
3533 // Dispatched behavior. 3641 // Dispatched behavior.
3642 #ifdef OBJECT_PRINT
3643 inline void MapPrint() {
3644 MapPrint(stdout);
3645 }
3646 void MapPrint(FILE* out);
3647 #endif
3534 #ifdef DEBUG 3648 #ifdef DEBUG
3535 void MapPrint();
3536 void MapVerify(); 3649 void MapVerify();
3537 void SharedMapVerify(); 3650 void SharedMapVerify();
3538 #endif 3651 #endif
3539 3652
3540 inline int visitor_id(); 3653 inline int visitor_id();
3541 inline void set_visitor_id(int visitor_id); 3654 inline void set_visitor_id(int visitor_id);
3542 3655
3543 typedef void (*TraverseCallback)(Map* map, void* data); 3656 typedef void (*TraverseCallback)(Map* map, void* data);
3544 3657
3545 void TraverseTransitionTree(TraverseCallback callback, void* data); 3658 void TraverseTransitionTree(TraverseCallback callback, void* data);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
3681 // [eval_from_instructions_offset]: the instruction offset in the code for the 3794 // [eval_from_instructions_offset]: the instruction offset in the code for the
3682 // function from which eval was called where eval was called. 3795 // function from which eval was called where eval was called.
3683 DECL_ACCESSORS(eval_from_instructions_offset, Smi) 3796 DECL_ACCESSORS(eval_from_instructions_offset, Smi)
3684 3797
3685 static inline Script* cast(Object* obj); 3798 static inline Script* cast(Object* obj);
3686 3799
3687 // If script source is an external string, check that the underlying 3800 // If script source is an external string, check that the underlying
3688 // resource is accessible. Otherwise, always return true. 3801 // resource is accessible. Otherwise, always return true.
3689 inline bool HasValidSource(); 3802 inline bool HasValidSource();
3690 3803
3804 #ifdef OBJECT_PRINT
3805 inline void ScriptPrint() {
3806 ScriptPrint(stdout);
3807 }
3808 void ScriptPrint(FILE* out);
3809 #endif
3691 #ifdef DEBUG 3810 #ifdef DEBUG
3692 void ScriptPrint();
3693 void ScriptVerify(); 3811 void ScriptVerify();
3694 #endif 3812 #endif
3695 3813
3696 static const int kSourceOffset = HeapObject::kHeaderSize; 3814 static const int kSourceOffset = HeapObject::kHeaderSize;
3697 static const int kNameOffset = kSourceOffset + kPointerSize; 3815 static const int kNameOffset = kSourceOffset + kPointerSize;
3698 static const int kLineOffsetOffset = kNameOffset + kPointerSize; 3816 static const int kLineOffsetOffset = kNameOffset + kPointerSize;
3699 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; 3817 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize;
3700 static const int kDataOffset = kColumnOffsetOffset + kPointerSize; 3818 static const int kDataOffset = kColumnOffsetOffset + kPointerSize;
3701 static const int kContextOffset = kDataOffset + kPointerSize; 3819 static const int kContextOffset = kDataOffset + kPointerSize;
3702 static const int kWrapperOffset = kContextOffset + kPointerSize; 3820 static const int kWrapperOffset = kContextOffset + kPointerSize;
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
4045 4163
4046 // Calculate the instance size. 4164 // Calculate the instance size.
4047 int CalculateInstanceSize(); 4165 int CalculateInstanceSize();
4048 4166
4049 // Calculate the number of in-object properties. 4167 // Calculate the number of in-object properties.
4050 int CalculateInObjectProperties(); 4168 int CalculateInObjectProperties();
4051 4169
4052 // Dispatched behavior. 4170 // Dispatched behavior.
4053 // Set max_length to -1 for unlimited length. 4171 // Set max_length to -1 for unlimited length.
4054 void SourceCodePrint(StringStream* accumulator, int max_length); 4172 void SourceCodePrint(StringStream* accumulator, int max_length);
4173 #ifdef OBJECT_PRINT
4174 inline void SharedFunctionInfoPrint() {
4175 SharedFunctionInfoPrint(stdout);
4176 }
4177 void SharedFunctionInfoPrint(FILE* out);
4178 #endif
4055 #ifdef DEBUG 4179 #ifdef DEBUG
4056 void SharedFunctionInfoPrint();
4057 void SharedFunctionInfoVerify(); 4180 void SharedFunctionInfoVerify();
4058 #endif 4181 #endif
4059 4182
4060 // Casting. 4183 // Casting.
4061 static inline SharedFunctionInfo* cast(Object* obj); 4184 static inline SharedFunctionInfo* cast(Object* obj);
4062 4185
4063 // Constants. 4186 // Constants.
4064 static const int kDontAdaptArgumentsSentinel = -1; 4187 static const int kDontAdaptArgumentsSentinel = -1;
4065 4188
4066 // Layout description. 4189 // Layout description.
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
4278 Object* SetInstanceClassName(String* name); 4401 Object* SetInstanceClassName(String* name);
4279 4402
4280 // Returns if this function has been compiled to native code yet. 4403 // Returns if this function has been compiled to native code yet.
4281 inline bool is_compiled(); 4404 inline bool is_compiled();
4282 4405
4283 // [next_function_link]: Field for linking functions. This list is treated as 4406 // [next_function_link]: Field for linking functions. This list is treated as
4284 // a weak list by the GC. 4407 // a weak list by the GC.
4285 DECL_ACCESSORS(next_function_link, Object) 4408 DECL_ACCESSORS(next_function_link, Object)
4286 4409
4287 // Prints the name of the function using PrintF. 4410 // Prints the name of the function using PrintF.
4288 void PrintName(); 4411 inline void PrintName() {
4412 PrintName(stdout);
4413 }
4414 void PrintName(FILE* out);
4289 4415
4290 // Casting. 4416 // Casting.
4291 static inline JSFunction* cast(Object* obj); 4417 static inline JSFunction* cast(Object* obj);
4292 4418
4293 // Iterates the objects, including code objects indirectly referenced 4419 // Iterates the objects, including code objects indirectly referenced
4294 // through pointers to the first instruction in the code object. 4420 // through pointers to the first instruction in the code object.
4295 void JSFunctionIterateBody(int object_size, ObjectVisitor* v); 4421 void JSFunctionIterateBody(int object_size, ObjectVisitor* v);
4296 4422
4297 // Dispatched behavior. 4423 // Dispatched behavior.
4424 #ifdef OBJECT_PRINT
4425 inline void JSFunctionPrint() {
4426 JSFunctionPrint(stdout);
4427 }
4428 void JSFunctionPrint(FILE* out);
4429 #endif
4298 #ifdef DEBUG 4430 #ifdef DEBUG
4299 void JSFunctionPrint();
4300 void JSFunctionVerify(); 4431 void JSFunctionVerify();
4301 #endif 4432 #endif
4302 4433
4303 // Returns the number of allocated literals. 4434 // Returns the number of allocated literals.
4304 inline int NumberOfLiterals(); 4435 inline int NumberOfLiterals();
4305 4436
4306 // Retrieve the global context from a function's literal array. 4437 // Retrieve the global context from a function's literal array.
4307 static Context* GlobalContextFromLiterals(FixedArray* literals); 4438 static Context* GlobalContextFromLiterals(FixedArray* literals);
4308 4439
4309 // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to 4440 // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to
(...skipping 28 matching lines...) Expand all
4338 class JSGlobalProxy : public JSObject { 4469 class JSGlobalProxy : public JSObject {
4339 public: 4470 public:
4340 // [context]: the owner global context of this proxy object. 4471 // [context]: the owner global context of this proxy object.
4341 // It is null value if this object is not used by any context. 4472 // It is null value if this object is not used by any context.
4342 DECL_ACCESSORS(context, Object) 4473 DECL_ACCESSORS(context, Object)
4343 4474
4344 // Casting. 4475 // Casting.
4345 static inline JSGlobalProxy* cast(Object* obj); 4476 static inline JSGlobalProxy* cast(Object* obj);
4346 4477
4347 // Dispatched behavior. 4478 // Dispatched behavior.
4479 #ifdef OBJECT_PRINT
4480 inline void JSGlobalProxyPrint() {
4481 JSGlobalProxyPrint(stdout);
4482 }
4483 void JSGlobalProxyPrint(FILE* out);
4484 #endif
4348 #ifdef DEBUG 4485 #ifdef DEBUG
4349 void JSGlobalProxyPrint();
4350 void JSGlobalProxyVerify(); 4486 void JSGlobalProxyVerify();
4351 #endif 4487 #endif
4352 4488
4353 // Layout description. 4489 // Layout description.
4354 static const int kContextOffset = JSObject::kHeaderSize; 4490 static const int kContextOffset = JSObject::kHeaderSize;
4355 static const int kSize = kContextOffset + kPointerSize; 4491 static const int kSize = kContextOffset + kPointerSize;
4356 4492
4357 private: 4493 private:
4358 4494
4359 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalProxy); 4495 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalProxy);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
4409 4545
4410 4546
4411 // JavaScript global object. 4547 // JavaScript global object.
4412 class JSGlobalObject: public GlobalObject { 4548 class JSGlobalObject: public GlobalObject {
4413 public: 4549 public:
4414 4550
4415 // Casting. 4551 // Casting.
4416 static inline JSGlobalObject* cast(Object* obj); 4552 static inline JSGlobalObject* cast(Object* obj);
4417 4553
4418 // Dispatched behavior. 4554 // Dispatched behavior.
4555 #ifdef OBJECT_PRINT
4556 inline void JSGlobalObjectPrint() {
4557 JSGlobalObjectPrint(stdout);
4558 }
4559 void JSGlobalObjectPrint(FILE* out);
4560 #endif
4419 #ifdef DEBUG 4561 #ifdef DEBUG
4420 void JSGlobalObjectPrint();
4421 void JSGlobalObjectVerify(); 4562 void JSGlobalObjectVerify();
4422 #endif 4563 #endif
4423 4564
4424 // Layout description. 4565 // Layout description.
4425 static const int kSize = GlobalObject::kHeaderSize; 4566 static const int kSize = GlobalObject::kHeaderSize;
4426 4567
4427 private: 4568 private:
4428 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject); 4569 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject);
4429 }; 4570 };
4430 4571
4431 4572
4432 // Builtins global object which holds the runtime routines written in 4573 // Builtins global object which holds the runtime routines written in
4433 // JavaScript. 4574 // JavaScript.
4434 class JSBuiltinsObject: public GlobalObject { 4575 class JSBuiltinsObject: public GlobalObject {
4435 public: 4576 public:
4436 // Accessors for the runtime routines written in JavaScript. 4577 // Accessors for the runtime routines written in JavaScript.
4437 inline Object* javascript_builtin(Builtins::JavaScript id); 4578 inline Object* javascript_builtin(Builtins::JavaScript id);
4438 inline void set_javascript_builtin(Builtins::JavaScript id, Object* value); 4579 inline void set_javascript_builtin(Builtins::JavaScript id, Object* value);
4439 4580
4440 // Accessors for code of the runtime routines written in JavaScript. 4581 // Accessors for code of the runtime routines written in JavaScript.
4441 inline Code* javascript_builtin_code(Builtins::JavaScript id); 4582 inline Code* javascript_builtin_code(Builtins::JavaScript id);
4442 inline void set_javascript_builtin_code(Builtins::JavaScript id, Code* value); 4583 inline void set_javascript_builtin_code(Builtins::JavaScript id, Code* value);
4443 4584
4444 // Casting. 4585 // Casting.
4445 static inline JSBuiltinsObject* cast(Object* obj); 4586 static inline JSBuiltinsObject* cast(Object* obj);
4446 4587
4447 // Dispatched behavior. 4588 // Dispatched behavior.
4589 #ifdef OBJECT_PRINT
4590 inline void JSBuiltinsObjectPrint() {
4591 JSBuiltinsObjectPrint(stdout);
4592 }
4593 void JSBuiltinsObjectPrint(FILE* out);
4594 #endif
4448 #ifdef DEBUG 4595 #ifdef DEBUG
4449 void JSBuiltinsObjectPrint();
4450 void JSBuiltinsObjectVerify(); 4596 void JSBuiltinsObjectVerify();
4451 #endif 4597 #endif
4452 4598
4453 // Layout description. The size of the builtins object includes 4599 // Layout description. The size of the builtins object includes
4454 // room for two pointers per runtime routine written in javascript 4600 // room for two pointers per runtime routine written in javascript
4455 // (function and code object). 4601 // (function and code object).
4456 static const int kJSBuiltinsCount = Builtins::id_count; 4602 static const int kJSBuiltinsCount = Builtins::id_count;
4457 static const int kJSBuiltinsOffset = GlobalObject::kHeaderSize; 4603 static const int kJSBuiltinsOffset = GlobalObject::kHeaderSize;
4458 static const int kJSBuiltinsCodeOffset = 4604 static const int kJSBuiltinsCodeOffset =
4459 GlobalObject::kHeaderSize + (kJSBuiltinsCount * kPointerSize); 4605 GlobalObject::kHeaderSize + (kJSBuiltinsCount * kPointerSize);
(...skipping 16 matching lines...) Expand all
4476 // Representation for JS Wrapper objects, String, Number, Boolean, Date, etc. 4622 // Representation for JS Wrapper objects, String, Number, Boolean, Date, etc.
4477 class JSValue: public JSObject { 4623 class JSValue: public JSObject {
4478 public: 4624 public:
4479 // [value]: the object being wrapped. 4625 // [value]: the object being wrapped.
4480 DECL_ACCESSORS(value, Object) 4626 DECL_ACCESSORS(value, Object)
4481 4627
4482 // Casting. 4628 // Casting.
4483 static inline JSValue* cast(Object* obj); 4629 static inline JSValue* cast(Object* obj);
4484 4630
4485 // Dispatched behavior. 4631 // Dispatched behavior.
4632 #ifdef OBJECT_PRINT
4633 inline void JSValuePrint() {
4634 JSValuePrint(stdout);
4635 }
4636 void JSValuePrint(FILE* out);
4637 #endif
4486 #ifdef DEBUG 4638 #ifdef DEBUG
4487 void JSValuePrint();
4488 void JSValueVerify(); 4639 void JSValueVerify();
4489 #endif 4640 #endif
4490 4641
4491 // Layout description. 4642 // Layout description.
4492 static const int kValueOffset = JSObject::kHeaderSize; 4643 static const int kValueOffset = JSObject::kHeaderSize;
4493 static const int kSize = kValueOffset + kPointerSize; 4644 static const int kSize = kValueOffset + kPointerSize;
4494 4645
4495 private: 4646 private:
4496 DISALLOW_IMPLICIT_CONSTRUCTORS(JSValue); 4647 DISALLOW_IMPLICIT_CONSTRUCTORS(JSValue);
4497 }; 4648 };
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
4666 // code object is not in that cache. This index can be used to later call 4817 // code object is not in that cache. This index can be used to later call
4667 // RemoveByIndex. The cache cannot be modified between a call to GetIndex and 4818 // RemoveByIndex. The cache cannot be modified between a call to GetIndex and
4668 // RemoveByIndex. 4819 // RemoveByIndex.
4669 int GetIndex(Object* name, Code* code); 4820 int GetIndex(Object* name, Code* code);
4670 4821
4671 // Remove an object from the cache with the provided internal index. 4822 // Remove an object from the cache with the provided internal index.
4672 void RemoveByIndex(Object* name, Code* code, int index); 4823 void RemoveByIndex(Object* name, Code* code, int index);
4673 4824
4674 static inline CodeCache* cast(Object* obj); 4825 static inline CodeCache* cast(Object* obj);
4675 4826
4827 #ifdef OBJECT_PRINT
4828 inline void CodeCachePrint() {
4829 CodeCachePrint(stdout);
4830 }
4831 void CodeCachePrint(FILE* out);
4832 #endif
4676 #ifdef DEBUG 4833 #ifdef DEBUG
4677 void CodeCachePrint();
4678 void CodeCacheVerify(); 4834 void CodeCacheVerify();
4679 #endif 4835 #endif
4680 4836
4681 static const int kDefaultCacheOffset = HeapObject::kHeaderSize; 4837 static const int kDefaultCacheOffset = HeapObject::kHeaderSize;
4682 static const int kNormalTypeCacheOffset = 4838 static const int kNormalTypeCacheOffset =
4683 kDefaultCacheOffset + kPointerSize; 4839 kDefaultCacheOffset + kPointerSize;
4684 static const int kSize = kNormalTypeCacheOffset + kPointerSize; 4840 static const int kSize = kNormalTypeCacheOffset + kPointerSize;
4685 4841
4686 private: 4842 private:
4687 MUST_USE_RESULT MaybeObject* UpdateDefaultCache(String* name, Code* code); 4843 MUST_USE_RESULT MaybeObject* UpdateDefaultCache(String* name, Code* code);
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
4968 // Casting. 5124 // Casting.
4969 static inline String* cast(Object* obj); 5125 static inline String* cast(Object* obj);
4970 5126
4971 void PrintOn(FILE* out); 5127 void PrintOn(FILE* out);
4972 5128
4973 // For use during stack traces. Performs rudimentary sanity check. 5129 // For use during stack traces. Performs rudimentary sanity check.
4974 bool LooksValid(); 5130 bool LooksValid();
4975 5131
4976 // Dispatched behavior. 5132 // Dispatched behavior.
4977 void StringShortPrint(StringStream* accumulator); 5133 void StringShortPrint(StringStream* accumulator);
5134 #ifdef OBJECT_PRINT
5135 inline void StringPrint() {
5136 StringPrint(stdout);
5137 }
5138 void StringPrint(FILE* out);
5139 #endif
4978 #ifdef DEBUG 5140 #ifdef DEBUG
4979 void StringPrint();
4980 void StringVerify(); 5141 void StringVerify();
4981 #endif 5142 #endif
4982 inline bool IsFlat(); 5143 inline bool IsFlat();
4983 5144
4984 // Layout description. 5145 // Layout description.
4985 static const int kLengthOffset = HeapObject::kHeaderSize; 5146 static const int kLengthOffset = HeapObject::kHeaderSize;
4986 static const int kHashFieldOffset = kLengthOffset + kPointerSize; 5147 static const int kHashFieldOffset = kLengthOffset + kPointerSize;
4987 static const int kSize = kHashFieldOffset + kPointerSize; 5148 static const int kSize = kHashFieldOffset + kPointerSize;
4988 5149
4989 // Maximum number of characters to consider when trying to convert a string 5150 // Maximum number of characters to consider when trying to convert a string
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
5524 class JSGlobalPropertyCell: public HeapObject { 5685 class JSGlobalPropertyCell: public HeapObject {
5525 public: 5686 public:
5526 // [value]: value of the global property. 5687 // [value]: value of the global property.
5527 DECL_ACCESSORS(value, Object) 5688 DECL_ACCESSORS(value, Object)
5528 5689
5529 // Casting. 5690 // Casting.
5530 static inline JSGlobalPropertyCell* cast(Object* obj); 5691 static inline JSGlobalPropertyCell* cast(Object* obj);
5531 5692
5532 #ifdef DEBUG 5693 #ifdef DEBUG
5533 void JSGlobalPropertyCellVerify(); 5694 void JSGlobalPropertyCellVerify();
5534 void JSGlobalPropertyCellPrint(); 5695 #endif
5696 #ifdef OBJECT_PRINT
5697 inline void JSGlobalPropertyCellPrint() {
5698 JSGlobalPropertyCellPrint(stdout);
5699 }
5700 void JSGlobalPropertyCellPrint(FILE* out);
5535 #endif 5701 #endif
5536 5702
5537 // Layout description. 5703 // Layout description.
5538 static const int kValueOffset = HeapObject::kHeaderSize; 5704 static const int kValueOffset = HeapObject::kHeaderSize;
5539 static const int kSize = kValueOffset + kPointerSize; 5705 static const int kSize = kValueOffset + kPointerSize;
5540 5706
5541 typedef FixedBodyDescriptor<kValueOffset, 5707 typedef FixedBodyDescriptor<kValueOffset,
5542 kValueOffset + kPointerSize, 5708 kValueOffset + kPointerSize,
5543 kSize> BodyDescriptor; 5709 kSize> BodyDescriptor;
5544 5710
(...skipping 14 matching lines...) Expand all
5559 5725
5560 // Casting. 5726 // Casting.
5561 static inline Proxy* cast(Object* obj); 5727 static inline Proxy* cast(Object* obj);
5562 5728
5563 // Dispatched behavior. 5729 // Dispatched behavior.
5564 inline void ProxyIterateBody(ObjectVisitor* v); 5730 inline void ProxyIterateBody(ObjectVisitor* v);
5565 5731
5566 template<typename StaticVisitor> 5732 template<typename StaticVisitor>
5567 inline void ProxyIterateBody(); 5733 inline void ProxyIterateBody();
5568 5734
5735 #ifdef OBJECT_PRINT
5736 inline void ProxyPrint() {
5737 ProxyPrint(stdout);
5738 }
5739 void ProxyPrint(FILE* out);
5740 #endif
5569 #ifdef DEBUG 5741 #ifdef DEBUG
5570 void ProxyPrint();
5571 void ProxyVerify(); 5742 void ProxyVerify();
5572 #endif 5743 #endif
5573 5744
5574 // Layout description. 5745 // Layout description.
5575 5746
5576 static const int kProxyOffset = HeapObject::kHeaderSize; 5747 static const int kProxyOffset = HeapObject::kHeaderSize;
5577 static const int kSize = kProxyOffset + kPointerSize; 5748 static const int kSize = kProxyOffset + kPointerSize;
5578 5749
5579 STATIC_CHECK(kProxyOffset == Internals::kProxyProxyOffset); 5750 STATIC_CHECK(kProxyOffset == Internals::kProxyProxyOffset);
5580 5751
(...skipping 28 matching lines...) Expand all
5609 inline void SetContent(FixedArray* storage); 5780 inline void SetContent(FixedArray* storage);
5610 5781
5611 // Casting. 5782 // Casting.
5612 static inline JSArray* cast(Object* obj); 5783 static inline JSArray* cast(Object* obj);
5613 5784
5614 // Uses handles. Ensures that the fixed array backing the JSArray has at 5785 // Uses handles. Ensures that the fixed array backing the JSArray has at
5615 // least the stated size. 5786 // least the stated size.
5616 inline void EnsureSize(int minimum_size_of_backing_fixed_array); 5787 inline void EnsureSize(int minimum_size_of_backing_fixed_array);
5617 5788
5618 // Dispatched behavior. 5789 // Dispatched behavior.
5790 #ifdef OBJECT_PRINT
5791 inline void JSArrayPrint() {
5792 JSArrayPrint(stdout);
5793 }
5794 void JSArrayPrint(FILE* out);
5795 #endif
5619 #ifdef DEBUG 5796 #ifdef DEBUG
5620 void JSArrayPrint();
5621 void JSArrayVerify(); 5797 void JSArrayVerify();
5622 #endif 5798 #endif
5623 5799
5624 // Number of element slots to pre-allocate for an empty array. 5800 // Number of element slots to pre-allocate for an empty array.
5625 static const int kPreallocatedArrayElements = 4; 5801 static const int kPreallocatedArrayElements = 4;
5626 5802
5627 // Layout description. 5803 // Layout description.
5628 static const int kLengthOffset = JSObject::kHeaderSize; 5804 static const int kLengthOffset = JSObject::kHeaderSize;
5629 static const int kSize = kLengthOffset + kPointerSize; 5805 static const int kSize = kLengthOffset + kPointerSize;
5630 5806
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
5681 inline void set_all_can_write(bool value); 5857 inline void set_all_can_write(bool value);
5682 5858
5683 inline bool prohibits_overwriting(); 5859 inline bool prohibits_overwriting();
5684 inline void set_prohibits_overwriting(bool value); 5860 inline void set_prohibits_overwriting(bool value);
5685 5861
5686 inline PropertyAttributes property_attributes(); 5862 inline PropertyAttributes property_attributes();
5687 inline void set_property_attributes(PropertyAttributes attributes); 5863 inline void set_property_attributes(PropertyAttributes attributes);
5688 5864
5689 static inline AccessorInfo* cast(Object* obj); 5865 static inline AccessorInfo* cast(Object* obj);
5690 5866
5867 #ifdef OBJECT_PRINT
5868 inline void AccessorInfoPrint() {
5869 AccessorInfoPrint(stdout);
5870 }
5871 void AccessorInfoPrint(FILE* out);
5872 #endif
5691 #ifdef DEBUG 5873 #ifdef DEBUG
5692 void AccessorInfoPrint();
5693 void AccessorInfoVerify(); 5874 void AccessorInfoVerify();
5694 #endif 5875 #endif
5695 5876
5696 static const int kGetterOffset = HeapObject::kHeaderSize; 5877 static const int kGetterOffset = HeapObject::kHeaderSize;
5697 static const int kSetterOffset = kGetterOffset + kPointerSize; 5878 static const int kSetterOffset = kGetterOffset + kPointerSize;
5698 static const int kDataOffset = kSetterOffset + kPointerSize; 5879 static const int kDataOffset = kSetterOffset + kPointerSize;
5699 static const int kNameOffset = kDataOffset + kPointerSize; 5880 static const int kNameOffset = kDataOffset + kPointerSize;
5700 static const int kFlagOffset = kNameOffset + kPointerSize; 5881 static const int kFlagOffset = kNameOffset + kPointerSize;
5701 static const int kSize = kFlagOffset + kPointerSize; 5882 static const int kSize = kFlagOffset + kPointerSize;
5702 5883
5703 private: 5884 private:
5704 // Bit positions in flag. 5885 // Bit positions in flag.
5705 static const int kAllCanReadBit = 0; 5886 static const int kAllCanReadBit = 0;
5706 static const int kAllCanWriteBit = 1; 5887 static const int kAllCanWriteBit = 1;
5707 static const int kProhibitsOverwritingBit = 2; 5888 static const int kProhibitsOverwritingBit = 2;
5708 class AttributesField: public BitField<PropertyAttributes, 3, 3> {}; 5889 class AttributesField: public BitField<PropertyAttributes, 3, 3> {};
5709 5890
5710 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorInfo); 5891 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorInfo);
5711 }; 5892 };
5712 5893
5713 5894
5714 class AccessCheckInfo: public Struct { 5895 class AccessCheckInfo: public Struct {
5715 public: 5896 public:
5716 DECL_ACCESSORS(named_callback, Object) 5897 DECL_ACCESSORS(named_callback, Object)
5717 DECL_ACCESSORS(indexed_callback, Object) 5898 DECL_ACCESSORS(indexed_callback, Object)
5718 DECL_ACCESSORS(data, Object) 5899 DECL_ACCESSORS(data, Object)
5719 5900
5720 static inline AccessCheckInfo* cast(Object* obj); 5901 static inline AccessCheckInfo* cast(Object* obj);
5721 5902
5903 #ifdef OBJECT_PRINT
5904 inline void AccessCheckInfoPrint() {
5905 AccessCheckInfoPrint(stdout);
5906 }
5907 void AccessCheckInfoPrint(FILE* out);
5908 #endif
5722 #ifdef DEBUG 5909 #ifdef DEBUG
5723 void AccessCheckInfoPrint();
5724 void AccessCheckInfoVerify(); 5910 void AccessCheckInfoVerify();
5725 #endif 5911 #endif
5726 5912
5727 static const int kNamedCallbackOffset = HeapObject::kHeaderSize; 5913 static const int kNamedCallbackOffset = HeapObject::kHeaderSize;
5728 static const int kIndexedCallbackOffset = kNamedCallbackOffset + kPointerSize; 5914 static const int kIndexedCallbackOffset = kNamedCallbackOffset + kPointerSize;
5729 static const int kDataOffset = kIndexedCallbackOffset + kPointerSize; 5915 static const int kDataOffset = kIndexedCallbackOffset + kPointerSize;
5730 static const int kSize = kDataOffset + kPointerSize; 5916 static const int kSize = kDataOffset + kPointerSize;
5731 5917
5732 private: 5918 private:
5733 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessCheckInfo); 5919 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessCheckInfo);
5734 }; 5920 };
5735 5921
5736 5922
5737 class InterceptorInfo: public Struct { 5923 class InterceptorInfo: public Struct {
5738 public: 5924 public:
5739 DECL_ACCESSORS(getter, Object) 5925 DECL_ACCESSORS(getter, Object)
5740 DECL_ACCESSORS(setter, Object) 5926 DECL_ACCESSORS(setter, Object)
5741 DECL_ACCESSORS(query, Object) 5927 DECL_ACCESSORS(query, Object)
5742 DECL_ACCESSORS(deleter, Object) 5928 DECL_ACCESSORS(deleter, Object)
5743 DECL_ACCESSORS(enumerator, Object) 5929 DECL_ACCESSORS(enumerator, Object)
5744 DECL_ACCESSORS(data, Object) 5930 DECL_ACCESSORS(data, Object)
5745 5931
5746 static inline InterceptorInfo* cast(Object* obj); 5932 static inline InterceptorInfo* cast(Object* obj);
5747 5933
5934 #ifdef OBJECT_PRINT
5935 inline void InterceptorInfoPrint() {
5936 InterceptorInfoPrint(stdout);
5937 }
5938 void InterceptorInfoPrint(FILE* out);
5939 #endif
5748 #ifdef DEBUG 5940 #ifdef DEBUG
5749 void InterceptorInfoPrint();
5750 void InterceptorInfoVerify(); 5941 void InterceptorInfoVerify();
5751 #endif 5942 #endif
5752 5943
5753 static const int kGetterOffset = HeapObject::kHeaderSize; 5944 static const int kGetterOffset = HeapObject::kHeaderSize;
5754 static const int kSetterOffset = kGetterOffset + kPointerSize; 5945 static const int kSetterOffset = kGetterOffset + kPointerSize;
5755 static const int kQueryOffset = kSetterOffset + kPointerSize; 5946 static const int kQueryOffset = kSetterOffset + kPointerSize;
5756 static const int kDeleterOffset = kQueryOffset + kPointerSize; 5947 static const int kDeleterOffset = kQueryOffset + kPointerSize;
5757 static const int kEnumeratorOffset = kDeleterOffset + kPointerSize; 5948 static const int kEnumeratorOffset = kDeleterOffset + kPointerSize;
5758 static const int kDataOffset = kEnumeratorOffset + kPointerSize; 5949 static const int kDataOffset = kEnumeratorOffset + kPointerSize;
5759 static const int kSize = kDataOffset + kPointerSize; 5950 static const int kSize = kDataOffset + kPointerSize;
5760 5951
5761 private: 5952 private:
5762 DISALLOW_IMPLICIT_CONSTRUCTORS(InterceptorInfo); 5953 DISALLOW_IMPLICIT_CONSTRUCTORS(InterceptorInfo);
5763 }; 5954 };
5764 5955
5765 5956
5766 class CallHandlerInfo: public Struct { 5957 class CallHandlerInfo: public Struct {
5767 public: 5958 public:
5768 DECL_ACCESSORS(callback, Object) 5959 DECL_ACCESSORS(callback, Object)
5769 DECL_ACCESSORS(data, Object) 5960 DECL_ACCESSORS(data, Object)
5770 5961
5771 static inline CallHandlerInfo* cast(Object* obj); 5962 static inline CallHandlerInfo* cast(Object* obj);
5772 5963
5964 #ifdef OBJECT_PRINT
5965 inline void CallHandlerInfoPrint() {
5966 CallHandlerInfoPrint(stdout);
5967 }
5968 void CallHandlerInfoPrint(FILE* out);
5969 #endif
5773 #ifdef DEBUG 5970 #ifdef DEBUG
5774 void CallHandlerInfoPrint();
5775 void CallHandlerInfoVerify(); 5971 void CallHandlerInfoVerify();
5776 #endif 5972 #endif
5777 5973
5778 static const int kCallbackOffset = HeapObject::kHeaderSize; 5974 static const int kCallbackOffset = HeapObject::kHeaderSize;
5779 static const int kDataOffset = kCallbackOffset + kPointerSize; 5975 static const int kDataOffset = kCallbackOffset + kPointerSize;
5780 static const int kSize = kDataOffset + kPointerSize; 5976 static const int kSize = kDataOffset + kPointerSize;
5781 5977
5782 private: 5978 private:
5783 DISALLOW_IMPLICIT_CONSTRUCTORS(CallHandlerInfo); 5979 DISALLOW_IMPLICIT_CONSTRUCTORS(CallHandlerInfo);
5784 }; 5980 };
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
5820 6016
5821 // Following properties use flag bits. 6017 // Following properties use flag bits.
5822 DECL_BOOLEAN_ACCESSORS(hidden_prototype) 6018 DECL_BOOLEAN_ACCESSORS(hidden_prototype)
5823 DECL_BOOLEAN_ACCESSORS(undetectable) 6019 DECL_BOOLEAN_ACCESSORS(undetectable)
5824 // If the bit is set, object instances created by this function 6020 // If the bit is set, object instances created by this function
5825 // requires access check. 6021 // requires access check.
5826 DECL_BOOLEAN_ACCESSORS(needs_access_check) 6022 DECL_BOOLEAN_ACCESSORS(needs_access_check)
5827 6023
5828 static inline FunctionTemplateInfo* cast(Object* obj); 6024 static inline FunctionTemplateInfo* cast(Object* obj);
5829 6025
6026 #ifdef OBJECT_PRINT
6027 inline void FunctionTemplateInfoPrint() {
6028 FunctionTemplateInfoPrint(stdout);
6029 }
6030 void FunctionTemplateInfoPrint(FILE* out);
6031 #endif
5830 #ifdef DEBUG 6032 #ifdef DEBUG
5831 void FunctionTemplateInfoPrint();
5832 void FunctionTemplateInfoVerify(); 6033 void FunctionTemplateInfoVerify();
5833 #endif 6034 #endif
5834 6035
5835 static const int kSerialNumberOffset = TemplateInfo::kHeaderSize; 6036 static const int kSerialNumberOffset = TemplateInfo::kHeaderSize;
5836 static const int kCallCodeOffset = kSerialNumberOffset + kPointerSize; 6037 static const int kCallCodeOffset = kSerialNumberOffset + kPointerSize;
5837 static const int kPropertyAccessorsOffset = kCallCodeOffset + kPointerSize; 6038 static const int kPropertyAccessorsOffset = kCallCodeOffset + kPointerSize;
5838 static const int kPrototypeTemplateOffset = 6039 static const int kPrototypeTemplateOffset =
5839 kPropertyAccessorsOffset + kPointerSize; 6040 kPropertyAccessorsOffset + kPointerSize;
5840 static const int kParentTemplateOffset = 6041 static const int kParentTemplateOffset =
5841 kPrototypeTemplateOffset + kPointerSize; 6042 kPrototypeTemplateOffset + kPointerSize;
(...skipping 21 matching lines...) Expand all
5863 }; 6064 };
5864 6065
5865 6066
5866 class ObjectTemplateInfo: public TemplateInfo { 6067 class ObjectTemplateInfo: public TemplateInfo {
5867 public: 6068 public:
5868 DECL_ACCESSORS(constructor, Object) 6069 DECL_ACCESSORS(constructor, Object)
5869 DECL_ACCESSORS(internal_field_count, Object) 6070 DECL_ACCESSORS(internal_field_count, Object)
5870 6071
5871 static inline ObjectTemplateInfo* cast(Object* obj); 6072 static inline ObjectTemplateInfo* cast(Object* obj);
5872 6073
6074 #ifdef OBJECT_PRINT
6075 inline void ObjectTemplateInfoPrint() {
6076 ObjectTemplateInfoPrint(stdout);
6077 }
6078 void ObjectTemplateInfoPrint(FILE* out);
6079 #endif
5873 #ifdef DEBUG 6080 #ifdef DEBUG
5874 void ObjectTemplateInfoPrint();
5875 void ObjectTemplateInfoVerify(); 6081 void ObjectTemplateInfoVerify();
5876 #endif 6082 #endif
5877 6083
5878 static const int kConstructorOffset = TemplateInfo::kHeaderSize; 6084 static const int kConstructorOffset = TemplateInfo::kHeaderSize;
5879 static const int kInternalFieldCountOffset = 6085 static const int kInternalFieldCountOffset =
5880 kConstructorOffset + kPointerSize; 6086 kConstructorOffset + kPointerSize;
5881 static const int kSize = kInternalFieldCountOffset + kPointerSize; 6087 static const int kSize = kInternalFieldCountOffset + kPointerSize;
5882 }; 6088 };
5883 6089
5884 6090
5885 class SignatureInfo: public Struct { 6091 class SignatureInfo: public Struct {
5886 public: 6092 public:
5887 DECL_ACCESSORS(receiver, Object) 6093 DECL_ACCESSORS(receiver, Object)
5888 DECL_ACCESSORS(args, Object) 6094 DECL_ACCESSORS(args, Object)
5889 6095
5890 static inline SignatureInfo* cast(Object* obj); 6096 static inline SignatureInfo* cast(Object* obj);
5891 6097
6098 #ifdef OBJECT_PRINT
6099 inline void SignatureInfoPrint() {
6100 SignatureInfoPrint(stdout);
6101 }
6102 void SignatureInfoPrint(FILE* out);
6103 #endif
5892 #ifdef DEBUG 6104 #ifdef DEBUG
5893 void SignatureInfoPrint();
5894 void SignatureInfoVerify(); 6105 void SignatureInfoVerify();
5895 #endif 6106 #endif
5896 6107
5897 static const int kReceiverOffset = Struct::kHeaderSize; 6108 static const int kReceiverOffset = Struct::kHeaderSize;
5898 static const int kArgsOffset = kReceiverOffset + kPointerSize; 6109 static const int kArgsOffset = kReceiverOffset + kPointerSize;
5899 static const int kSize = kArgsOffset + kPointerSize; 6110 static const int kSize = kArgsOffset + kPointerSize;
5900 6111
5901 private: 6112 private:
5902 DISALLOW_IMPLICIT_CONSTRUCTORS(SignatureInfo); 6113 DISALLOW_IMPLICIT_CONSTRUCTORS(SignatureInfo);
5903 }; 6114 };
5904 6115
5905 6116
5906 class TypeSwitchInfo: public Struct { 6117 class TypeSwitchInfo: public Struct {
5907 public: 6118 public:
5908 DECL_ACCESSORS(types, Object) 6119 DECL_ACCESSORS(types, Object)
5909 6120
5910 static inline TypeSwitchInfo* cast(Object* obj); 6121 static inline TypeSwitchInfo* cast(Object* obj);
5911 6122
6123 #ifdef OBJECT_PRINT
6124 inline void TypeSwitchInfoPrint() {
6125 TypeSwitchInfoPrint(stdout);
6126 }
6127 void TypeSwitchInfoPrint(FILE* out);
6128 #endif
5912 #ifdef DEBUG 6129 #ifdef DEBUG
5913 void TypeSwitchInfoPrint();
5914 void TypeSwitchInfoVerify(); 6130 void TypeSwitchInfoVerify();
5915 #endif 6131 #endif
5916 6132
5917 static const int kTypesOffset = Struct::kHeaderSize; 6133 static const int kTypesOffset = Struct::kHeaderSize;
5918 static const int kSize = kTypesOffset + kPointerSize; 6134 static const int kSize = kTypesOffset + kPointerSize;
5919 }; 6135 };
5920 6136
5921 6137
5922 #ifdef ENABLE_DEBUGGER_SUPPORT 6138 #ifdef ENABLE_DEBUGGER_SUPPORT
5923 // The DebugInfo class holds additional information for a function being 6139 // The DebugInfo class holds additional information for a function being
(...skipping 25 matching lines...) Expand all
5949 // Get the break point objects for a code position. 6165 // Get the break point objects for a code position.
5950 Object* GetBreakPointObjects(int code_position); 6166 Object* GetBreakPointObjects(int code_position);
5951 // Find the break point info holding this break point object. 6167 // Find the break point info holding this break point object.
5952 static Object* FindBreakPointInfo(Handle<DebugInfo> debug_info, 6168 static Object* FindBreakPointInfo(Handle<DebugInfo> debug_info,
5953 Handle<Object> break_point_object); 6169 Handle<Object> break_point_object);
5954 // Get the number of break points for this function. 6170 // Get the number of break points for this function.
5955 int GetBreakPointCount(); 6171 int GetBreakPointCount();
5956 6172
5957 static inline DebugInfo* cast(Object* obj); 6173 static inline DebugInfo* cast(Object* obj);
5958 6174
6175 #ifdef OBJECT_PRINT
6176 inline void DebugInfoPrint() {
6177 DebugInfoPrint(stdout);
6178 }
6179 void DebugInfoPrint(FILE* out);
6180 #endif
5959 #ifdef DEBUG 6181 #ifdef DEBUG
5960 void DebugInfoPrint();
5961 void DebugInfoVerify(); 6182 void DebugInfoVerify();
5962 #endif 6183 #endif
5963 6184
5964 static const int kSharedFunctionInfoIndex = Struct::kHeaderSize; 6185 static const int kSharedFunctionInfoIndex = Struct::kHeaderSize;
5965 static const int kOriginalCodeIndex = kSharedFunctionInfoIndex + kPointerSize; 6186 static const int kOriginalCodeIndex = kSharedFunctionInfoIndex + kPointerSize;
5966 static const int kPatchedCodeIndex = kOriginalCodeIndex + kPointerSize; 6187 static const int kPatchedCodeIndex = kOriginalCodeIndex + kPointerSize;
5967 static const int kActiveBreakPointsCountIndex = 6188 static const int kActiveBreakPointsCountIndex =
5968 kPatchedCodeIndex + kPointerSize; 6189 kPatchedCodeIndex + kPointerSize;
5969 static const int kBreakPointsStateIndex = 6190 static const int kBreakPointsStateIndex =
5970 kActiveBreakPointsCountIndex + kPointerSize; 6191 kActiveBreakPointsCountIndex + kPointerSize;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
6002 static void SetBreakPoint(Handle<BreakPointInfo> info, 6223 static void SetBreakPoint(Handle<BreakPointInfo> info,
6003 Handle<Object> break_point_object); 6224 Handle<Object> break_point_object);
6004 // Check if break point info has this break point object. 6225 // Check if break point info has this break point object.
6005 static bool HasBreakPointObject(Handle<BreakPointInfo> info, 6226 static bool HasBreakPointObject(Handle<BreakPointInfo> info,
6006 Handle<Object> break_point_object); 6227 Handle<Object> break_point_object);
6007 // Get the number of break points for this code position. 6228 // Get the number of break points for this code position.
6008 int GetBreakPointCount(); 6229 int GetBreakPointCount();
6009 6230
6010 static inline BreakPointInfo* cast(Object* obj); 6231 static inline BreakPointInfo* cast(Object* obj);
6011 6232
6233 #ifdef OBJECT_PRINT
6234 inline void BreakPointInfoPrint() {
6235 BreakPointInfoPrint(stdout);
6236 }
6237 void BreakPointInfoPrint(FILE* out);
6238 #endif
6012 #ifdef DEBUG 6239 #ifdef DEBUG
6013 void BreakPointInfoPrint();
6014 void BreakPointInfoVerify(); 6240 void BreakPointInfoVerify();
6015 #endif 6241 #endif
6016 6242
6017 static const int kCodePositionIndex = Struct::kHeaderSize; 6243 static const int kCodePositionIndex = Struct::kHeaderSize;
6018 static const int kSourcePositionIndex = kCodePositionIndex + kPointerSize; 6244 static const int kSourcePositionIndex = kCodePositionIndex + kPointerSize;
6019 static const int kStatementPositionIndex = 6245 static const int kStatementPositionIndex =
6020 kSourcePositionIndex + kPointerSize; 6246 kSourcePositionIndex + kPointerSize;
6021 static const int kBreakPointObjectsIndex = 6247 static const int kBreakPointObjectsIndex =
6022 kStatementPositionIndex + kPointerSize; 6248 kStatementPositionIndex + kPointerSize;
6023 static const int kSize = kBreakPointObjectsIndex + kPointerSize; 6249 static const int kSize = kBreakPointObjectsIndex + kPointerSize;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
6119 } else { 6345 } else {
6120 value &= ~(1 << bit_position); 6346 value &= ~(1 << bit_position);
6121 } 6347 }
6122 return value; 6348 return value;
6123 } 6349 }
6124 }; 6350 };
6125 6351
6126 } } // namespace v8::internal 6352 } } // namespace v8::internal
6127 6353
6128 #endif // V8_OBJECTS_H_ 6354 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698