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 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1876 } | 1876 } |
1877 | 1877 |
1878 | 1878 |
1879 void JSObject::initialize_elements() { | 1879 void JSObject::initialize_elements() { |
1880 FixedArrayBase* elements = map()->GetInitialElements(); | 1880 FixedArrayBase* elements = map()->GetInitialElements(); |
1881 WRITE_FIELD(this, kElementsOffset, elements); | 1881 WRITE_FIELD(this, kElementsOffset, elements); |
1882 } | 1882 } |
1883 | 1883 |
1884 | 1884 |
1885 InterceptorInfo* JSObject::GetIndexedInterceptor() { | 1885 InterceptorInfo* JSObject::GetIndexedInterceptor() { |
1886 DCHECK(map()->has_indexed_interceptor()); | 1886 return map()->GetIndexedInterceptor(); |
1887 JSFunction* constructor = JSFunction::cast(map()->GetConstructor()); | 1887 } |
| 1888 |
| 1889 InterceptorInfo* JSObject::GetNamedInterceptor() { |
| 1890 return map()->GetNamedInterceptor(); |
| 1891 } |
| 1892 |
| 1893 InterceptorInfo* Map::GetNamedInterceptor() { |
| 1894 DCHECK(has_named_interceptor()); |
| 1895 JSFunction* constructor = JSFunction::cast(GetConstructor()); |
1888 DCHECK(constructor->shared()->IsApiFunction()); | 1896 DCHECK(constructor->shared()->IsApiFunction()); |
1889 Object* result = | 1897 return InterceptorInfo::cast( |
1890 constructor->shared()->get_api_func_data()->indexed_property_handler(); | 1898 constructor->shared()->get_api_func_data()->named_property_handler()); |
1891 return InterceptorInfo::cast(result); | 1899 } |
| 1900 |
| 1901 InterceptorInfo* Map::GetIndexedInterceptor() { |
| 1902 DCHECK(has_indexed_interceptor()); |
| 1903 JSFunction* constructor = JSFunction::cast(GetConstructor()); |
| 1904 DCHECK(constructor->shared()->IsApiFunction()); |
| 1905 return InterceptorInfo::cast( |
| 1906 constructor->shared()->get_api_func_data()->indexed_property_handler()); |
1892 } | 1907 } |
1893 | 1908 |
1894 | 1909 |
1895 ACCESSORS(Oddball, to_string, String, kToStringOffset) | 1910 ACCESSORS(Oddball, to_string, String, kToStringOffset) |
1896 ACCESSORS(Oddball, to_number, Object, kToNumberOffset) | 1911 ACCESSORS(Oddball, to_number, Object, kToNumberOffset) |
1897 ACCESSORS(Oddball, to_boolean, Oddball, kToBooleanOffset) | 1912 ACCESSORS(Oddball, to_boolean, Oddball, kToBooleanOffset) |
1898 ACCESSORS(Oddball, type_of, String, kTypeOfOffset) | 1913 ACCESSORS(Oddball, type_of, String, kTypeOfOffset) |
1899 | 1914 |
1900 | 1915 |
1901 byte Oddball::kind() const { | 1916 byte Oddball::kind() const { |
(...skipping 5871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7773 #undef WRITE_INT64_FIELD | 7788 #undef WRITE_INT64_FIELD |
7774 #undef READ_BYTE_FIELD | 7789 #undef READ_BYTE_FIELD |
7775 #undef WRITE_BYTE_FIELD | 7790 #undef WRITE_BYTE_FIELD |
7776 #undef NOBARRIER_READ_BYTE_FIELD | 7791 #undef NOBARRIER_READ_BYTE_FIELD |
7777 #undef NOBARRIER_WRITE_BYTE_FIELD | 7792 #undef NOBARRIER_WRITE_BYTE_FIELD |
7778 | 7793 |
7779 } // namespace internal | 7794 } // namespace internal |
7780 } // namespace v8 | 7795 } // namespace v8 |
7781 | 7796 |
7782 #endif // V8_OBJECTS_INL_H_ | 7797 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |