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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 return IsSmi() || IsHeapNumber(); | 323 return IsSmi() || IsHeapNumber(); |
324 } | 324 } |
325 | 325 |
326 | 326 |
327 bool Object::IsByteArray() { | 327 bool Object::IsByteArray() { |
328 return Object::IsHeapObject() | 328 return Object::IsHeapObject() |
329 && HeapObject::cast(this)->map()->instance_type() == BYTE_ARRAY_TYPE; | 329 && HeapObject::cast(this)->map()->instance_type() == BYTE_ARRAY_TYPE; |
330 } | 330 } |
331 | 331 |
332 | 332 |
333 bool Object::IsPixelArray() { | 333 bool Object::IsExternalPixelArray() { |
334 return Object::IsHeapObject() && | 334 return Object::IsHeapObject() && |
335 HeapObject::cast(this)->map()->instance_type() == PIXEL_ARRAY_TYPE; | 335 HeapObject::cast(this)->map()->instance_type() == |
336 EXTERNAL_PIXEL_ARRAY_TYPE; | |
336 } | 337 } |
337 | 338 |
338 | 339 |
339 bool Object::IsExternalArray() { | 340 bool Object::IsExternalArray() { |
340 if (!Object::IsHeapObject()) | 341 if (!Object::IsHeapObject()) |
341 return false; | 342 return false; |
342 InstanceType instance_type = | 343 InstanceType instance_type = |
343 HeapObject::cast(this)->map()->instance_type(); | 344 HeapObject::cast(this)->map()->instance_type(); |
344 return (instance_type >= FIRST_EXTERNAL_ARRAY_TYPE && | 345 return (instance_type >= FIRST_EXTERNAL_ARRAY_TYPE && |
345 instance_type <= LAST_EXTERNAL_ARRAY_TYPE); | 346 instance_type <= LAST_EXTERNAL_ARRAY_TYPE); |
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1208 return READ_INT_FIELD(this, kExponentOffset) & kSignMask; | 1209 return READ_INT_FIELD(this, kExponentOffset) & kSignMask; |
1209 } | 1210 } |
1210 | 1211 |
1211 | 1212 |
1212 ACCESSORS(JSObject, properties, FixedArray, kPropertiesOffset) | 1213 ACCESSORS(JSObject, properties, FixedArray, kPropertiesOffset) |
1213 | 1214 |
1214 | 1215 |
1215 HeapObject* JSObject::elements() { | 1216 HeapObject* JSObject::elements() { |
1216 Object* array = READ_FIELD(this, kElementsOffset); | 1217 Object* array = READ_FIELD(this, kElementsOffset); |
1217 // In the assert below Dictionary is covered under FixedArray. | 1218 // In the assert below Dictionary is covered under FixedArray. |
1218 ASSERT(array->IsFixedArray() || array->IsPixelArray() || | 1219 ASSERT(array->IsFixedArray() || array->IsExternalArray()); |
1219 array->IsExternalArray()); | |
1220 return reinterpret_cast<HeapObject*>(array); | 1220 return reinterpret_cast<HeapObject*>(array); |
1221 } | 1221 } |
1222 | 1222 |
1223 | 1223 |
1224 void JSObject::set_elements(HeapObject* value, WriteBarrierMode mode) { | 1224 void JSObject::set_elements(HeapObject* value, WriteBarrierMode mode) { |
1225 ASSERT(map()->has_fast_elements() == | 1225 ASSERT(map()->has_fast_elements() == |
1226 (value->map() == Heap::fixed_array_map() || | 1226 (value->map() == Heap::fixed_array_map() || |
1227 value->map() == Heap::fixed_cow_array_map())); | 1227 value->map() == Heap::fixed_cow_array_map())); |
1228 // In the assert below Dictionary is covered under FixedArray. | 1228 // In the assert below Dictionary is covered under FixedArray. |
1229 ASSERT(value->IsFixedArray() || value->IsPixelArray() || | 1229 ASSERT(value->IsFixedArray() || value->IsExternalArray()); |
1230 value->IsExternalArray()); | |
1231 WRITE_FIELD(this, kElementsOffset, value); | 1230 WRITE_FIELD(this, kElementsOffset, value); |
1232 CONDITIONAL_WRITE_BARRIER(this, kElementsOffset, mode); | 1231 CONDITIONAL_WRITE_BARRIER(this, kElementsOffset, mode); |
1233 } | 1232 } |
1234 | 1233 |
1235 | 1234 |
1236 void JSObject::initialize_properties() { | 1235 void JSObject::initialize_properties() { |
1237 ASSERT(!Heap::InNewSpace(Heap::empty_fixed_array())); | 1236 ASSERT(!Heap::InNewSpace(Heap::empty_fixed_array())); |
1238 WRITE_FIELD(this, kPropertiesOffset, Heap::empty_fixed_array()); | 1237 WRITE_FIELD(this, kPropertiesOffset, Heap::empty_fixed_array()); |
1239 } | 1238 } |
1240 | 1239 |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1753 CAST_ACCESSOR(JSFunction) | 1752 CAST_ACCESSOR(JSFunction) |
1754 CAST_ACCESSOR(GlobalObject) | 1753 CAST_ACCESSOR(GlobalObject) |
1755 CAST_ACCESSOR(JSGlobalProxy) | 1754 CAST_ACCESSOR(JSGlobalProxy) |
1756 CAST_ACCESSOR(JSGlobalObject) | 1755 CAST_ACCESSOR(JSGlobalObject) |
1757 CAST_ACCESSOR(JSBuiltinsObject) | 1756 CAST_ACCESSOR(JSBuiltinsObject) |
1758 CAST_ACCESSOR(Code) | 1757 CAST_ACCESSOR(Code) |
1759 CAST_ACCESSOR(JSArray) | 1758 CAST_ACCESSOR(JSArray) |
1760 CAST_ACCESSOR(JSRegExp) | 1759 CAST_ACCESSOR(JSRegExp) |
1761 CAST_ACCESSOR(Proxy) | 1760 CAST_ACCESSOR(Proxy) |
1762 CAST_ACCESSOR(ByteArray) | 1761 CAST_ACCESSOR(ByteArray) |
1763 CAST_ACCESSOR(PixelArray) | |
1764 CAST_ACCESSOR(ExternalArray) | 1762 CAST_ACCESSOR(ExternalArray) |
1765 CAST_ACCESSOR(ExternalByteArray) | 1763 CAST_ACCESSOR(ExternalByteArray) |
1766 CAST_ACCESSOR(ExternalUnsignedByteArray) | 1764 CAST_ACCESSOR(ExternalUnsignedByteArray) |
1767 CAST_ACCESSOR(ExternalShortArray) | 1765 CAST_ACCESSOR(ExternalShortArray) |
1768 CAST_ACCESSOR(ExternalUnsignedShortArray) | 1766 CAST_ACCESSOR(ExternalUnsignedShortArray) |
1769 CAST_ACCESSOR(ExternalIntArray) | 1767 CAST_ACCESSOR(ExternalIntArray) |
1770 CAST_ACCESSOR(ExternalUnsignedIntArray) | 1768 CAST_ACCESSOR(ExternalUnsignedIntArray) |
1771 CAST_ACCESSOR(ExternalFloatArray) | 1769 CAST_ACCESSOR(ExternalFloatArray) |
1770 CAST_ACCESSOR(ExternalPixelArray) | |
1772 CAST_ACCESSOR(Struct) | 1771 CAST_ACCESSOR(Struct) |
1773 | 1772 |
1774 | 1773 |
1775 #define MAKE_STRUCT_CAST(NAME, Name, name) CAST_ACCESSOR(Name) | 1774 #define MAKE_STRUCT_CAST(NAME, Name, name) CAST_ACCESSOR(Name) |
1776 STRUCT_LIST(MAKE_STRUCT_CAST) | 1775 STRUCT_LIST(MAKE_STRUCT_CAST) |
1777 #undef MAKE_STRUCT_CAST | 1776 #undef MAKE_STRUCT_CAST |
1778 | 1777 |
1779 | 1778 |
1780 template <typename Shape, typename Key> | 1779 template <typename Shape, typename Key> |
1781 HashTable<Shape, Key>* HashTable<Shape, Key>::cast(Object* obj) { | 1780 HashTable<Shape, Key>* HashTable<Shape, Key>::cast(Object* obj) { |
1782 ASSERT(obj->IsHashTable()); | 1781 ASSERT(obj->IsHashTable()); |
1783 return reinterpret_cast<HashTable*>(obj); | 1782 return reinterpret_cast<HashTable*>(obj); |
1784 } | 1783 } |
1785 | 1784 |
1786 | 1785 |
1787 SMI_ACCESSORS(FixedArray, length, kLengthOffset) | 1786 SMI_ACCESSORS(FixedArray, length, kLengthOffset) |
1788 SMI_ACCESSORS(ByteArray, length, kLengthOffset) | 1787 SMI_ACCESSORS(ByteArray, length, kLengthOffset) |
1789 | 1788 |
1790 INT_ACCESSORS(PixelArray, length, kLengthOffset) | |
1791 INT_ACCESSORS(ExternalArray, length, kLengthOffset) | 1789 INT_ACCESSORS(ExternalArray, length, kLengthOffset) |
1792 | 1790 |
1793 | 1791 |
1794 SMI_ACCESSORS(String, length, kLengthOffset) | 1792 SMI_ACCESSORS(String, length, kLengthOffset) |
1795 | 1793 |
1796 | 1794 |
1797 uint32_t String::hash_field() { | 1795 uint32_t String::hash_field() { |
1798 return READ_UINT32_FIELD(this, kHashFieldOffset); | 1796 return READ_UINT32_FIELD(this, kHashFieldOffset); |
1799 } | 1797 } |
1800 | 1798 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2047 ASSERT_TAG_ALIGNED(address); | 2045 ASSERT_TAG_ALIGNED(address); |
2048 return reinterpret_cast<ByteArray*>(address - kHeaderSize + kHeapObjectTag); | 2046 return reinterpret_cast<ByteArray*>(address - kHeaderSize + kHeapObjectTag); |
2049 } | 2047 } |
2050 | 2048 |
2051 | 2049 |
2052 Address ByteArray::GetDataStartAddress() { | 2050 Address ByteArray::GetDataStartAddress() { |
2053 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; | 2051 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; |
2054 } | 2052 } |
2055 | 2053 |
2056 | 2054 |
2057 uint8_t* PixelArray::external_pointer() { | 2055 uint8_t* ExternalPixelArray::external_pixel_pointer() { |
2058 intptr_t ptr = READ_INTPTR_FIELD(this, kExternalPointerOffset); | 2056 return reinterpret_cast<uint8_t*>(external_pointer()); |
2059 return reinterpret_cast<uint8_t*>(ptr); | |
2060 } | 2057 } |
2061 | 2058 |
2062 | 2059 |
2063 void PixelArray::set_external_pointer(uint8_t* value, WriteBarrierMode mode) { | 2060 uint8_t ExternalPixelArray::get(int index) { |
2064 intptr_t ptr = reinterpret_cast<intptr_t>(value); | |
2065 WRITE_INTPTR_FIELD(this, kExternalPointerOffset, ptr); | |
2066 } | |
2067 | |
2068 | |
2069 uint8_t PixelArray::get(int index) { | |
2070 ASSERT((index >= 0) && (index < this->length())); | 2061 ASSERT((index >= 0) && (index < this->length())); |
2071 uint8_t* ptr = external_pointer(); | 2062 uint8_t* ptr = external_pixel_pointer(); |
2072 return ptr[index]; | 2063 return ptr[index]; |
2073 } | 2064 } |
2074 | 2065 |
2075 | 2066 |
2076 void PixelArray::set(int index, uint8_t value) { | 2067 void ExternalPixelArray::set(int index, uint8_t value) { |
2077 ASSERT((index >= 0) && (index < this->length())); | 2068 ASSERT((index >= 0) && (index < this->length())); |
2078 uint8_t* ptr = external_pointer(); | 2069 uint8_t* ptr = external_pixel_pointer(); |
2079 ptr[index] = value; | 2070 ptr[index] = value; |
2080 } | 2071 } |
2081 | 2072 |
2082 | 2073 |
2083 void* ExternalArray::external_pointer() { | 2074 void* ExternalArray::external_pointer() { |
2084 intptr_t ptr = READ_INTPTR_FIELD(this, kExternalPointerOffset); | 2075 intptr_t ptr = READ_INTPTR_FIELD(this, kExternalPointerOffset); |
2085 return reinterpret_cast<void*>(ptr); | 2076 return reinterpret_cast<void*>(ptr); |
2086 } | 2077 } |
2087 | 2078 |
2088 | 2079 |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2546 return static_cast<CheckType>(type); | 2537 return static_cast<CheckType>(type); |
2547 } | 2538 } |
2548 | 2539 |
2549 | 2540 |
2550 void Code::set_check_type(CheckType value) { | 2541 void Code::set_check_type(CheckType value) { |
2551 ASSERT(is_call_stub() || is_keyed_call_stub()); | 2542 ASSERT(is_call_stub() || is_keyed_call_stub()); |
2552 WRITE_BYTE_FIELD(this, kCheckTypeOffset, value); | 2543 WRITE_BYTE_FIELD(this, kCheckTypeOffset, value); |
2553 } | 2544 } |
2554 | 2545 |
2555 | 2546 |
2547 ExternalArrayType Code::external_array_type() { | |
2548 ASSERT(is_external_array_load_stub() || is_external_array_store_stub()); | |
2549 byte type = READ_BYTE_FIELD(this, kExternalArrayTypeOffset); | |
2550 return static_cast<ExternalArrayType>(type); | |
2551 } | |
2552 | |
2553 | |
2554 void Code::set_external_array_type(ExternalArrayType value) { | |
2555 ASSERT(is_external_array_load_stub() || is_external_array_store_stub()); | |
2556 WRITE_BYTE_FIELD(this, kExternalArrayTypeOffset, value); | |
2557 } | |
2558 | |
2559 | |
2556 byte Code::binary_op_type() { | 2560 byte Code::binary_op_type() { |
2557 ASSERT(is_binary_op_stub()); | 2561 ASSERT(is_binary_op_stub()); |
2558 return READ_BYTE_FIELD(this, kBinaryOpTypeOffset); | 2562 return READ_BYTE_FIELD(this, kBinaryOpTypeOffset); |
2559 } | 2563 } |
2560 | 2564 |
2561 | 2565 |
2562 void Code::set_binary_op_type(byte value) { | 2566 void Code::set_binary_op_type(byte value) { |
2563 ASSERT(is_binary_op_stub()); | 2567 ASSERT(is_binary_op_stub()); |
2564 WRITE_BYTE_FIELD(this, kBinaryOpTypeOffset, value); | 2568 WRITE_BYTE_FIELD(this, kBinaryOpTypeOffset, value); |
2565 } | 2569 } |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2747 { MaybeObject* maybe_obj = CopyDropTransitions(); | 2751 { MaybeObject* maybe_obj = CopyDropTransitions(); |
2748 if (!maybe_obj->ToObject(&obj)) return maybe_obj; | 2752 if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
2749 } | 2753 } |
2750 Map* new_map = Map::cast(obj); | 2754 Map* new_map = Map::cast(obj); |
2751 new_map->set_has_fast_elements(false); | 2755 new_map->set_has_fast_elements(false); |
2752 Counters::map_fast_to_slow_elements.Increment(); | 2756 Counters::map_fast_to_slow_elements.Increment(); |
2753 return new_map; | 2757 return new_map; |
2754 } | 2758 } |
2755 | 2759 |
2756 | 2760 |
2757 MaybeObject* Map::GetPixelArrayElementsMap() { | 2761 MaybeObject* Map::NewExternalArrayElementsMap() { |
2758 if (has_pixel_array_elements()) return this; | |
2759 // TODO(danno): Special case empty object map (or most common case) | 2762 // TODO(danno): Special case empty object map (or most common case) |
2760 // to return a pre-canned pixel array map. | 2763 // to return a pre-canned pixel array map. |
2761 Object* obj; | 2764 Object* obj; |
2762 { MaybeObject* maybe_obj = CopyDropTransitions(); | 2765 { MaybeObject* maybe_obj = CopyDropTransitions(); |
2763 if (!maybe_obj->ToObject(&obj)) return maybe_obj; | 2766 if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
2764 } | 2767 } |
2765 Map* new_map = Map::cast(obj); | 2768 Map* new_map = Map::cast(obj); |
2766 new_map->set_has_fast_elements(false); | 2769 new_map->set_has_fast_elements(false); |
2767 new_map->set_has_pixel_array_elements(true); | 2770 new_map->set_has_external_array_elements(true); |
2768 Counters::map_to_pixel_array_elements.Increment(); | 2771 Counters::map_to_external_array_elements.Increment(); |
2769 return new_map; | 2772 return new_map; |
2770 } | 2773 } |
2771 | 2774 |
2772 | 2775 |
2773 ACCESSORS(Map, instance_descriptors, DescriptorArray, | 2776 ACCESSORS(Map, instance_descriptors, DescriptorArray, |
2774 kInstanceDescriptorsOffset) | 2777 kInstanceDescriptorsOffset) |
2775 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) | 2778 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) |
2776 ACCESSORS(Map, constructor, Object, kConstructorOffset) | 2779 ACCESSORS(Map, constructor, Object, kConstructorOffset) |
2777 | 2780 |
2778 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) | 2781 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3477 case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: | 3480 case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: |
3478 return EXTERNAL_UNSIGNED_BYTE_ELEMENTS; | 3481 return EXTERNAL_UNSIGNED_BYTE_ELEMENTS; |
3479 case EXTERNAL_SHORT_ARRAY_TYPE: | 3482 case EXTERNAL_SHORT_ARRAY_TYPE: |
3480 return EXTERNAL_SHORT_ELEMENTS; | 3483 return EXTERNAL_SHORT_ELEMENTS; |
3481 case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: | 3484 case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: |
3482 return EXTERNAL_UNSIGNED_SHORT_ELEMENTS; | 3485 return EXTERNAL_UNSIGNED_SHORT_ELEMENTS; |
3483 case EXTERNAL_INT_ARRAY_TYPE: | 3486 case EXTERNAL_INT_ARRAY_TYPE: |
3484 return EXTERNAL_INT_ELEMENTS; | 3487 return EXTERNAL_INT_ELEMENTS; |
3485 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: | 3488 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: |
3486 return EXTERNAL_UNSIGNED_INT_ELEMENTS; | 3489 return EXTERNAL_UNSIGNED_INT_ELEMENTS; |
3490 case EXTERNAL_PIXEL_ARRAY_TYPE: | |
3491 return EXTERNAL_PIXEL_ELEMENTS; | |
3487 default: | 3492 default: |
3488 ASSERT(array->map()->instance_type() == EXTERNAL_FLOAT_ARRAY_TYPE); | 3493 ASSERT(array->map()->instance_type() == EXTERNAL_FLOAT_ARRAY_TYPE); |
3489 return EXTERNAL_FLOAT_ELEMENTS; | 3494 return EXTERNAL_FLOAT_ELEMENTS; |
3490 } | 3495 } |
3491 } | 3496 } |
3492 ASSERT(array->IsPixelArray()); | 3497 UNREACHABLE(); |
Kevin Millikin (Chromium)
2011/03/07 15:41:45
Hmm. Maybe you should get rid of the default from
danno
2011/03/08 10:01:56
Done.
| |
3493 return PIXEL_ELEMENTS; | 3498 // This code is never reached, but some type has to be returned to make the |
3499 // compiler happy. | |
3500 return EXTERNAL_BYTE_ELEMENTS; | |
3494 } | 3501 } |
3495 | 3502 |
3496 | 3503 |
3497 bool JSObject::HasFastElements() { | 3504 bool JSObject::HasFastElements() { |
3498 return GetElementsKind() == FAST_ELEMENTS; | 3505 return GetElementsKind() == FAST_ELEMENTS; |
3499 } | 3506 } |
3500 | 3507 |
3501 | 3508 |
3502 bool JSObject::HasDictionaryElements() { | 3509 bool JSObject::HasDictionaryElements() { |
3503 return GetElementsKind() == DICTIONARY_ELEMENTS; | 3510 return GetElementsKind() == DICTIONARY_ELEMENTS; |
3504 } | 3511 } |
3505 | 3512 |
3506 | 3513 |
3507 bool JSObject::HasPixelElements() { | |
3508 return GetElementsKind() == PIXEL_ELEMENTS; | |
3509 } | |
3510 | |
3511 | |
3512 bool JSObject::HasExternalArrayElements() { | 3514 bool JSObject::HasExternalArrayElements() { |
3513 return (HasExternalByteElements() || | 3515 return (HasExternalByteElements() || |
Kevin Millikin (Chromium)
2011/03/07 15:41:45
Each one of these tests is potentially calling:
m
danno
2011/03/08 10:01:56
Done.
| |
3514 HasExternalUnsignedByteElements() || | 3516 HasExternalUnsignedByteElements() || |
3515 HasExternalShortElements() || | 3517 HasExternalShortElements() || |
3516 HasExternalUnsignedShortElements() || | 3518 HasExternalUnsignedShortElements() || |
3517 HasExternalIntElements() || | 3519 HasExternalIntElements() || |
3518 HasExternalUnsignedIntElements() || | 3520 HasExternalUnsignedIntElements() || |
3519 HasExternalFloatElements()); | 3521 HasExternalFloatElements() || |
3522 HasExternalPixelElements()); | |
3520 } | 3523 } |
3521 | 3524 |
3522 | 3525 |
3526 bool JSObject::HasExternalPixelElements() { | |
3527 return GetElementsKind() == EXTERNAL_PIXEL_ELEMENTS; | |
Kevin Millikin (Chromium)
2011/03/07 15:41:45
Likewise, would
return elements()->map()->instanc
danno
2011/03/08 10:01:56
Done.
| |
3528 } | |
3529 | |
3530 | |
3523 bool JSObject::HasExternalByteElements() { | 3531 bool JSObject::HasExternalByteElements() { |
3524 return GetElementsKind() == EXTERNAL_BYTE_ELEMENTS; | 3532 return GetElementsKind() == EXTERNAL_BYTE_ELEMENTS; |
3525 } | 3533 } |
3526 | 3534 |
3527 | 3535 |
3528 bool JSObject::HasExternalUnsignedByteElements() { | 3536 bool JSObject::HasExternalUnsignedByteElements() { |
3529 return GetElementsKind() == EXTERNAL_UNSIGNED_BYTE_ELEMENTS; | 3537 return GetElementsKind() == EXTERNAL_UNSIGNED_BYTE_ELEMENTS; |
3530 } | 3538 } |
3531 | 3539 |
3532 | 3540 |
(...skipping 27 matching lines...) Expand all Loading... | |
3560 } | 3568 } |
3561 | 3569 |
3562 | 3570 |
3563 bool JSObject::HasIndexedInterceptor() { | 3571 bool JSObject::HasIndexedInterceptor() { |
3564 return map()->has_indexed_interceptor(); | 3572 return map()->has_indexed_interceptor(); |
3565 } | 3573 } |
3566 | 3574 |
3567 | 3575 |
3568 bool JSObject::AllowsSetElementsLength() { | 3576 bool JSObject::AllowsSetElementsLength() { |
3569 bool result = elements()->IsFixedArray(); | 3577 bool result = elements()->IsFixedArray(); |
3570 ASSERT(result == (!HasPixelElements() && !HasExternalArrayElements())); | 3578 ASSERT(result == !HasExternalArrayElements()); |
3571 return result; | 3579 return result; |
3572 } | 3580 } |
3573 | 3581 |
3574 | 3582 |
3575 MaybeObject* JSObject::EnsureWritableFastElements() { | 3583 MaybeObject* JSObject::EnsureWritableFastElements() { |
3576 ASSERT(HasFastElements()); | 3584 ASSERT(HasFastElements()); |
3577 FixedArray* elems = FixedArray::cast(elements()); | 3585 FixedArray* elems = FixedArray::cast(elements()); |
3578 if (elems->map() != Heap::fixed_cow_array_map()) return elems; | 3586 if (elems->map() != Heap::fixed_cow_array_map()) return elems; |
3579 Object* writable_elems; | 3587 Object* writable_elems; |
3580 { MaybeObject* maybe_writable_elems = | 3588 { MaybeObject* maybe_writable_elems = |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3937 #undef WRITE_INT_FIELD | 3945 #undef WRITE_INT_FIELD |
3938 #undef READ_SHORT_FIELD | 3946 #undef READ_SHORT_FIELD |
3939 #undef WRITE_SHORT_FIELD | 3947 #undef WRITE_SHORT_FIELD |
3940 #undef READ_BYTE_FIELD | 3948 #undef READ_BYTE_FIELD |
3941 #undef WRITE_BYTE_FIELD | 3949 #undef WRITE_BYTE_FIELD |
3942 | 3950 |
3943 | 3951 |
3944 } } // namespace v8::internal | 3952 } } // namespace v8::internal |
3945 | 3953 |
3946 #endif // V8_OBJECTS_INL_H_ | 3954 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |