OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1848 | 1848 |
1849 Object* DescriptorArray::GetCallbacksObject(int descriptor_number) { | 1849 Object* DescriptorArray::GetCallbacksObject(int descriptor_number) { |
1850 ASSERT(GetType(descriptor_number) == CALLBACKS); | 1850 ASSERT(GetType(descriptor_number) == CALLBACKS); |
1851 return GetValue(descriptor_number); | 1851 return GetValue(descriptor_number); |
1852 } | 1852 } |
1853 | 1853 |
1854 | 1854 |
1855 AccessorDescriptor* DescriptorArray::GetCallbacks(int descriptor_number) { | 1855 AccessorDescriptor* DescriptorArray::GetCallbacks(int descriptor_number) { |
1856 ASSERT(GetType(descriptor_number) == CALLBACKS); | 1856 ASSERT(GetType(descriptor_number) == CALLBACKS); |
1857 Foreign* p = Foreign::cast(GetCallbacksObject(descriptor_number)); | 1857 Foreign* p = Foreign::cast(GetCallbacksObject(descriptor_number)); |
1858 return reinterpret_cast<AccessorDescriptor*>(p->address()); | 1858 return reinterpret_cast<AccessorDescriptor*>(p->foreign_address()); |
1859 } | 1859 } |
1860 | 1860 |
1861 | 1861 |
1862 bool DescriptorArray::IsProperty(int descriptor_number) { | 1862 bool DescriptorArray::IsProperty(int descriptor_number) { |
1863 return GetType(descriptor_number) < FIRST_PHANTOM_PROPERTY_TYPE; | 1863 return GetType(descriptor_number) < FIRST_PHANTOM_PROPERTY_TYPE; |
1864 } | 1864 } |
1865 | 1865 |
1866 | 1866 |
1867 bool DescriptorArray::IsTransition(int descriptor_number) { | 1867 bool DescriptorArray::IsTransition(int descriptor_number) { |
1868 PropertyType t = GetType(descriptor_number); | 1868 PropertyType t = GetType(descriptor_number); |
(...skipping 1971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3840 ACCESSORS(JSMap, table, Object, kTableOffset) | 3840 ACCESSORS(JSMap, table, Object, kTableOffset) |
3841 ACCESSORS(JSWeakMap, table, Object, kTableOffset) | 3841 ACCESSORS(JSWeakMap, table, Object, kTableOffset) |
3842 ACCESSORS(JSWeakMap, next, Object, kNextOffset) | 3842 ACCESSORS(JSWeakMap, next, Object, kNextOffset) |
3843 | 3843 |
3844 | 3844 |
3845 ObjectHashTable* JSWeakMap::unchecked_table() { | 3845 ObjectHashTable* JSWeakMap::unchecked_table() { |
3846 return reinterpret_cast<ObjectHashTable*>(READ_FIELD(this, kTableOffset)); | 3846 return reinterpret_cast<ObjectHashTable*>(READ_FIELD(this, kTableOffset)); |
3847 } | 3847 } |
3848 | 3848 |
3849 | 3849 |
3850 Address Foreign::address() { | 3850 Address Foreign::foreign_address() { |
3851 return AddressFrom<Address>(READ_INTPTR_FIELD(this, kAddressOffset)); | 3851 return AddressFrom<Address>(READ_INTPTR_FIELD(this, kForeignAddressOffset)); |
3852 } | 3852 } |
3853 | 3853 |
3854 | 3854 |
3855 void Foreign::set_address(Address value) { | 3855 void Foreign::set_foreign_address(Address value) { |
3856 WRITE_INTPTR_FIELD(this, kAddressOffset, OffsetFrom(value)); | 3856 WRITE_INTPTR_FIELD(this, kForeignAddressOffset, OffsetFrom(value)); |
3857 } | 3857 } |
3858 | 3858 |
3859 | 3859 |
3860 ACCESSORS(JSValue, value, Object, kValueOffset) | 3860 ACCESSORS(JSValue, value, Object, kValueOffset) |
3861 | 3861 |
3862 | 3862 |
3863 JSValue* JSValue::cast(Object* obj) { | 3863 JSValue* JSValue::cast(Object* obj) { |
3864 ASSERT(obj->IsJSValue()); | 3864 ASSERT(obj->IsJSValue()); |
3865 ASSERT(HeapObject::cast(obj)->Size() == JSValue::kSize); | 3865 ASSERT(HeapObject::cast(obj)->Size() == JSValue::kSize); |
3866 return reinterpret_cast<JSValue*>(obj); | 3866 return reinterpret_cast<JSValue*>(obj); |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4529 } | 4529 } |
4530 | 4530 |
4531 | 4531 |
4532 int JSObject::BodyDescriptor::SizeOf(Map* map, HeapObject* object) { | 4532 int JSObject::BodyDescriptor::SizeOf(Map* map, HeapObject* object) { |
4533 return map->instance_size(); | 4533 return map->instance_size(); |
4534 } | 4534 } |
4535 | 4535 |
4536 | 4536 |
4537 void Foreign::ForeignIterateBody(ObjectVisitor* v) { | 4537 void Foreign::ForeignIterateBody(ObjectVisitor* v) { |
4538 v->VisitExternalReference( | 4538 v->VisitExternalReference( |
4539 reinterpret_cast<Address *>(FIELD_ADDR(this, kAddressOffset))); | 4539 reinterpret_cast<Address*>(FIELD_ADDR(this, kForeignAddressOffset))); |
4540 } | 4540 } |
4541 | 4541 |
4542 | 4542 |
4543 template<typename StaticVisitor> | 4543 template<typename StaticVisitor> |
4544 void Foreign::ForeignIterateBody() { | 4544 void Foreign::ForeignIterateBody() { |
4545 StaticVisitor::VisitExternalReference( | 4545 StaticVisitor::VisitExternalReference( |
4546 reinterpret_cast<Address *>(FIELD_ADDR(this, kAddressOffset))); | 4546 reinterpret_cast<Address*>(FIELD_ADDR(this, kForeignAddressOffset))); |
4547 } | 4547 } |
4548 | 4548 |
4549 | 4549 |
4550 void ExternalAsciiString::ExternalAsciiStringIterateBody(ObjectVisitor* v) { | 4550 void ExternalAsciiString::ExternalAsciiStringIterateBody(ObjectVisitor* v) { |
4551 typedef v8::String::ExternalAsciiStringResource Resource; | 4551 typedef v8::String::ExternalAsciiStringResource Resource; |
4552 v->VisitExternalAsciiString( | 4552 v->VisitExternalAsciiString( |
4553 reinterpret_cast<Resource**>(FIELD_ADDR(this, kResourceOffset))); | 4553 reinterpret_cast<Resource**>(FIELD_ADDR(this, kResourceOffset))); |
4554 } | 4554 } |
4555 | 4555 |
4556 | 4556 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4614 #undef WRITE_INT_FIELD | 4614 #undef WRITE_INT_FIELD |
4615 #undef READ_SHORT_FIELD | 4615 #undef READ_SHORT_FIELD |
4616 #undef WRITE_SHORT_FIELD | 4616 #undef WRITE_SHORT_FIELD |
4617 #undef READ_BYTE_FIELD | 4617 #undef READ_BYTE_FIELD |
4618 #undef WRITE_BYTE_FIELD | 4618 #undef WRITE_BYTE_FIELD |
4619 | 4619 |
4620 | 4620 |
4621 } } // namespace v8::internal | 4621 } } // namespace v8::internal |
4622 | 4622 |
4623 #endif // V8_OBJECTS_INL_H_ | 4623 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |