OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 if ((from_interceptor.value & READ_ONLY) != 0) { | 724 if ((from_interceptor.value & READ_ONLY) != 0) { |
725 return WriteToReadOnlyElement(isolate, receiver, index, value, | 725 return WriteToReadOnlyElement(isolate, receiver, index, value, |
726 language_mode); | 726 language_mode); |
727 } | 727 } |
728 done = from_interceptor.value != ABSENT; | 728 done = from_interceptor.value != ABSENT; |
729 } | 729 } |
730 | 730 |
731 if (!done && | 731 if (!done && |
732 js_object->elements() != isolate->heap()->empty_fixed_array()) { | 732 js_object->elements() != isolate->heap()->empty_fixed_array()) { |
733 ElementsAccessor* accessor = js_object->GetElementsAccessor(); | 733 ElementsAccessor* accessor = js_object->GetElementsAccessor(); |
734 PropertyAttributes attrs = accessor->GetAttributes(js_object, index); | 734 PropertyAttributes attrs = accessor->GetAttributes(*js_object, index); |
735 if ((attrs & READ_ONLY) != 0) { | 735 if ((attrs & READ_ONLY) != 0) { |
736 return WriteToReadOnlyElement(isolate, receiver, index, value, | 736 return WriteToReadOnlyElement(isolate, receiver, index, value, |
737 language_mode); | 737 language_mode); |
738 } | 738 } |
739 Handle<AccessorPair> pair; | 739 Handle<AccessorPair> pair; |
740 if (accessor->GetAccessorPair(js_object, index).ToHandle(&pair)) { | 740 if (accessor->GetAccessorPair(js_object, index).ToHandle(&pair)) { |
741 return JSObject::SetElementWithCallback(receiver, pair, index, value, | 741 return JSObject::SetElementWithCallback(receiver, pair, index, value, |
742 js_object, language_mode); | 742 js_object, language_mode); |
743 } else { | 743 } else { |
744 done = attrs != ABSENT; | 744 done = attrs != ABSENT; |
745 } | 745 } |
746 } | 746 } |
747 } | 747 } |
748 | 748 |
749 if (!receiver->IsJSObject()) { | 749 if (!receiver->IsJSObject()) { |
750 return WriteToReadOnlyElement(isolate, receiver, index, value, | 750 return WriteToReadOnlyElement(isolate, receiver, index, value, |
751 language_mode); | 751 language_mode); |
752 } | 752 } |
753 Handle<JSObject> target = Handle<JSObject>::cast(receiver); | 753 Handle<JSObject> target = Handle<JSObject>::cast(receiver); |
754 ElementsAccessor* accessor = target->GetElementsAccessor(); | 754 ElementsAccessor* accessor = target->GetElementsAccessor(); |
755 PropertyAttributes attrs = accessor->GetAttributes(target, index); | 755 PropertyAttributes attrs = accessor->GetAttributes(*target, index); |
756 if ((attrs & READ_ONLY) != 0) { | 756 if ((attrs & READ_ONLY) != 0) { |
757 return WriteToReadOnlyElement(isolate, receiver, index, value, | 757 return WriteToReadOnlyElement(isolate, receiver, index, value, |
758 language_mode); | 758 language_mode); |
759 } | 759 } |
760 PropertyAttributes new_attrs = attrs != ABSENT ? attrs : NONE; | 760 PropertyAttributes new_attrs = attrs != ABSENT ? attrs : NONE; |
761 return JSObject::SetElement(target, index, value, new_attrs, language_mode, | 761 return JSObject::SetElement(target, index, value, new_attrs, language_mode, |
762 false); | 762 false); |
763 } | 763 } |
764 | 764 |
765 | 765 |
(...skipping 3598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4364 } | 4364 } |
4365 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Maybe<PropertyAttributes>()); | 4365 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Maybe<PropertyAttributes>()); |
4366 return maybe(ABSENT); | 4366 return maybe(ABSENT); |
4367 } | 4367 } |
4368 | 4368 |
4369 | 4369 |
4370 Maybe<PropertyAttributes> JSObject::GetElementAttributeWithoutInterceptor( | 4370 Maybe<PropertyAttributes> JSObject::GetElementAttributeWithoutInterceptor( |
4371 Handle<JSObject> object, Handle<JSReceiver> receiver, uint32_t index, | 4371 Handle<JSObject> object, Handle<JSReceiver> receiver, uint32_t index, |
4372 bool check_prototype) { | 4372 bool check_prototype) { |
4373 PropertyAttributes attr = | 4373 PropertyAttributes attr = |
4374 object->GetElementsAccessor()->GetAttributes(object, index); | 4374 object->GetElementsAccessor()->GetAttributes(*object, index); |
4375 if (attr != ABSENT) return maybe(attr); | 4375 if (attr != ABSENT) return maybe(attr); |
4376 | 4376 |
4377 // Handle [] on String objects. | 4377 // Handle [] on String objects. |
4378 if (object->IsStringObjectWithCharacterAt(index)) { | 4378 if (object->IsStringObjectWithCharacterAt(index)) { |
4379 return maybe(static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE)); | 4379 return maybe(static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE)); |
4380 } | 4380 } |
4381 | 4381 |
4382 if (!check_prototype) return maybe(ABSENT); | 4382 if (!check_prototype) return maybe(ABSENT); |
4383 | 4383 |
4384 PrototypeIterator iter(object->GetIsolate(), object); | 4384 PrototypeIterator iter(object->GetIsolate(), object); |
(...skipping 3862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8247 DCHECK(current->IsNumber() || current->IsName()); | 8247 DCHECK(current->IsNumber() || current->IsName()); |
8248 } | 8248 } |
8249 } | 8249 } |
8250 #endif | 8250 #endif |
8251 return result; | 8251 return result; |
8252 } | 8252 } |
8253 | 8253 |
8254 | 8254 |
8255 MaybeHandle<FixedArray> FixedArray::UnionOfKeys(Handle<FixedArray> first, | 8255 MaybeHandle<FixedArray> FixedArray::UnionOfKeys(Handle<FixedArray> first, |
8256 Handle<FixedArray> second) { | 8256 Handle<FixedArray> second) { |
8257 ElementsAccessor* accessor = ElementsAccessor::ForArray(second); | 8257 ElementsAccessor* accessor = ElementsAccessor::ForArray(*second); |
8258 Handle<FixedArray> result; | 8258 Handle<FixedArray> result; |
8259 ASSIGN_RETURN_ON_EXCEPTION( | 8259 ASSIGN_RETURN_ON_EXCEPTION( |
8260 first->GetIsolate(), result, | 8260 first->GetIsolate(), result, |
8261 accessor->AddElementsToFixedArray( | 8261 accessor->AddElementsToFixedArray( |
8262 Handle<Object>::null(), // receiver | 8262 Handle<Object>::null(), // receiver |
8263 Handle<JSObject>::null(), // holder | 8263 Handle<JSObject>::null(), // holder |
8264 first, Handle<FixedArrayBase>::cast(second), ALL_KEYS), | 8264 first, Handle<FixedArrayBase>::cast(second), ALL_KEYS), |
8265 FixedArray); | 8265 FixedArray); |
8266 | 8266 |
8267 #ifdef ENABLE_SLOW_DCHECKS | 8267 #ifdef ENABLE_SLOW_DCHECKS |
(...skipping 8932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17200 CompilationInfo* info) { | 17200 CompilationInfo* info) { |
17201 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo( | 17201 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo( |
17202 handle(cell->dependent_code(), info->isolate()), | 17202 handle(cell->dependent_code(), info->isolate()), |
17203 DependentCode::kPropertyCellChangedGroup, info->object_wrapper()); | 17203 DependentCode::kPropertyCellChangedGroup, info->object_wrapper()); |
17204 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 17204 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
17205 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 17205 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
17206 cell, info->zone()); | 17206 cell, info->zone()); |
17207 } | 17207 } |
17208 | 17208 |
17209 } } // namespace v8::internal | 17209 } } // namespace v8::internal |
OLD | NEW |