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 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 Handle<Object> object, | 1114 Handle<Object> object, |
1115 uint32_t index) { | 1115 uint32_t index) { |
1116 // GetElement can trigger a getter which can cause allocation. | 1116 // GetElement can trigger a getter which can cause allocation. |
1117 // This was not always the case. This DCHECK is here to catch | 1117 // This was not always the case. This DCHECK is here to catch |
1118 // leftover incorrect uses. | 1118 // leftover incorrect uses. |
1119 DCHECK(AllowHeapAllocation::IsAllowed()); | 1119 DCHECK(AllowHeapAllocation::IsAllowed()); |
1120 return Object::GetElementWithReceiver(isolate, object, object, index); | 1120 return Object::GetElementWithReceiver(isolate, object, object, index); |
1121 } | 1121 } |
1122 | 1122 |
1123 | 1123 |
| 1124 Handle<Object> Object::GetPrototypeSkipHiddenPrototypes( |
| 1125 Isolate* isolate, Handle<Object> receiver) { |
| 1126 PrototypeIterator iter(isolate, receiver); |
| 1127 while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)) { |
| 1128 if (PrototypeIterator::GetCurrent(iter)->IsJSProxy()) { |
| 1129 return PrototypeIterator::GetCurrent(iter); |
| 1130 } |
| 1131 iter.Advance(); |
| 1132 } |
| 1133 return PrototypeIterator::GetCurrent(iter); |
| 1134 } |
| 1135 |
| 1136 |
1124 MaybeHandle<Object> Object::GetPropertyOrElement(Handle<Object> object, | 1137 MaybeHandle<Object> Object::GetPropertyOrElement(Handle<Object> object, |
1125 Handle<Name> name) { | 1138 Handle<Name> name) { |
1126 uint32_t index; | 1139 uint32_t index; |
1127 Isolate* isolate = name->GetIsolate(); | 1140 Isolate* isolate = name->GetIsolate(); |
1128 if (name->AsArrayIndex(&index)) return GetElement(isolate, object, index); | 1141 if (name->AsArrayIndex(&index)) return GetElement(isolate, object, index); |
1129 return GetProperty(object, name); | 1142 return GetProperty(object, name); |
1130 } | 1143 } |
1131 | 1144 |
1132 | 1145 |
1133 MaybeHandle<Object> Object::GetProperty(Isolate* isolate, | 1146 MaybeHandle<Object> Object::GetProperty(Isolate* isolate, |
(...skipping 6101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7235 #undef READ_SHORT_FIELD | 7248 #undef READ_SHORT_FIELD |
7236 #undef WRITE_SHORT_FIELD | 7249 #undef WRITE_SHORT_FIELD |
7237 #undef READ_BYTE_FIELD | 7250 #undef READ_BYTE_FIELD |
7238 #undef WRITE_BYTE_FIELD | 7251 #undef WRITE_BYTE_FIELD |
7239 #undef NOBARRIER_READ_BYTE_FIELD | 7252 #undef NOBARRIER_READ_BYTE_FIELD |
7240 #undef NOBARRIER_WRITE_BYTE_FIELD | 7253 #undef NOBARRIER_WRITE_BYTE_FIELD |
7241 | 7254 |
7242 } } // namespace v8::internal | 7255 } } // namespace v8::internal |
7243 | 7256 |
7244 #endif // V8_OBJECTS_INL_H_ | 7257 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |