OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 elms->set(IS_ACCESSOR_INDEX, Heap::false_value()); | 772 elms->set(IS_ACCESSOR_INDEX, Heap::false_value()); |
773 Handle<Object> element = GetElement(Handle<Object>(obj), index); | 773 Handle<Object> element = GetElement(Handle<Object>(obj), index); |
774 elms->set(VALUE_INDEX, *element); | 774 elms->set(VALUE_INDEX, *element); |
775 elms->set(WRITABLE_INDEX, Heap::true_value()); | 775 elms->set(WRITABLE_INDEX, Heap::true_value()); |
776 elms->set(ENUMERABLE_INDEX, Heap::true_value()); | 776 elms->set(ENUMERABLE_INDEX, Heap::true_value()); |
777 elms->set(CONFIGURABLE_INDEX, Heap::true_value()); | 777 elms->set(CONFIGURABLE_INDEX, Heap::true_value()); |
778 return *desc; | 778 return *desc; |
779 } | 779 } |
780 | 780 |
781 case JSObject::DICTIONARY_ELEMENT: { | 781 case JSObject::DICTIONARY_ELEMENT: { |
| 782 if (obj->IsJSGlobalProxy()) { |
| 783 Object* proto = obj->GetPrototype(); |
| 784 if (proto->IsNull()) return Heap::undefined_value(); |
| 785 ASSERT(proto->IsJSGlobalObject()); |
| 786 obj = Handle<JSObject>(JSObject::cast(proto)); |
| 787 } |
782 NumberDictionary* dictionary = obj->element_dictionary(); | 788 NumberDictionary* dictionary = obj->element_dictionary(); |
783 int entry = dictionary->FindEntry(index); | 789 int entry = dictionary->FindEntry(index); |
784 ASSERT(entry != NumberDictionary::kNotFound); | 790 ASSERT(entry != NumberDictionary::kNotFound); |
785 PropertyDetails details = dictionary->DetailsAt(entry); | 791 PropertyDetails details = dictionary->DetailsAt(entry); |
786 switch (details.type()) { | 792 switch (details.type()) { |
787 case CALLBACKS: { | 793 case CALLBACKS: { |
788 // This is an accessor property with getter and/or setter. | 794 // This is an accessor property with getter and/or setter. |
789 FixedArray* callbacks = | 795 FixedArray* callbacks = |
790 FixedArray::cast(dictionary->ValueAt(entry)); | 796 FixedArray::cast(dictionary->ValueAt(entry)); |
791 elms->set(IS_ACCESSOR_INDEX, Heap::true_value()); | 797 elms->set(IS_ACCESSOR_INDEX, Heap::true_value()); |
(...skipping 10198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10990 } else { | 10996 } else { |
10991 // Handle last resort GC and make sure to allow future allocations | 10997 // Handle last resort GC and make sure to allow future allocations |
10992 // to grow the heap without causing GCs (if possible). | 10998 // to grow the heap without causing GCs (if possible). |
10993 Counters::gc_last_resort_from_js.Increment(); | 10999 Counters::gc_last_resort_from_js.Increment(); |
10994 Heap::CollectAllGarbage(false); | 11000 Heap::CollectAllGarbage(false); |
10995 } | 11001 } |
10996 } | 11002 } |
10997 | 11003 |
10998 | 11004 |
10999 } } // namespace v8::internal | 11005 } } // namespace v8::internal |
OLD | NEW |