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 11 matching lines...) Expand all Loading... | |
22 #include "src/isolate.h" | 22 #include "src/isolate.h" |
23 #include "src/heap-inl.h" | 23 #include "src/heap-inl.h" |
24 #include "src/property.h" | 24 #include "src/property.h" |
25 #include "src/spaces.h" | 25 #include "src/spaces.h" |
26 #include "src/store-buffer.h" | 26 #include "src/store-buffer.h" |
27 #include "src/v8memory.h" | 27 #include "src/v8memory.h" |
28 #include "src/factory.h" | 28 #include "src/factory.h" |
29 #include "src/incremental-marking.h" | 29 #include "src/incremental-marking.h" |
30 #include "src/transitions-inl.h" | 30 #include "src/transitions-inl.h" |
31 #include "src/objects-visiting.h" | 31 #include "src/objects-visiting.h" |
32 #include "src/lookup.h" | |
32 | 33 |
33 namespace v8 { | 34 namespace v8 { |
34 namespace internal { | 35 namespace internal { |
35 | 36 |
36 PropertyDetails::PropertyDetails(Smi* smi) { | 37 PropertyDetails::PropertyDetails(Smi* smi) { |
37 value_ = smi->value(); | 38 value_ = smi->value(); |
38 } | 39 } |
39 | 40 |
40 | 41 |
41 Smi* PropertyDetails::AsSmi() const { | 42 Smi* PropertyDetails::AsSmi() const { |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
657 | 658 |
658 bool Object::IsJSObject() { | 659 bool Object::IsJSObject() { |
659 STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); | 660 STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); |
660 return IsHeapObject() && | 661 return IsHeapObject() && |
661 HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_OBJECT_TYPE; | 662 HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_OBJECT_TYPE; |
662 } | 663 } |
663 | 664 |
664 | 665 |
665 bool Object::IsJSProxy() { | 666 bool Object::IsJSProxy() { |
666 if (!Object::IsHeapObject()) return false; | 667 if (!Object::IsHeapObject()) return false; |
667 InstanceType type = HeapObject::cast(this)->map()->instance_type(); | 668 return HeapObject::cast(this)->map()->IsJSProxyMap(); |
rossberg
2014/06/11 15:37:00
Why not make the same change to IsJSObject? (And p
Toon Verwaest
2014/06/11 17:32:18
I'll defer that for now, not really relevant for t
| |
668 return FIRST_JS_PROXY_TYPE <= type && type <= LAST_JS_PROXY_TYPE; | |
669 } | 669 } |
670 | 670 |
671 | 671 |
672 TYPE_CHECKER(JSFunctionProxy, JS_FUNCTION_PROXY_TYPE) | 672 TYPE_CHECKER(JSFunctionProxy, JS_FUNCTION_PROXY_TYPE) |
673 TYPE_CHECKER(JSSet, JS_SET_TYPE) | 673 TYPE_CHECKER(JSSet, JS_SET_TYPE) |
674 TYPE_CHECKER(JSMap, JS_MAP_TYPE) | 674 TYPE_CHECKER(JSMap, JS_MAP_TYPE) |
675 TYPE_CHECKER(JSSetIterator, JS_SET_ITERATOR_TYPE) | 675 TYPE_CHECKER(JSSetIterator, JS_SET_ITERATOR_TYPE) |
676 TYPE_CHECKER(JSMapIterator, JS_MAP_ITERATOR_TYPE) | 676 TYPE_CHECKER(JSMapIterator, JS_MAP_ITERATOR_TYPE) |
677 TYPE_CHECKER(JSWeakMap, JS_WEAK_MAP_TYPE) | 677 TYPE_CHECKER(JSWeakMap, JS_WEAK_MAP_TYPE) |
678 TYPE_CHECKER(JSWeakSet, JS_WEAK_SET_TYPE) | 678 TYPE_CHECKER(JSWeakSet, JS_WEAK_SET_TYPE) |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1046 } | 1046 } |
1047 | 1047 |
1048 | 1048 |
1049 bool Object::HasSpecificClassOf(String* name) { | 1049 bool Object::HasSpecificClassOf(String* name) { |
1050 return this->IsJSObject() && (JSObject::cast(this)->class_name() == name); | 1050 return this->IsJSObject() && (JSObject::cast(this)->class_name() == name); |
1051 } | 1051 } |
1052 | 1052 |
1053 | 1053 |
1054 MaybeHandle<Object> Object::GetProperty(Handle<Object> object, | 1054 MaybeHandle<Object> Object::GetProperty(Handle<Object> object, |
1055 Handle<Name> name) { | 1055 Handle<Name> name) { |
1056 PropertyAttributes attributes; | 1056 LookupIterator it(object, name); |
1057 return GetPropertyWithReceiver(object, object, name, &attributes); | 1057 return GetProperty(&it); |
1058 } | 1058 } |
1059 | 1059 |
1060 | 1060 |
1061 MaybeHandle<Object> Object::GetElement(Isolate* isolate, | 1061 MaybeHandle<Object> Object::GetElement(Isolate* isolate, |
1062 Handle<Object> object, | 1062 Handle<Object> object, |
1063 uint32_t index) { | 1063 uint32_t index) { |
1064 // GetElement can trigger a getter which can cause allocation. | 1064 // GetElement can trigger a getter which can cause allocation. |
1065 // This was not always the case. This ASSERT is here to catch | 1065 // This was not always the case. This ASSERT is here to catch |
1066 // leftover incorrect uses. | 1066 // leftover incorrect uses. |
1067 ASSERT(AllowHeapAllocation::IsAllowed()); | 1067 ASSERT(AllowHeapAllocation::IsAllowed()); |
(...skipping 5917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6985 #undef READ_SHORT_FIELD | 6985 #undef READ_SHORT_FIELD |
6986 #undef WRITE_SHORT_FIELD | 6986 #undef WRITE_SHORT_FIELD |
6987 #undef READ_BYTE_FIELD | 6987 #undef READ_BYTE_FIELD |
6988 #undef WRITE_BYTE_FIELD | 6988 #undef WRITE_BYTE_FIELD |
6989 #undef NOBARRIER_READ_BYTE_FIELD | 6989 #undef NOBARRIER_READ_BYTE_FIELD |
6990 #undef NOBARRIER_WRITE_BYTE_FIELD | 6990 #undef NOBARRIER_WRITE_BYTE_FIELD |
6991 | 6991 |
6992 } } // namespace v8::internal | 6992 } } // namespace v8::internal |
6993 | 6993 |
6994 #endif // V8_OBJECTS_INL_H_ | 6994 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |