OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 bool Object::IsContext() const { | 758 bool Object::IsContext() const { |
759 if (!Object::IsHeapObject()) return false; | 759 if (!Object::IsHeapObject()) return false; |
760 Map* map = HeapObject::cast(this)->map(); | 760 Map* map = HeapObject::cast(this)->map(); |
761 Heap* heap = map->GetHeap(); | 761 Heap* heap = map->GetHeap(); |
762 return (map == heap->function_context_map() || | 762 return (map == heap->function_context_map() || |
763 map == heap->catch_context_map() || | 763 map == heap->catch_context_map() || |
764 map == heap->with_context_map() || | 764 map == heap->with_context_map() || |
765 map == heap->native_context_map() || | 765 map == heap->native_context_map() || |
766 map == heap->block_context_map() || | 766 map == heap->block_context_map() || |
767 map == heap->module_context_map() || | 767 map == heap->module_context_map() || |
768 map == heap->global_context_map()); | 768 map == heap->script_context_map()); |
769 } | 769 } |
770 | 770 |
771 | 771 |
772 bool Object::IsNativeContext() const { | 772 bool Object::IsNativeContext() const { |
773 return Object::IsHeapObject() && | 773 return Object::IsHeapObject() && |
774 HeapObject::cast(this)->map() == | 774 HeapObject::cast(this)->map() == |
775 HeapObject::cast(this)->GetHeap()->native_context_map(); | 775 HeapObject::cast(this)->GetHeap()->native_context_map(); |
776 } | 776 } |
777 | 777 |
778 | 778 |
779 bool Object::IsGlobalContextTable() const { | 779 bool Object::IsScriptContextTable() const { |
780 if (!Object::IsHeapObject()) return false; | 780 if (!Object::IsHeapObject()) return false; |
781 Map* map = HeapObject::cast(this)->map(); | 781 Map* map = HeapObject::cast(this)->map(); |
782 Heap* heap = map->GetHeap(); | 782 Heap* heap = map->GetHeap(); |
783 return map == heap->global_context_table_map(); | 783 return map == heap->script_context_table_map(); |
784 } | 784 } |
785 | 785 |
786 | 786 |
787 bool Object::IsScopeInfo() const { | 787 bool Object::IsScopeInfo() const { |
788 return Object::IsHeapObject() && | 788 return Object::IsHeapObject() && |
789 HeapObject::cast(this)->map() == | 789 HeapObject::cast(this)->map() == |
790 HeapObject::cast(this)->GetHeap()->scope_info_map(); | 790 HeapObject::cast(this)->GetHeap()->scope_info_map(); |
791 } | 791 } |
792 | 792 |
793 | 793 |
(...skipping 4655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5449 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) | 5449 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) |
5450 ACCESSORS(Map, dependent_code, DependentCode, kDependentCodeOffset) | 5450 ACCESSORS(Map, dependent_code, DependentCode, kDependentCodeOffset) |
5451 ACCESSORS(Map, constructor, Object, kConstructorOffset) | 5451 ACCESSORS(Map, constructor, Object, kConstructorOffset) |
5452 | 5452 |
5453 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) | 5453 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) |
5454 ACCESSORS(JSFunction, literals_or_bindings, FixedArray, kLiteralsOffset) | 5454 ACCESSORS(JSFunction, literals_or_bindings, FixedArray, kLiteralsOffset) |
5455 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset) | 5455 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset) |
5456 | 5456 |
5457 ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset) | 5457 ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset) |
5458 ACCESSORS(GlobalObject, native_context, Context, kNativeContextOffset) | 5458 ACCESSORS(GlobalObject, native_context, Context, kNativeContextOffset) |
5459 ACCESSORS(GlobalObject, global_context, Context, kGlobalContextOffset) | |
5460 ACCESSORS(GlobalObject, global_proxy, JSObject, kGlobalProxyOffset) | 5459 ACCESSORS(GlobalObject, global_proxy, JSObject, kGlobalProxyOffset) |
5461 | 5460 |
5462 ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset) | 5461 ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset) |
5463 ACCESSORS(JSGlobalProxy, hash, Object, kHashOffset) | 5462 ACCESSORS(JSGlobalProxy, hash, Object, kHashOffset) |
5464 | 5463 |
5465 ACCESSORS(AccessorInfo, name, Object, kNameOffset) | 5464 ACCESSORS(AccessorInfo, name, Object, kNameOffset) |
5466 ACCESSORS_TO_SMI(AccessorInfo, flag, kFlagOffset) | 5465 ACCESSORS_TO_SMI(AccessorInfo, flag, kFlagOffset) |
5467 ACCESSORS(AccessorInfo, expected_receiver_type, Object, | 5466 ACCESSORS(AccessorInfo, expected_receiver_type, Object, |
5468 kExpectedReceiverTypeOffset) | 5467 kExpectedReceiverTypeOffset) |
5469 | 5468 |
(...skipping 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7475 #undef READ_SHORT_FIELD | 7474 #undef READ_SHORT_FIELD |
7476 #undef WRITE_SHORT_FIELD | 7475 #undef WRITE_SHORT_FIELD |
7477 #undef READ_BYTE_FIELD | 7476 #undef READ_BYTE_FIELD |
7478 #undef WRITE_BYTE_FIELD | 7477 #undef WRITE_BYTE_FIELD |
7479 #undef NOBARRIER_READ_BYTE_FIELD | 7478 #undef NOBARRIER_READ_BYTE_FIELD |
7480 #undef NOBARRIER_WRITE_BYTE_FIELD | 7479 #undef NOBARRIER_WRITE_BYTE_FIELD |
7481 | 7480 |
7482 } } // namespace v8::internal | 7481 } } // namespace v8::internal |
7483 | 7482 |
7484 #endif // V8_OBJECTS_INL_H_ | 7483 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |