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 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 | 1179 |
1180 MaybeHandle<Object> Object::SetElement(Isolate* isolate, Handle<Object> object, | 1180 MaybeHandle<Object> Object::SetElement(Isolate* isolate, Handle<Object> object, |
1181 uint32_t index, Handle<Object> value, | 1181 uint32_t index, Handle<Object> value, |
1182 LanguageMode language_mode) { | 1182 LanguageMode language_mode) { |
1183 LookupIterator it(isolate, object, index); | 1183 LookupIterator it(isolate, object, index); |
1184 MAYBE_RETURN_NULL( | 1184 MAYBE_RETURN_NULL( |
1185 SetProperty(&it, value, language_mode, MAY_BE_STORE_FROM_KEYED)); | 1185 SetProperty(&it, value, language_mode, MAY_BE_STORE_FROM_KEYED)); |
1186 return value; | 1186 return value; |
1187 } | 1187 } |
1188 | 1188 |
1189 | 1189 MaybeHandle<Object> JSReceiver::GetPrototype(Isolate* isolate, |
1190 MaybeHandle<Object> Object::GetPrototype(Isolate* isolate, | 1190 Handle<JSReceiver> receiver) { |
1191 Handle<Object> receiver) { | |
1192 // We don't expect access checks to be needed on JSProxy objects. | 1191 // We don't expect access checks to be needed on JSProxy objects. |
1193 DCHECK(!receiver->IsAccessCheckNeeded() || receiver->IsJSObject()); | 1192 DCHECK(!receiver->IsAccessCheckNeeded() || receiver->IsJSObject()); |
1194 PrototypeIterator iter(isolate, receiver, | 1193 PrototypeIterator iter(isolate, receiver, |
1195 PrototypeIterator::START_AT_RECEIVER); | 1194 PrototypeIterator::START_AT_RECEIVER, |
| 1195 PrototypeIterator::END_AT_NON_HIDDEN); |
1196 do { | 1196 do { |
1197 if (!iter.AdvanceFollowingProxies()) return MaybeHandle<Object>(); | 1197 if (!iter.AdvanceFollowingProxies()) return MaybeHandle<Object>(); |
1198 } while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)); | 1198 } while (!iter.IsAtEnd()); |
1199 return PrototypeIterator::GetCurrent(iter); | 1199 return PrototypeIterator::GetCurrent(iter); |
1200 } | 1200 } |
1201 | 1201 |
1202 | 1202 |
1203 MaybeHandle<Object> Object::GetProperty(Isolate* isolate, Handle<Object> object, | 1203 MaybeHandle<Object> Object::GetProperty(Isolate* isolate, Handle<Object> object, |
1204 const char* name, | 1204 const char* name, |
1205 LanguageMode language_mode) { | 1205 LanguageMode language_mode) { |
1206 Handle<String> str = isolate->factory()->InternalizeUtf8String(name); | 1206 Handle<String> str = isolate->factory()->InternalizeUtf8String(name); |
1207 return GetProperty(object, str, language_mode); | 1207 return GetProperty(object, str, language_mode); |
1208 } | 1208 } |
(...skipping 3266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4475 } else { | 4475 } else { |
4476 set_bit_field(bit_field() & ~(1 << kIsConstructor)); | 4476 set_bit_field(bit_field() & ~(1 << kIsConstructor)); |
4477 } | 4477 } |
4478 } | 4478 } |
4479 | 4479 |
4480 | 4480 |
4481 bool Map::is_constructor() const { | 4481 bool Map::is_constructor() const { |
4482 return ((1 << kIsConstructor) & bit_field()) != 0; | 4482 return ((1 << kIsConstructor) & bit_field()) != 0; |
4483 } | 4483 } |
4484 | 4484 |
| 4485 void Map::set_has_hidden_prototype(bool value) { |
| 4486 set_bit_field3(HasHiddenPrototype::update(bit_field3(), value)); |
| 4487 } |
4485 | 4488 |
4486 void Map::set_is_hidden_prototype() { | 4489 bool Map::has_hidden_prototype() const { |
4487 set_bit_field3(IsHiddenPrototype::update(bit_field3(), true)); | 4490 return HasHiddenPrototype::decode(bit_field3()); |
4488 } | 4491 } |
4489 | 4492 |
4490 | 4493 |
4491 bool Map::is_hidden_prototype() const { | |
4492 return IsHiddenPrototype::decode(bit_field3()); | |
4493 } | |
4494 | |
4495 | |
4496 void Map::set_has_indexed_interceptor() { | 4494 void Map::set_has_indexed_interceptor() { |
4497 set_bit_field(bit_field() | (1 << kHasIndexedInterceptor)); | 4495 set_bit_field(bit_field() | (1 << kHasIndexedInterceptor)); |
4498 } | 4496 } |
4499 | 4497 |
4500 | 4498 |
4501 bool Map::has_indexed_interceptor() { | 4499 bool Map::has_indexed_interceptor() { |
4502 return ((1 << kHasIndexedInterceptor) & bit_field()) != 0; | 4500 return ((1 << kHasIndexedInterceptor) & bit_field()) != 0; |
4503 } | 4501 } |
4504 | 4502 |
4505 | 4503 |
(...skipping 3328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7834 #undef WRITE_INT64_FIELD | 7832 #undef WRITE_INT64_FIELD |
7835 #undef READ_BYTE_FIELD | 7833 #undef READ_BYTE_FIELD |
7836 #undef WRITE_BYTE_FIELD | 7834 #undef WRITE_BYTE_FIELD |
7837 #undef NOBARRIER_READ_BYTE_FIELD | 7835 #undef NOBARRIER_READ_BYTE_FIELD |
7838 #undef NOBARRIER_WRITE_BYTE_FIELD | 7836 #undef NOBARRIER_WRITE_BYTE_FIELD |
7839 | 7837 |
7840 } // namespace internal | 7838 } // namespace internal |
7841 } // namespace v8 | 7839 } // namespace v8 |
7842 | 7840 |
7843 #endif // V8_OBJECTS_INL_H_ | 7841 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |