OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2693 // interceptor calls. | 2693 // interceptor calls. |
2694 AssertNoContextChange ncc; | 2694 AssertNoContextChange ncc; |
2695 | 2695 |
2696 // Try to flatten before operating on the string. | 2696 // Try to flatten before operating on the string. |
2697 name->TryFlatten(); | 2697 name->TryFlatten(); |
2698 | 2698 |
2699 if (!CanSetCallback(name)) { | 2699 if (!CanSetCallback(name)) { |
2700 return Heap::undefined_value(); | 2700 return Heap::undefined_value(); |
2701 } | 2701 } |
2702 | 2702 |
2703 uint32_t index; | 2703 uint32_t index = 0; |
2704 bool is_element = name->AsArrayIndex(&index); | 2704 bool is_element = name->AsArrayIndex(&index); |
2705 if (is_element && IsJSArray()) return Heap::undefined_value(); | 2705 if (is_element && IsJSArray()) return Heap::undefined_value(); |
2706 | 2706 |
2707 if (is_element) { | 2707 if (is_element) { |
2708 switch (GetElementsKind()) { | 2708 switch (GetElementsKind()) { |
2709 case FAST_ELEMENTS: | 2709 case FAST_ELEMENTS: |
2710 break; | 2710 break; |
2711 case PIXEL_ELEMENTS: | 2711 case PIXEL_ELEMENTS: |
2712 case EXTERNAL_BYTE_ELEMENTS: | 2712 case EXTERNAL_BYTE_ELEMENTS: |
2713 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: | 2713 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2951 | 2951 |
2952 // Check access rights if needed. | 2952 // Check access rights if needed. |
2953 if (IsAccessCheckNeeded() && | 2953 if (IsAccessCheckNeeded() && |
2954 !Top::MayNamedAccess(this, name, v8::ACCESS_HAS)) { | 2954 !Top::MayNamedAccess(this, name, v8::ACCESS_HAS)) { |
2955 Top::ReportFailedAccessCheck(this, v8::ACCESS_HAS); | 2955 Top::ReportFailedAccessCheck(this, v8::ACCESS_HAS); |
2956 return Heap::undefined_value(); | 2956 return Heap::undefined_value(); |
2957 } | 2957 } |
2958 | 2958 |
2959 // Make the lookup and include prototypes. | 2959 // Make the lookup and include prototypes. |
2960 int accessor_index = is_getter ? kGetterIndex : kSetterIndex; | 2960 int accessor_index = is_getter ? kGetterIndex : kSetterIndex; |
2961 uint32_t index; | 2961 uint32_t index = 0; |
2962 if (name->AsArrayIndex(&index)) { | 2962 if (name->AsArrayIndex(&index)) { |
2963 for (Object* obj = this; | 2963 for (Object* obj = this; |
2964 obj != Heap::null_value(); | 2964 obj != Heap::null_value(); |
2965 obj = JSObject::cast(obj)->GetPrototype()) { | 2965 obj = JSObject::cast(obj)->GetPrototype()) { |
2966 JSObject* js_object = JSObject::cast(obj); | 2966 JSObject* js_object = JSObject::cast(obj); |
2967 if (js_object->HasDictionaryElements()) { | 2967 if (js_object->HasDictionaryElements()) { |
2968 NumberDictionary* dictionary = js_object->element_dictionary(); | 2968 NumberDictionary* dictionary = js_object->element_dictionary(); |
2969 int entry = dictionary->FindEntry(index); | 2969 int entry = dictionary->FindEntry(index); |
2970 if (entry != NumberDictionary::kNotFound) { | 2970 if (entry != NumberDictionary::kNotFound) { |
2971 Object* element = dictionary->ValueAt(entry); | 2971 Object* element = dictionary->ValueAt(entry); |
(...skipping 5736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8708 if (break_point_objects()->IsUndefined()) return 0; | 8708 if (break_point_objects()->IsUndefined()) return 0; |
8709 // Single beak point. | 8709 // Single beak point. |
8710 if (!break_point_objects()->IsFixedArray()) return 1; | 8710 if (!break_point_objects()->IsFixedArray()) return 1; |
8711 // Multiple break points. | 8711 // Multiple break points. |
8712 return FixedArray::cast(break_point_objects())->length(); | 8712 return FixedArray::cast(break_point_objects())->length(); |
8713 } | 8713 } |
8714 #endif | 8714 #endif |
8715 | 8715 |
8716 | 8716 |
8717 } } // namespace v8::internal | 8717 } } // namespace v8::internal |
OLD | NEW |