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