OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 12 matching lines...) Expand all Loading... |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_OBJECTS_H_ | 28 #ifndef V8_OBJECTS_H_ |
29 #define V8_OBJECTS_H_ | 29 #define V8_OBJECTS_H_ |
30 | 30 |
31 #include "allocation.h" | 31 #include "allocation.h" |
32 #include "builtins.h" | 32 #include "builtins.h" |
33 #include "elements-kind.h" | |
34 #include "list.h" | 33 #include "list.h" |
35 #include "property-details.h" | 34 #include "property-details.h" |
36 #include "smart-array-pointer.h" | 35 #include "smart-array-pointer.h" |
37 #include "unicode-inl.h" | 36 #include "unicode-inl.h" |
38 #if V8_TARGET_ARCH_ARM | 37 #if V8_TARGET_ARCH_ARM |
39 #include "arm/constants-arm.h" | 38 #include "arm/constants-arm.h" |
40 #elif V8_TARGET_ARCH_MIPS | 39 #elif V8_TARGET_ARCH_MIPS |
41 #include "mips/constants-mips.h" | 40 #include "mips/constants-mips.h" |
42 #endif | 41 #endif |
43 #include "v8checks.h" | 42 #include "v8checks.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // - CodeCache | 124 // - CodeCache |
126 // | 125 // |
127 // Formats of Object*: | 126 // Formats of Object*: |
128 // Smi: [31 bit signed int] 0 | 127 // Smi: [31 bit signed int] 0 |
129 // HeapObject: [32 bit direct pointer] (4 byte aligned) | 01 | 128 // HeapObject: [32 bit direct pointer] (4 byte aligned) | 01 |
130 // Failure: [30 bit signed int] 11 | 129 // Failure: [30 bit signed int] 11 |
131 | 130 |
132 namespace v8 { | 131 namespace v8 { |
133 namespace internal { | 132 namespace internal { |
134 | 133 |
| 134 enum ElementsKind { |
| 135 // The "fast" kind for elements that only contain SMI values. Must be first |
| 136 // to make it possible to efficiently check maps for this kind. |
| 137 FAST_SMI_ONLY_ELEMENTS, |
| 138 |
| 139 // The "fast" kind for tagged values. Must be second to make it possible to |
| 140 // efficiently check maps for this and the FAST_SMI_ONLY_ELEMENTS kind |
| 141 // together at once. |
| 142 FAST_ELEMENTS, |
| 143 |
| 144 // The "fast" kind for unwrapped, non-tagged double values. |
| 145 FAST_DOUBLE_ELEMENTS, |
| 146 |
| 147 // The "slow" kind. |
| 148 DICTIONARY_ELEMENTS, |
| 149 NON_STRICT_ARGUMENTS_ELEMENTS, |
| 150 // The "fast" kind for external arrays |
| 151 EXTERNAL_BYTE_ELEMENTS, |
| 152 EXTERNAL_UNSIGNED_BYTE_ELEMENTS, |
| 153 EXTERNAL_SHORT_ELEMENTS, |
| 154 EXTERNAL_UNSIGNED_SHORT_ELEMENTS, |
| 155 EXTERNAL_INT_ELEMENTS, |
| 156 EXTERNAL_UNSIGNED_INT_ELEMENTS, |
| 157 EXTERNAL_FLOAT_ELEMENTS, |
| 158 EXTERNAL_DOUBLE_ELEMENTS, |
| 159 EXTERNAL_PIXEL_ELEMENTS, |
| 160 |
| 161 // Derived constants from ElementsKind |
| 162 FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_BYTE_ELEMENTS, |
| 163 LAST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS, |
| 164 FIRST_ELEMENTS_KIND = FAST_SMI_ONLY_ELEMENTS, |
| 165 LAST_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS |
| 166 }; |
| 167 |
135 enum CompareMapMode { | 168 enum CompareMapMode { |
136 REQUIRE_EXACT_MAP, | 169 REQUIRE_EXACT_MAP, |
137 ALLOW_ELEMENT_TRANSITION_MAPS | 170 ALLOW_ELEMENT_TRANSITION_MAPS |
138 }; | 171 }; |
139 | 172 |
140 enum KeyedAccessGrowMode { | 173 enum KeyedAccessGrowMode { |
141 DO_NOT_ALLOW_JSARRAY_GROWTH, | 174 DO_NOT_ALLOW_JSARRAY_GROWTH, |
142 ALLOW_JSARRAY_GROWTH | 175 ALLOW_JSARRAY_GROWTH |
143 }; | 176 }; |
144 | 177 |
| 178 const int kElementsKindCount = LAST_ELEMENTS_KIND - FIRST_ELEMENTS_KIND + 1; |
| 179 |
| 180 void PrintElementsKind(FILE* out, ElementsKind kind); |
| 181 |
| 182 inline bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, |
| 183 ElementsKind to_kind); |
| 184 |
145 // Setter that skips the write barrier if mode is SKIP_WRITE_BARRIER. | 185 // Setter that skips the write barrier if mode is SKIP_WRITE_BARRIER. |
146 enum WriteBarrierMode { SKIP_WRITE_BARRIER, UPDATE_WRITE_BARRIER }; | 186 enum WriteBarrierMode { SKIP_WRITE_BARRIER, UPDATE_WRITE_BARRIER }; |
147 | 187 |
148 | 188 |
149 // PropertyNormalizationMode is used to specify whether to keep | 189 // PropertyNormalizationMode is used to specify whether to keep |
150 // inobject properties when normalizing properties of a JSObject. | 190 // inobject properties when normalizing properties of a JSObject. |
151 enum PropertyNormalizationMode { | 191 enum PropertyNormalizationMode { |
152 CLEAR_INOBJECT_PROPERTIES, | 192 CLEAR_INOBJECT_PROPERTIES, |
153 KEEP_INOBJECT_PROPERTIES | 193 KEEP_INOBJECT_PROPERTIES |
154 }; | 194 }; |
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1462 // EnsureWritableFastElements in this case. | 1502 // EnsureWritableFastElements in this case. |
1463 // | 1503 // |
1464 // In the slow mode the elements is either a NumberDictionary, an | 1504 // In the slow mode the elements is either a NumberDictionary, an |
1465 // ExternalArray, or a FixedArray parameter map for a (non-strict) | 1505 // ExternalArray, or a FixedArray parameter map for a (non-strict) |
1466 // arguments object. | 1506 // arguments object. |
1467 DECL_ACCESSORS(elements, FixedArrayBase) | 1507 DECL_ACCESSORS(elements, FixedArrayBase) |
1468 inline void initialize_elements(); | 1508 inline void initialize_elements(); |
1469 MUST_USE_RESULT inline MaybeObject* ResetElements(); | 1509 MUST_USE_RESULT inline MaybeObject* ResetElements(); |
1470 inline ElementsKind GetElementsKind(); | 1510 inline ElementsKind GetElementsKind(); |
1471 inline ElementsAccessor* GetElementsAccessor(); | 1511 inline ElementsAccessor* GetElementsAccessor(); |
1472 // Returns true if an object has elements of FAST_SMI_ELEMENTS ElementsKind. | 1512 inline bool HasFastSmiOnlyElements(); |
1473 inline bool HasFastSmiElements(); | 1513 inline bool HasFastElements(); |
1474 // Returns true if an object has elements of FAST_ELEMENTS ElementsKind. | 1514 // Returns if an object has either FAST_ELEMENT or FAST_SMI_ONLY_ELEMENT |
1475 inline bool HasFastObjectElements(); | 1515 // elements. TODO(danno): Rename HasFastTypeElements to HasFastElements() and |
1476 // Returns true if an object has elements of FAST_ELEMENTS or | 1516 // HasFastElements to HasFastObjectElements. |
1477 // FAST_SMI_ONLY_ELEMENTS. | 1517 inline bool HasFastTypeElements(); |
1478 inline bool HasFastSmiOrObjectElements(); | |
1479 // Returns true if an object has elements of FAST_DOUBLE_ELEMENTS | |
1480 // ElementsKind. | |
1481 inline bool HasFastDoubleElements(); | 1518 inline bool HasFastDoubleElements(); |
1482 // Returns true if an object has elements of FAST_HOLEY_*_ELEMENTS | |
1483 // ElementsKind. | |
1484 inline bool HasFastHoleyElements(); | |
1485 inline bool HasNonStrictArgumentsElements(); | 1519 inline bool HasNonStrictArgumentsElements(); |
1486 inline bool HasDictionaryElements(); | 1520 inline bool HasDictionaryElements(); |
1487 inline bool HasExternalPixelElements(); | 1521 inline bool HasExternalPixelElements(); |
1488 inline bool HasExternalArrayElements(); | 1522 inline bool HasExternalArrayElements(); |
1489 inline bool HasExternalByteElements(); | 1523 inline bool HasExternalByteElements(); |
1490 inline bool HasExternalUnsignedByteElements(); | 1524 inline bool HasExternalUnsignedByteElements(); |
1491 inline bool HasExternalShortElements(); | 1525 inline bool HasExternalShortElements(); |
1492 inline bool HasExternalUnsignedShortElements(); | 1526 inline bool HasExternalUnsignedShortElements(); |
1493 inline bool HasExternalIntElements(); | 1527 inline bool HasExternalIntElements(); |
1494 inline bool HasExternalUnsignedIntElements(); | 1528 inline bool HasExternalUnsignedIntElements(); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1669 MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); | 1703 MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); |
1670 MUST_USE_RESULT MaybeObject* SetIdentityHash(Object* hash, CreationFlag flag); | 1704 MUST_USE_RESULT MaybeObject* SetIdentityHash(Object* hash, CreationFlag flag); |
1671 | 1705 |
1672 static Handle<Object> DeleteProperty(Handle<JSObject> obj, | 1706 static Handle<Object> DeleteProperty(Handle<JSObject> obj, |
1673 Handle<String> name); | 1707 Handle<String> name); |
1674 MUST_USE_RESULT MaybeObject* DeleteProperty(String* name, DeleteMode mode); | 1708 MUST_USE_RESULT MaybeObject* DeleteProperty(String* name, DeleteMode mode); |
1675 | 1709 |
1676 static Handle<Object> DeleteElement(Handle<JSObject> obj, uint32_t index); | 1710 static Handle<Object> DeleteElement(Handle<JSObject> obj, uint32_t index); |
1677 MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode); | 1711 MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode); |
1678 | 1712 |
1679 inline void ValidateElements(); | 1713 inline void ValidateSmiOnlyElements(); |
1680 | 1714 |
1681 // Makes sure that this object can contain HeapObject as elements. | 1715 // Makes sure that this object can contain HeapObject as elements. |
1682 MUST_USE_RESULT inline MaybeObject* EnsureCanContainHeapObjectElements(); | 1716 MUST_USE_RESULT inline MaybeObject* EnsureCanContainHeapObjectElements(); |
1683 | 1717 |
1684 // Makes sure that this object can contain the specified elements. | 1718 // Makes sure that this object can contain the specified elements. |
1685 MUST_USE_RESULT inline MaybeObject* EnsureCanContainElements( | 1719 MUST_USE_RESULT inline MaybeObject* EnsureCanContainElements( |
1686 Object** elements, | 1720 Object** elements, |
1687 uint32_t count, | 1721 uint32_t count, |
1688 EnsureElementsMode mode); | 1722 EnsureElementsMode mode); |
1689 MUST_USE_RESULT inline MaybeObject* EnsureCanContainElements( | 1723 MUST_USE_RESULT inline MaybeObject* EnsureCanContainElements( |
1690 FixedArrayBase* elements, | 1724 FixedArrayBase* elements, |
1691 uint32_t length, | |
1692 EnsureElementsMode mode); | 1725 EnsureElementsMode mode); |
1693 MUST_USE_RESULT MaybeObject* EnsureCanContainElements( | 1726 MUST_USE_RESULT MaybeObject* EnsureCanContainElements( |
1694 Arguments* arguments, | 1727 Arguments* arguments, |
1695 uint32_t first_arg, | 1728 uint32_t first_arg, |
1696 uint32_t arg_count, | 1729 uint32_t arg_count, |
1697 EnsureElementsMode mode); | 1730 EnsureElementsMode mode); |
1698 | 1731 |
1699 // Do we want to keep the elements in fast case when increasing the | 1732 // Do we want to keep the elements in fast case when increasing the |
1700 // capacity? | 1733 // capacity? |
1701 bool ShouldConvertToSlowElements(int new_capacity); | 1734 bool ShouldConvertToSlowElements(int new_capacity); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1780 PropertyAttributes attributes, | 1813 PropertyAttributes attributes, |
1781 StrictModeFlag strict_mode, | 1814 StrictModeFlag strict_mode, |
1782 bool check_prototype = true, | 1815 bool check_prototype = true, |
1783 SetPropertyMode set_mode = SET_PROPERTY); | 1816 SetPropertyMode set_mode = SET_PROPERTY); |
1784 | 1817 |
1785 // Returns the index'th element. | 1818 // Returns the index'th element. |
1786 // The undefined object if index is out of bounds. | 1819 // The undefined object if index is out of bounds. |
1787 MUST_USE_RESULT MaybeObject* GetElementWithInterceptor(Object* receiver, | 1820 MUST_USE_RESULT MaybeObject* GetElementWithInterceptor(Object* receiver, |
1788 uint32_t index); | 1821 uint32_t index); |
1789 | 1822 |
1790 enum SetFastElementsCapacitySmiMode { | 1823 enum SetFastElementsCapacityMode { |
1791 kAllowSmiElements, | 1824 kAllowSmiOnlyElements, |
1792 kForceSmiElements, | 1825 kForceSmiOnlyElements, |
1793 kDontAllowSmiElements | 1826 kDontAllowSmiOnlyElements |
1794 }; | 1827 }; |
1795 | 1828 |
1796 // Replace the elements' backing store with fast elements of the given | 1829 // Replace the elements' backing store with fast elements of the given |
1797 // capacity. Update the length for JSArrays. Returns the new backing | 1830 // capacity. Update the length for JSArrays. Returns the new backing |
1798 // store. | 1831 // store. |
1799 MUST_USE_RESULT MaybeObject* SetFastElementsCapacityAndLength( | 1832 MUST_USE_RESULT MaybeObject* SetFastElementsCapacityAndLength( |
1800 int capacity, | 1833 int capacity, |
1801 int length, | 1834 int length, |
1802 SetFastElementsCapacitySmiMode smi_mode); | 1835 SetFastElementsCapacityMode set_capacity_mode); |
1803 MUST_USE_RESULT MaybeObject* SetFastDoubleElementsCapacityAndLength( | 1836 MUST_USE_RESULT MaybeObject* SetFastDoubleElementsCapacityAndLength( |
1804 int capacity, | 1837 int capacity, |
1805 int length); | 1838 int length); |
1806 | 1839 |
1807 // Lookup interceptors are used for handling properties controlled by host | 1840 // Lookup interceptors are used for handling properties controlled by host |
1808 // objects. | 1841 // objects. |
1809 inline bool HasNamedInterceptor(); | 1842 inline bool HasNamedInterceptor(); |
1810 inline bool HasIndexedInterceptor(); | 1843 inline bool HasIndexedInterceptor(); |
1811 | 1844 |
1812 // Support functions for v8 api (needed for correct interceptor behavior). | 1845 // Support functions for v8 api (needed for correct interceptor behavior). |
(...skipping 2785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4598 (elements_kind << kElementsKindShift)); | 4631 (elements_kind << kElementsKindShift)); |
4599 ASSERT(this->elements_kind() == elements_kind); | 4632 ASSERT(this->elements_kind() == elements_kind); |
4600 } | 4633 } |
4601 | 4634 |
4602 inline ElementsKind elements_kind() { | 4635 inline ElementsKind elements_kind() { |
4603 return static_cast<ElementsKind>( | 4636 return static_cast<ElementsKind>( |
4604 (bit_field2() & kElementsKindMask) >> kElementsKindShift); | 4637 (bit_field2() & kElementsKindMask) >> kElementsKindShift); |
4605 } | 4638 } |
4606 | 4639 |
4607 // Tells whether the instance has fast elements that are only Smis. | 4640 // Tells whether the instance has fast elements that are only Smis. |
4608 inline bool has_fast_smi_elements() { | 4641 inline bool has_fast_smi_only_elements() { |
4609 return IsFastSmiElementsKind(elements_kind()); | 4642 return elements_kind() == FAST_SMI_ONLY_ELEMENTS; |
4610 } | 4643 } |
4611 | 4644 |
4612 // Tells whether the instance has fast elements. | 4645 // Tells whether the instance has fast elements. |
4613 inline bool has_fast_object_elements() { | 4646 inline bool has_fast_elements() { |
4614 return IsFastObjectElementsKind(elements_kind()); | 4647 return elements_kind() == FAST_ELEMENTS; |
4615 } | |
4616 | |
4617 inline bool has_fast_smi_or_object_elements() { | |
4618 return IsFastSmiOrObjectElementsKind(elements_kind()); | |
4619 } | 4648 } |
4620 | 4649 |
4621 inline bool has_fast_double_elements() { | 4650 inline bool has_fast_double_elements() { |
4622 return IsFastDoubleElementsKind(elements_kind()); | 4651 return elements_kind() == FAST_DOUBLE_ELEMENTS; |
4623 } | 4652 } |
4624 | 4653 |
4625 inline bool has_non_strict_arguments_elements() { | 4654 inline bool has_non_strict_arguments_elements() { |
4626 return elements_kind() == NON_STRICT_ARGUMENTS_ELEMENTS; | 4655 return elements_kind() == NON_STRICT_ARGUMENTS_ELEMENTS; |
4627 } | 4656 } |
4628 | 4657 |
4629 inline bool has_external_array_elements() { | 4658 inline bool has_external_array_elements() { |
4630 ElementsKind kind(elements_kind()); | 4659 ElementsKind kind(elements_kind()); |
4631 return kind >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND && | 4660 return kind >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND && |
4632 kind <= LAST_EXTERNAL_ARRAY_ELEMENTS_KIND; | 4661 kind <= LAST_EXTERNAL_ARRAY_ELEMENTS_KIND; |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4908 static const int kHasNonInstancePrototype = 1; | 4937 static const int kHasNonInstancePrototype = 1; |
4909 static const int kIsHiddenPrototype = 2; | 4938 static const int kIsHiddenPrototype = 2; |
4910 static const int kHasNamedInterceptor = 3; | 4939 static const int kHasNamedInterceptor = 3; |
4911 static const int kHasIndexedInterceptor = 4; | 4940 static const int kHasIndexedInterceptor = 4; |
4912 static const int kIsUndetectable = 5; | 4941 static const int kIsUndetectable = 5; |
4913 static const int kHasInstanceCallHandler = 6; | 4942 static const int kHasInstanceCallHandler = 6; |
4914 static const int kIsAccessCheckNeeded = 7; | 4943 static const int kIsAccessCheckNeeded = 7; |
4915 | 4944 |
4916 // Bit positions for bit field 2 | 4945 // Bit positions for bit field 2 |
4917 static const int kIsExtensible = 0; | 4946 static const int kIsExtensible = 0; |
4918 static const int kStringWrapperSafeForDefaultValueOf = 1; | 4947 static const int kFunctionWithPrototype = 1; |
4919 static const int kAttachedToSharedFunctionInfo = 2; | 4948 static const int kStringWrapperSafeForDefaultValueOf = 2; |
| 4949 static const int kAttachedToSharedFunctionInfo = 3; |
4920 // No bits can be used after kElementsKindFirstBit, they are all reserved for | 4950 // No bits can be used after kElementsKindFirstBit, they are all reserved for |
4921 // storing ElementKind. | 4951 // storing ElementKind. |
4922 static const int kElementsKindShift = 3; | 4952 static const int kElementsKindShift = 4; |
4923 static const int kElementsKindBitCount = 5; | 4953 static const int kElementsKindBitCount = 4; |
4924 | 4954 |
4925 // Derived values from bit field 2 | 4955 // Derived values from bit field 2 |
4926 static const int kElementsKindMask = (-1 << kElementsKindShift) & | 4956 static const int kElementsKindMask = (-1 << kElementsKindShift) & |
4927 ((1 << (kElementsKindShift + kElementsKindBitCount)) - 1); | 4957 ((1 << (kElementsKindShift + kElementsKindBitCount)) - 1); |
4928 static const int8_t kMaximumBitField2FastElementValue = static_cast<int8_t>( | 4958 static const int8_t kMaximumBitField2FastElementValue = static_cast<int8_t>( |
4929 (FAST_ELEMENTS + 1) << Map::kElementsKindShift) - 1; | 4959 (FAST_ELEMENTS + 1) << Map::kElementsKindShift) - 1; |
4930 static const int8_t kMaximumBitField2FastSmiElementValue = | 4960 static const int8_t kMaximumBitField2FastSmiOnlyElementValue = |
4931 static_cast<int8_t>((FAST_SMI_ELEMENTS + 1) << | 4961 static_cast<int8_t>((FAST_SMI_ONLY_ELEMENTS + 1) << |
4932 Map::kElementsKindShift) - 1; | |
4933 static const int8_t kMaximumBitField2FastHoleyElementValue = | |
4934 static_cast<int8_t>((FAST_HOLEY_ELEMENTS + 1) << | |
4935 Map::kElementsKindShift) - 1; | |
4936 static const int8_t kMaximumBitField2FastHoleySmiElementValue = | |
4937 static_cast<int8_t>((FAST_HOLEY_SMI_ELEMENTS + 1) << | |
4938 Map::kElementsKindShift) - 1; | 4962 Map::kElementsKindShift) - 1; |
4939 | 4963 |
4940 // Bit positions for bit field 3 | 4964 // Bit positions for bit field 3 |
4941 static const int kIsShared = 0; | 4965 static const int kIsShared = 0; |
4942 static const int kFunctionWithPrototype = 1; | |
4943 | 4966 |
4944 // Layout of the default cache. It holds alternating name and code objects. | 4967 // Layout of the default cache. It holds alternating name and code objects. |
4945 static const int kCodeCacheEntrySize = 2; | 4968 static const int kCodeCacheEntrySize = 2; |
4946 static const int kCodeCacheEntryNameOffset = 0; | 4969 static const int kCodeCacheEntryNameOffset = 0; |
4947 static const int kCodeCacheEntryCodeOffset = 1; | 4970 static const int kCodeCacheEntryCodeOffset = 1; |
4948 | 4971 |
4949 typedef FixedBodyDescriptor<kPointerFieldsBeginOffset, | 4972 typedef FixedBodyDescriptor<kPointerFieldsBeginOffset, |
4950 kPointerFieldsEndOffset, | 4973 kPointerFieldsEndOffset, |
4951 kSize> BodyDescriptor; | 4974 kSize> BodyDescriptor; |
4952 | 4975 |
(...skipping 3675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8628 } else { | 8651 } else { |
8629 value &= ~(1 << bit_position); | 8652 value &= ~(1 << bit_position); |
8630 } | 8653 } |
8631 return value; | 8654 return value; |
8632 } | 8655 } |
8633 }; | 8656 }; |
8634 | 8657 |
8635 } } // namespace v8::internal | 8658 } } // namespace v8::internal |
8636 | 8659 |
8637 #endif // V8_OBJECTS_H_ | 8660 #endif // V8_OBJECTS_H_ |
OLD | NEW |