Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: src/runtime.cc

Issue 6778008: [Arguments] Support getters and setters on non-strict arguments objects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« src/objects.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 } 872 }
873 873
874 case JSObject::DICTIONARY_ELEMENT: { 874 case JSObject::DICTIONARY_ELEMENT: {
875 Handle<JSObject> holder = obj; 875 Handle<JSObject> holder = obj;
876 if (obj->IsJSGlobalProxy()) { 876 if (obj->IsJSGlobalProxy()) {
877 Object* proto = obj->GetPrototype(); 877 Object* proto = obj->GetPrototype();
878 if (proto->IsNull()) return heap->undefined_value(); 878 if (proto->IsNull()) return heap->undefined_value();
879 ASSERT(proto->IsJSGlobalObject()); 879 ASSERT(proto->IsJSGlobalObject());
880 holder = Handle<JSObject>(JSObject::cast(proto)); 880 holder = Handle<JSObject>(JSObject::cast(proto));
881 } 881 }
882 NumberDictionary* dictionary = holder->element_dictionary(); 882 FixedArray* elements = FixedArray::cast(holder->elements());
883 NumberDictionary* dictionary = NULL;
884 if (elements->map() == heap->non_strict_arguments_elements_map()) {
885 dictionary = NumberDictionary::cast(elements->get(1));
886 } else {
887 dictionary = NumberDictionary::cast(elements);
888 }
883 int entry = dictionary->FindEntry(index); 889 int entry = dictionary->FindEntry(index);
884 ASSERT(entry != NumberDictionary::kNotFound); 890 ASSERT(entry != NumberDictionary::kNotFound);
885 PropertyDetails details = dictionary->DetailsAt(entry); 891 PropertyDetails details = dictionary->DetailsAt(entry);
886 switch (details.type()) { 892 switch (details.type()) {
887 case CALLBACKS: { 893 case CALLBACKS: {
888 // This is an accessor property with getter and/or setter. 894 // This is an accessor property with getter and/or setter.
889 FixedArray* callbacks = 895 FixedArray* callbacks =
890 FixedArray::cast(dictionary->ValueAt(entry)); 896 FixedArray::cast(dictionary->ValueAt(entry));
891 elms->set(IS_ACCESSOR_INDEX, heap->true_value()); 897 elms->set(IS_ACCESSOR_INDEX, heap->true_value());
892 if (CheckElementAccess(*obj, index, v8::ACCESS_GET)) { 898 if (CheckElementAccess(*obj, index, v8::ACCESS_GET)) {
(...skipping 11404 matching lines...) Expand 10 before | Expand all | Expand 10 after
12297 } else { 12303 } else {
12298 // Handle last resort GC and make sure to allow future allocations 12304 // Handle last resort GC and make sure to allow future allocations
12299 // to grow the heap without causing GCs (if possible). 12305 // to grow the heap without causing GCs (if possible).
12300 COUNTERS->gc_last_resort_from_js()->Increment(); 12306 COUNTERS->gc_last_resort_from_js()->Increment();
12301 HEAP->CollectAllGarbage(false); 12307 HEAP->CollectAllGarbage(false);
12302 } 12308 }
12303 } 12309 }
12304 12310
12305 12311
12306 } } // namespace v8::internal 12312 } } // namespace v8::internal
OLDNEW
« src/objects.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698