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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 if (!Object::IsHeapObject()) return false; | 691 if (!Object::IsHeapObject()) return false; |
692 return HeapObject::cast(this)->map()->IsJSProxyMap(); | 692 return HeapObject::cast(this)->map()->IsJSProxyMap(); |
693 } | 693 } |
694 | 694 |
695 | 695 |
696 TYPE_CHECKER(JSFunctionProxy, JS_FUNCTION_PROXY_TYPE) | 696 TYPE_CHECKER(JSFunctionProxy, JS_FUNCTION_PROXY_TYPE) |
697 TYPE_CHECKER(JSSet, JS_SET_TYPE) | 697 TYPE_CHECKER(JSSet, JS_SET_TYPE) |
698 TYPE_CHECKER(JSMap, JS_MAP_TYPE) | 698 TYPE_CHECKER(JSMap, JS_MAP_TYPE) |
699 TYPE_CHECKER(JSSetIterator, JS_SET_ITERATOR_TYPE) | 699 TYPE_CHECKER(JSSetIterator, JS_SET_ITERATOR_TYPE) |
700 TYPE_CHECKER(JSMapIterator, JS_MAP_ITERATOR_TYPE) | 700 TYPE_CHECKER(JSMapIterator, JS_MAP_ITERATOR_TYPE) |
| 701 TYPE_CHECKER(JSIteratorResult, JS_ITERATOR_RESULT_TYPE) |
701 TYPE_CHECKER(JSWeakMap, JS_WEAK_MAP_TYPE) | 702 TYPE_CHECKER(JSWeakMap, JS_WEAK_MAP_TYPE) |
702 TYPE_CHECKER(JSWeakSet, JS_WEAK_SET_TYPE) | 703 TYPE_CHECKER(JSWeakSet, JS_WEAK_SET_TYPE) |
703 TYPE_CHECKER(JSContextExtensionObject, JS_CONTEXT_EXTENSION_OBJECT_TYPE) | 704 TYPE_CHECKER(JSContextExtensionObject, JS_CONTEXT_EXTENSION_OBJECT_TYPE) |
704 TYPE_CHECKER(Map, MAP_TYPE) | 705 TYPE_CHECKER(Map, MAP_TYPE) |
705 TYPE_CHECKER(FixedArray, FIXED_ARRAY_TYPE) | 706 TYPE_CHECKER(FixedArray, FIXED_ARRAY_TYPE) |
706 TYPE_CHECKER(FixedDoubleArray, FIXED_DOUBLE_ARRAY_TYPE) | 707 TYPE_CHECKER(FixedDoubleArray, FIXED_DOUBLE_ARRAY_TYPE) |
707 TYPE_CHECKER(WeakFixedArray, FIXED_ARRAY_TYPE) | 708 TYPE_CHECKER(WeakFixedArray, FIXED_ARRAY_TYPE) |
708 | 709 |
709 | 710 |
710 bool Object::IsJSWeakCollection() const { | 711 bool Object::IsJSWeakCollection() const { |
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2137 case JS_DATA_VIEW_TYPE: | 2138 case JS_DATA_VIEW_TYPE: |
2138 return JSDataView::kSize; | 2139 return JSDataView::kSize; |
2139 case JS_SET_TYPE: | 2140 case JS_SET_TYPE: |
2140 return JSSet::kSize; | 2141 return JSSet::kSize; |
2141 case JS_MAP_TYPE: | 2142 case JS_MAP_TYPE: |
2142 return JSMap::kSize; | 2143 return JSMap::kSize; |
2143 case JS_SET_ITERATOR_TYPE: | 2144 case JS_SET_ITERATOR_TYPE: |
2144 return JSSetIterator::kSize; | 2145 return JSSetIterator::kSize; |
2145 case JS_MAP_ITERATOR_TYPE: | 2146 case JS_MAP_ITERATOR_TYPE: |
2146 return JSMapIterator::kSize; | 2147 return JSMapIterator::kSize; |
| 2148 case JS_ITERATOR_RESULT_TYPE: |
| 2149 return JSIteratorResult::kSize; |
2147 case JS_WEAK_MAP_TYPE: | 2150 case JS_WEAK_MAP_TYPE: |
2148 return JSWeakMap::kSize; | 2151 return JSWeakMap::kSize; |
2149 case JS_WEAK_SET_TYPE: | 2152 case JS_WEAK_SET_TYPE: |
2150 return JSWeakSet::kSize; | 2153 return JSWeakSet::kSize; |
2151 case JS_REGEXP_TYPE: | 2154 case JS_REGEXP_TYPE: |
2152 return JSRegExp::kSize; | 2155 return JSRegExp::kSize; |
2153 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: | 2156 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
2154 return JSObject::kHeaderSize; | 2157 return JSObject::kHeaderSize; |
2155 case JS_MESSAGE_OBJECT_TYPE: | 2158 case JS_MESSAGE_OBJECT_TYPE: |
2156 return JSMessageObject::kSize; | 2159 return JSMessageObject::kSize; |
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3312 CAST_ACCESSOR(JSMap) | 3315 CAST_ACCESSOR(JSMap) |
3313 CAST_ACCESSOR(JSMapIterator) | 3316 CAST_ACCESSOR(JSMapIterator) |
3314 CAST_ACCESSOR(JSMessageObject) | 3317 CAST_ACCESSOR(JSMessageObject) |
3315 CAST_ACCESSOR(JSModule) | 3318 CAST_ACCESSOR(JSModule) |
3316 CAST_ACCESSOR(JSObject) | 3319 CAST_ACCESSOR(JSObject) |
3317 CAST_ACCESSOR(JSProxy) | 3320 CAST_ACCESSOR(JSProxy) |
3318 CAST_ACCESSOR(JSReceiver) | 3321 CAST_ACCESSOR(JSReceiver) |
3319 CAST_ACCESSOR(JSRegExp) | 3322 CAST_ACCESSOR(JSRegExp) |
3320 CAST_ACCESSOR(JSSet) | 3323 CAST_ACCESSOR(JSSet) |
3321 CAST_ACCESSOR(JSSetIterator) | 3324 CAST_ACCESSOR(JSSetIterator) |
| 3325 CAST_ACCESSOR(JSIteratorResult) |
3322 CAST_ACCESSOR(JSTypedArray) | 3326 CAST_ACCESSOR(JSTypedArray) |
3323 CAST_ACCESSOR(JSValue) | 3327 CAST_ACCESSOR(JSValue) |
3324 CAST_ACCESSOR(JSWeakMap) | 3328 CAST_ACCESSOR(JSWeakMap) |
3325 CAST_ACCESSOR(JSWeakSet) | 3329 CAST_ACCESSOR(JSWeakSet) |
3326 CAST_ACCESSOR(LayoutDescriptor) | 3330 CAST_ACCESSOR(LayoutDescriptor) |
3327 CAST_ACCESSOR(Map) | 3331 CAST_ACCESSOR(Map) |
3328 CAST_ACCESSOR(Name) | 3332 CAST_ACCESSOR(Name) |
3329 CAST_ACCESSOR(NameDictionary) | 3333 CAST_ACCESSOR(NameDictionary) |
3330 CAST_ACCESSOR(NormalizedMapCache) | 3334 CAST_ACCESSOR(NormalizedMapCache) |
3331 CAST_ACCESSOR(Object) | 3335 CAST_ACCESSOR(Object) |
(...skipping 4456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7788 | 7792 |
7789 Object* JSMapIterator::CurrentValue() { | 7793 Object* JSMapIterator::CurrentValue() { |
7790 OrderedHashMap* table(OrderedHashMap::cast(this->table())); | 7794 OrderedHashMap* table(OrderedHashMap::cast(this->table())); |
7791 int index = Smi::cast(this->index())->value(); | 7795 int index = Smi::cast(this->index())->value(); |
7792 Object* value = table->ValueAt(index); | 7796 Object* value = table->ValueAt(index); |
7793 DCHECK(!value->IsTheHole()); | 7797 DCHECK(!value->IsTheHole()); |
7794 return value; | 7798 return value; |
7795 } | 7799 } |
7796 | 7800 |
7797 | 7801 |
| 7802 ACCESSORS(JSIteratorResult, done, Object, kDoneOffset) |
| 7803 ACCESSORS(JSIteratorResult, value, Object, kValueOffset) |
| 7804 |
| 7805 |
7798 String::SubStringRange::SubStringRange(String* string, int first, int length) | 7806 String::SubStringRange::SubStringRange(String* string, int first, int length) |
7799 : string_(string), | 7807 : string_(string), |
7800 first_(first), | 7808 first_(first), |
7801 length_(length == -1 ? string->length() : length) {} | 7809 length_(length == -1 ? string->length() : length) {} |
7802 | 7810 |
7803 | 7811 |
7804 class String::SubStringRange::iterator final { | 7812 class String::SubStringRange::iterator final { |
7805 public: | 7813 public: |
7806 typedef std::forward_iterator_tag iterator_category; | 7814 typedef std::forward_iterator_tag iterator_category; |
7807 typedef int difference_type; | 7815 typedef int difference_type; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7887 #undef READ_INT64_FIELD | 7895 #undef READ_INT64_FIELD |
7888 #undef WRITE_INT64_FIELD | 7896 #undef WRITE_INT64_FIELD |
7889 #undef READ_BYTE_FIELD | 7897 #undef READ_BYTE_FIELD |
7890 #undef WRITE_BYTE_FIELD | 7898 #undef WRITE_BYTE_FIELD |
7891 #undef NOBARRIER_READ_BYTE_FIELD | 7899 #undef NOBARRIER_READ_BYTE_FIELD |
7892 #undef NOBARRIER_WRITE_BYTE_FIELD | 7900 #undef NOBARRIER_WRITE_BYTE_FIELD |
7893 | 7901 |
7894 } } // namespace v8::internal | 7902 } } // namespace v8::internal |
7895 | 7903 |
7896 #endif // V8_OBJECTS_INL_H_ | 7904 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |