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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 TYPE_CHECKER(JSTypedArray, JS_TYPED_ARRAY_TYPE) | 851 TYPE_CHECKER(JSTypedArray, JS_TYPED_ARRAY_TYPE) |
852 TYPE_CHECKER(JSDataView, JS_DATA_VIEW_TYPE) | 852 TYPE_CHECKER(JSDataView, JS_DATA_VIEW_TYPE) |
853 | 853 |
854 bool HeapObject::IsJSArrayBufferView() const { | 854 bool HeapObject::IsJSArrayBufferView() const { |
855 return IsJSDataView() || IsJSTypedArray(); | 855 return IsJSDataView() || IsJSTypedArray(); |
856 } | 856 } |
857 | 857 |
858 | 858 |
859 TYPE_CHECKER(JSRegExp, JS_REGEXP_TYPE) | 859 TYPE_CHECKER(JSRegExp, JS_REGEXP_TYPE) |
860 | 860 |
| 861 |
861 template <> inline bool Is<JSArray>(Object* obj) { | 862 template <> inline bool Is<JSArray>(Object* obj) { |
862 return obj->IsJSArray(); | 863 return obj->IsJSArray(); |
863 } | 864 } |
864 | 865 |
865 bool HeapObject::IsHashTable() const { | 866 bool HeapObject::IsHashTable() const { |
866 return map() == GetHeap()->hash_table_map(); | 867 return map() == GetHeap()->hash_table_map(); |
867 } | 868 } |
868 | 869 |
869 bool HeapObject::IsWeakHashTable() const { return IsHashTable(); } | 870 bool HeapObject::IsWeakHashTable() const { return IsHashTable(); } |
870 | 871 |
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2086 return JSMap::kSize; | 2087 return JSMap::kSize; |
2087 case JS_SET_ITERATOR_TYPE: | 2088 case JS_SET_ITERATOR_TYPE: |
2088 return JSSetIterator::kSize; | 2089 return JSSetIterator::kSize; |
2089 case JS_MAP_ITERATOR_TYPE: | 2090 case JS_MAP_ITERATOR_TYPE: |
2090 return JSMapIterator::kSize; | 2091 return JSMapIterator::kSize; |
2091 case JS_WEAK_MAP_TYPE: | 2092 case JS_WEAK_MAP_TYPE: |
2092 return JSWeakMap::kSize; | 2093 return JSWeakMap::kSize; |
2093 case JS_WEAK_SET_TYPE: | 2094 case JS_WEAK_SET_TYPE: |
2094 return JSWeakSet::kSize; | 2095 return JSWeakSet::kSize; |
2095 case JS_PROMISE_TYPE: | 2096 case JS_PROMISE_TYPE: |
2096 return JSPromise::kSize; | 2097 return JSObject::kHeaderSize; |
2097 case JS_REGEXP_TYPE: | 2098 case JS_REGEXP_TYPE: |
2098 return JSRegExp::kSize; | 2099 return JSRegExp::kSize; |
2099 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: | 2100 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
2100 return JSObject::kHeaderSize; | 2101 return JSObject::kHeaderSize; |
2101 case JS_MESSAGE_OBJECT_TYPE: | 2102 case JS_MESSAGE_OBJECT_TYPE: |
2102 return JSMessageObject::kSize; | 2103 return JSMessageObject::kSize; |
2103 case JS_ARGUMENTS_TYPE: | 2104 case JS_ARGUMENTS_TYPE: |
2104 return JSArgumentsObject::kHeaderSize; | 2105 return JSArgumentsObject::kHeaderSize; |
2105 case JS_ERROR_TYPE: | 2106 case JS_ERROR_TYPE: |
2106 return JSObject::kHeaderSize; | 2107 return JSObject::kHeaderSize; |
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3315 CAST_ACCESSOR(JSGlobalProxy) | 3316 CAST_ACCESSOR(JSGlobalProxy) |
3316 CAST_ACCESSOR(JSMap) | 3317 CAST_ACCESSOR(JSMap) |
3317 CAST_ACCESSOR(JSMapIterator) | 3318 CAST_ACCESSOR(JSMapIterator) |
3318 CAST_ACCESSOR(JSMessageObject) | 3319 CAST_ACCESSOR(JSMessageObject) |
3319 CAST_ACCESSOR(JSModuleNamespace) | 3320 CAST_ACCESSOR(JSModuleNamespace) |
3320 CAST_ACCESSOR(JSFixedArrayIterator) | 3321 CAST_ACCESSOR(JSFixedArrayIterator) |
3321 CAST_ACCESSOR(JSObject) | 3322 CAST_ACCESSOR(JSObject) |
3322 CAST_ACCESSOR(JSProxy) | 3323 CAST_ACCESSOR(JSProxy) |
3323 CAST_ACCESSOR(JSReceiver) | 3324 CAST_ACCESSOR(JSReceiver) |
3324 CAST_ACCESSOR(JSRegExp) | 3325 CAST_ACCESSOR(JSRegExp) |
3325 CAST_ACCESSOR(JSPromise) | |
3326 CAST_ACCESSOR(JSSet) | 3326 CAST_ACCESSOR(JSSet) |
3327 CAST_ACCESSOR(JSSetIterator) | 3327 CAST_ACCESSOR(JSSetIterator) |
3328 CAST_ACCESSOR(JSStringIterator) | 3328 CAST_ACCESSOR(JSStringIterator) |
3329 CAST_ACCESSOR(JSArrayIterator) | 3329 CAST_ACCESSOR(JSArrayIterator) |
3330 CAST_ACCESSOR(JSTypedArray) | 3330 CAST_ACCESSOR(JSTypedArray) |
3331 CAST_ACCESSOR(JSValue) | 3331 CAST_ACCESSOR(JSValue) |
3332 CAST_ACCESSOR(JSWeakCollection) | 3332 CAST_ACCESSOR(JSWeakCollection) |
3333 CAST_ACCESSOR(JSWeakMap) | 3333 CAST_ACCESSOR(JSWeakMap) |
3334 CAST_ACCESSOR(JSWeakSet) | 3334 CAST_ACCESSOR(JSWeakSet) |
3335 CAST_ACCESSOR(LayoutDescriptor) | 3335 CAST_ACCESSOR(LayoutDescriptor) |
(...skipping 3752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7088 void JSTypedArray::set_length(Object* value, WriteBarrierMode mode) { | 7088 void JSTypedArray::set_length(Object* value, WriteBarrierMode mode) { |
7089 WRITE_FIELD(this, kLengthOffset, value); | 7089 WRITE_FIELD(this, kLengthOffset, value); |
7090 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kLengthOffset, value, mode); | 7090 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kLengthOffset, value, mode); |
7091 } | 7091 } |
7092 | 7092 |
7093 | 7093 |
7094 #ifdef VERIFY_HEAP | 7094 #ifdef VERIFY_HEAP |
7095 ACCESSORS(JSTypedArray, raw_length, Object, kLengthOffset) | 7095 ACCESSORS(JSTypedArray, raw_length, Object, kLengthOffset) |
7096 #endif | 7096 #endif |
7097 | 7097 |
7098 SMI_ACCESSORS(JSPromise, status, kStatusOffset) | |
7099 ACCESSORS(JSPromise, result, Object, kResultOffset) | |
7100 ACCESSORS(JSPromise, deferred, Object, kDeferredOffset) | |
7101 ACCESSORS(JSPromise, fulfill_reactions, Object, kFulfillReactionsOffset) | |
7102 ACCESSORS(JSPromise, reject_reactions, Object, kRejectReactionsOffset) | |
7103 | 7098 |
7104 ACCESSORS(JSRegExp, data, Object, kDataOffset) | 7099 ACCESSORS(JSRegExp, data, Object, kDataOffset) |
7105 ACCESSORS(JSRegExp, flags, Object, kFlagsOffset) | 7100 ACCESSORS(JSRegExp, flags, Object, kFlagsOffset) |
7106 ACCESSORS(JSRegExp, source, Object, kSourceOffset) | 7101 ACCESSORS(JSRegExp, source, Object, kSourceOffset) |
7107 | 7102 |
7108 | 7103 |
7109 JSRegExp::Type JSRegExp::TypeTag() { | 7104 JSRegExp::Type JSRegExp::TypeTag() { |
7110 Object* data = this->data(); | 7105 Object* data = this->data(); |
7111 if (data->IsUndefined(GetIsolate())) return JSRegExp::NOT_COMPILED; | 7106 if (data->IsUndefined(GetIsolate())) return JSRegExp::NOT_COMPILED; |
7112 Smi* smi = Smi::cast(FixedArray::cast(data)->get(kTagIndex)); | 7107 Smi* smi = Smi::cast(FixedArray::cast(data)->get(kTagIndex)); |
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8468 #undef WRITE_INT64_FIELD | 8463 #undef WRITE_INT64_FIELD |
8469 #undef READ_BYTE_FIELD | 8464 #undef READ_BYTE_FIELD |
8470 #undef WRITE_BYTE_FIELD | 8465 #undef WRITE_BYTE_FIELD |
8471 #undef NOBARRIER_READ_BYTE_FIELD | 8466 #undef NOBARRIER_READ_BYTE_FIELD |
8472 #undef NOBARRIER_WRITE_BYTE_FIELD | 8467 #undef NOBARRIER_WRITE_BYTE_FIELD |
8473 | 8468 |
8474 } // namespace internal | 8469 } // namespace internal |
8475 } // namespace v8 | 8470 } // namespace v8 |
8476 | 8471 |
8477 #endif // V8_OBJECTS_INL_H_ | 8472 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |