OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3918 if (proto->IsNull()) return *obj_value; | 3918 if (proto->IsNull()) return *obj_value; |
3919 js_object = Handle<JSObject>::cast(proto); | 3919 js_object = Handle<JSObject>::cast(proto); |
3920 } | 3920 } |
3921 Handle<NumberDictionary> dictionary = NormalizeElements(js_object); | 3921 Handle<NumberDictionary> dictionary = NormalizeElements(js_object); |
3922 // Make sure that we never go back to fast case. | 3922 // Make sure that we never go back to fast case. |
3923 dictionary->set_requires_slow_elements(); | 3923 dictionary->set_requires_slow_elements(); |
3924 PropertyDetails details = PropertyDetails(attr, NORMAL); | 3924 PropertyDetails details = PropertyDetails(attr, NORMAL); |
3925 Handle<NumberDictionary> extended_dictionary = | 3925 Handle<NumberDictionary> extended_dictionary = |
3926 NumberDictionarySet(dictionary, index, obj_value, details); | 3926 NumberDictionarySet(dictionary, index, obj_value, details); |
3927 if (*extended_dictionary != *dictionary) { | 3927 if (*extended_dictionary != *dictionary) { |
3928 js_object->set_elements(*extended_dictionary); | 3928 if (js_object->GetElementsKind() == |
| 3929 JSObject::NON_STRICT_ARGUMENTS_ELEMENTS) { |
| 3930 FixedArray::cast(js_object->elements())->set(1, *extended_dictionary); |
| 3931 } else { |
| 3932 js_object->set_elements(*extended_dictionary); |
| 3933 } |
3929 } | 3934 } |
3930 return *obj_value; | 3935 return *obj_value; |
3931 } | 3936 } |
3932 | 3937 |
3933 LookupResult result; | 3938 LookupResult result; |
3934 js_object->LocalLookupRealNamedProperty(*name, &result); | 3939 js_object->LocalLookupRealNamedProperty(*name, &result); |
3935 | 3940 |
3936 // To be compatible with safari we do not change the value on API objects | 3941 // To be compatible with safari we do not change the value on API objects |
3937 // in defineProperty. Firefox disagrees here, and actually changes the value. | 3942 // in defineProperty. Firefox disagrees here, and actually changes the value. |
3938 if (result.IsProperty() && | 3943 if (result.IsProperty() && |
(...skipping 8608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12547 } else { | 12552 } else { |
12548 // Handle last resort GC and make sure to allow future allocations | 12553 // Handle last resort GC and make sure to allow future allocations |
12549 // to grow the heap without causing GCs (if possible). | 12554 // to grow the heap without causing GCs (if possible). |
12550 isolate->counters()->gc_last_resort_from_js()->Increment(); | 12555 isolate->counters()->gc_last_resort_from_js()->Increment(); |
12551 isolate->heap()->CollectAllGarbage(false); | 12556 isolate->heap()->CollectAllGarbage(false); |
12552 } | 12557 } |
12553 } | 12558 } |
12554 | 12559 |
12555 | 12560 |
12556 } } // namespace v8::internal | 12561 } } // namespace v8::internal |
OLD | NEW |