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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 bool Object::IsJSProxy() const { | 703 bool Object::IsJSProxy() const { |
704 if (!Object::IsHeapObject()) return false; | 704 if (!Object::IsHeapObject()) return false; |
705 return HeapObject::cast(this)->map()->IsJSProxyMap(); | 705 return HeapObject::cast(this)->map()->IsJSProxyMap(); |
706 } | 706 } |
707 | 707 |
708 | 708 |
709 TYPE_CHECKER(JSSet, JS_SET_TYPE) | 709 TYPE_CHECKER(JSSet, JS_SET_TYPE) |
710 TYPE_CHECKER(JSMap, JS_MAP_TYPE) | 710 TYPE_CHECKER(JSMap, JS_MAP_TYPE) |
711 TYPE_CHECKER(JSSetIterator, JS_SET_ITERATOR_TYPE) | 711 TYPE_CHECKER(JSSetIterator, JS_SET_ITERATOR_TYPE) |
712 TYPE_CHECKER(JSMapIterator, JS_MAP_ITERATOR_TYPE) | 712 TYPE_CHECKER(JSMapIterator, JS_MAP_ITERATOR_TYPE) |
713 TYPE_CHECKER(JSIteratorResult, JS_ITERATOR_RESULT_TYPE) | |
714 TYPE_CHECKER(JSWeakMap, JS_WEAK_MAP_TYPE) | 713 TYPE_CHECKER(JSWeakMap, JS_WEAK_MAP_TYPE) |
715 TYPE_CHECKER(JSWeakSet, JS_WEAK_SET_TYPE) | 714 TYPE_CHECKER(JSWeakSet, JS_WEAK_SET_TYPE) |
716 TYPE_CHECKER(JSContextExtensionObject, JS_CONTEXT_EXTENSION_OBJECT_TYPE) | 715 TYPE_CHECKER(JSContextExtensionObject, JS_CONTEXT_EXTENSION_OBJECT_TYPE) |
717 TYPE_CHECKER(Map, MAP_TYPE) | 716 TYPE_CHECKER(Map, MAP_TYPE) |
718 TYPE_CHECKER(FixedDoubleArray, FIXED_DOUBLE_ARRAY_TYPE) | 717 TYPE_CHECKER(FixedDoubleArray, FIXED_DOUBLE_ARRAY_TYPE) |
719 TYPE_CHECKER(WeakFixedArray, FIXED_ARRAY_TYPE) | 718 TYPE_CHECKER(WeakFixedArray, FIXED_ARRAY_TYPE) |
720 TYPE_CHECKER(TransitionArray, TRANSITION_ARRAY_TYPE) | 719 TYPE_CHECKER(TransitionArray, TRANSITION_ARRAY_TYPE) |
721 | 720 |
722 | 721 |
723 bool Object::IsJSWeakCollection() const { | 722 bool Object::IsJSWeakCollection() const { |
(...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2105 case JS_DATA_VIEW_TYPE: | 2104 case JS_DATA_VIEW_TYPE: |
2106 return JSDataView::kSize; | 2105 return JSDataView::kSize; |
2107 case JS_SET_TYPE: | 2106 case JS_SET_TYPE: |
2108 return JSSet::kSize; | 2107 return JSSet::kSize; |
2109 case JS_MAP_TYPE: | 2108 case JS_MAP_TYPE: |
2110 return JSMap::kSize; | 2109 return JSMap::kSize; |
2111 case JS_SET_ITERATOR_TYPE: | 2110 case JS_SET_ITERATOR_TYPE: |
2112 return JSSetIterator::kSize; | 2111 return JSSetIterator::kSize; |
2113 case JS_MAP_ITERATOR_TYPE: | 2112 case JS_MAP_ITERATOR_TYPE: |
2114 return JSMapIterator::kSize; | 2113 return JSMapIterator::kSize; |
2115 case JS_ITERATOR_RESULT_TYPE: | |
2116 return JSIteratorResult::kSize; | |
2117 case JS_WEAK_MAP_TYPE: | 2114 case JS_WEAK_MAP_TYPE: |
2118 return JSWeakMap::kSize; | 2115 return JSWeakMap::kSize; |
2119 case JS_WEAK_SET_TYPE: | 2116 case JS_WEAK_SET_TYPE: |
2120 return JSWeakSet::kSize; | 2117 return JSWeakSet::kSize; |
2121 case JS_PROMISE_TYPE: | 2118 case JS_PROMISE_TYPE: |
2122 return JSObject::kHeaderSize; | 2119 return JSObject::kHeaderSize; |
2123 case JS_REGEXP_TYPE: | 2120 case JS_REGEXP_TYPE: |
2124 return JSRegExp::kSize; | 2121 return JSRegExp::kSize; |
2125 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: | 2122 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
2126 return JSObject::kHeaderSize; | 2123 return JSObject::kHeaderSize; |
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3209 CAST_ACCESSOR(JSMap) | 3206 CAST_ACCESSOR(JSMap) |
3210 CAST_ACCESSOR(JSMapIterator) | 3207 CAST_ACCESSOR(JSMapIterator) |
3211 CAST_ACCESSOR(JSMessageObject) | 3208 CAST_ACCESSOR(JSMessageObject) |
3212 CAST_ACCESSOR(JSModule) | 3209 CAST_ACCESSOR(JSModule) |
3213 CAST_ACCESSOR(JSObject) | 3210 CAST_ACCESSOR(JSObject) |
3214 CAST_ACCESSOR(JSProxy) | 3211 CAST_ACCESSOR(JSProxy) |
3215 CAST_ACCESSOR(JSReceiver) | 3212 CAST_ACCESSOR(JSReceiver) |
3216 CAST_ACCESSOR(JSRegExp) | 3213 CAST_ACCESSOR(JSRegExp) |
3217 CAST_ACCESSOR(JSSet) | 3214 CAST_ACCESSOR(JSSet) |
3218 CAST_ACCESSOR(JSSetIterator) | 3215 CAST_ACCESSOR(JSSetIterator) |
3219 CAST_ACCESSOR(JSIteratorResult) | |
3220 CAST_ACCESSOR(JSTypedArray) | 3216 CAST_ACCESSOR(JSTypedArray) |
3221 CAST_ACCESSOR(JSValue) | 3217 CAST_ACCESSOR(JSValue) |
3222 CAST_ACCESSOR(JSWeakMap) | 3218 CAST_ACCESSOR(JSWeakMap) |
3223 CAST_ACCESSOR(JSWeakSet) | 3219 CAST_ACCESSOR(JSWeakSet) |
3224 CAST_ACCESSOR(LayoutDescriptor) | 3220 CAST_ACCESSOR(LayoutDescriptor) |
3225 CAST_ACCESSOR(Map) | 3221 CAST_ACCESSOR(Map) |
3226 CAST_ACCESSOR(Name) | 3222 CAST_ACCESSOR(Name) |
3227 CAST_ACCESSOR(NameDictionary) | 3223 CAST_ACCESSOR(NameDictionary) |
3228 CAST_ACCESSOR(NormalizedMapCache) | 3224 CAST_ACCESSOR(NormalizedMapCache) |
3229 CAST_ACCESSOR(Object) | 3225 CAST_ACCESSOR(Object) |
(...skipping 4501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7731 | 7727 |
7732 Object* JSMapIterator::CurrentValue() { | 7728 Object* JSMapIterator::CurrentValue() { |
7733 OrderedHashMap* table(OrderedHashMap::cast(this->table())); | 7729 OrderedHashMap* table(OrderedHashMap::cast(this->table())); |
7734 int index = Smi::cast(this->index())->value(); | 7730 int index = Smi::cast(this->index())->value(); |
7735 Object* value = table->ValueAt(index); | 7731 Object* value = table->ValueAt(index); |
7736 DCHECK(!value->IsTheHole()); | 7732 DCHECK(!value->IsTheHole()); |
7737 return value; | 7733 return value; |
7738 } | 7734 } |
7739 | 7735 |
7740 | 7736 |
7741 ACCESSORS(JSIteratorResult, done, Object, kDoneOffset) | |
7742 ACCESSORS(JSIteratorResult, value, Object, kValueOffset) | |
7743 | |
7744 | |
7745 String::SubStringRange::SubStringRange(String* string, int first, int length) | 7737 String::SubStringRange::SubStringRange(String* string, int first, int length) |
7746 : string_(string), | 7738 : string_(string), |
7747 first_(first), | 7739 first_(first), |
7748 length_(length == -1 ? string->length() : length) {} | 7740 length_(length == -1 ? string->length() : length) {} |
7749 | 7741 |
7750 | 7742 |
7751 class String::SubStringRange::iterator final { | 7743 class String::SubStringRange::iterator final { |
7752 public: | 7744 public: |
7753 typedef std::forward_iterator_tag iterator_category; | 7745 typedef std::forward_iterator_tag iterator_category; |
7754 typedef int difference_type; | 7746 typedef int difference_type; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7842 #undef WRITE_INT64_FIELD | 7834 #undef WRITE_INT64_FIELD |
7843 #undef READ_BYTE_FIELD | 7835 #undef READ_BYTE_FIELD |
7844 #undef WRITE_BYTE_FIELD | 7836 #undef WRITE_BYTE_FIELD |
7845 #undef NOBARRIER_READ_BYTE_FIELD | 7837 #undef NOBARRIER_READ_BYTE_FIELD |
7846 #undef NOBARRIER_WRITE_BYTE_FIELD | 7838 #undef NOBARRIER_WRITE_BYTE_FIELD |
7847 | 7839 |
7848 } // namespace internal | 7840 } // namespace internal |
7849 } // namespace v8 | 7841 } // namespace v8 |
7850 | 7842 |
7851 #endif // V8_OBJECTS_INL_H_ | 7843 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |