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

Side by Side Diff: src/runtime.cc

Issue 7860043: Merge r9213 into the 3.4 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.4/
Patch Set: Created 9 years, 3 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
« no previous file with comments | « src/objects.cc ('k') | src/version.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3930 matching lines...) Expand 10 before | Expand all | Expand 10 after
3941 // Normalize the elements to enable attributes on the property. 3941 // Normalize the elements to enable attributes on the property.
3942 if (js_object->IsJSGlobalProxy()) { 3942 if (js_object->IsJSGlobalProxy()) {
3943 // We do not need to do access checks here since these has already 3943 // We do not need to do access checks here since these has already
3944 // been performed by the call to GetOwnProperty. 3944 // been performed by the call to GetOwnProperty.
3945 Handle<Object> proto(js_object->GetPrototype()); 3945 Handle<Object> proto(js_object->GetPrototype());
3946 // If proxy is detached, ignore the assignment. Alternatively, 3946 // If proxy is detached, ignore the assignment. Alternatively,
3947 // we could throw an exception. 3947 // we could throw an exception.
3948 if (proto->IsNull()) return *obj_value; 3948 if (proto->IsNull()) return *obj_value;
3949 js_object = Handle<JSObject>::cast(proto); 3949 js_object = Handle<JSObject>::cast(proto);
3950 } 3950 }
3951
3952 // Don't allow element properties to be redefined on objects with external
3953 // array elements.
3954 if (js_object->HasExternalArrayElements()) {
3955 Handle<Object> args[2] = { js_object, name };
3956 Handle<Object> error =
3957 isolate->factory()->NewTypeError("redef_external_array_element",
3958 HandleVector(args, 2));
3959 return isolate->Throw(*error);
3960 }
3961
3951 Handle<NumberDictionary> dictionary = NormalizeElements(js_object); 3962 Handle<NumberDictionary> dictionary = NormalizeElements(js_object);
3952 // Make sure that we never go back to fast case. 3963 // Make sure that we never go back to fast case.
3953 dictionary->set_requires_slow_elements(); 3964 dictionary->set_requires_slow_elements();
3954 PropertyDetails details = PropertyDetails(attr, NORMAL); 3965 PropertyDetails details = PropertyDetails(attr, NORMAL);
3955 Handle<NumberDictionary> extended_dictionary = 3966 Handle<NumberDictionary> extended_dictionary =
3956 NumberDictionarySet(dictionary, index, obj_value, details); 3967 NumberDictionarySet(dictionary, index, obj_value, details);
3957 if (*extended_dictionary != *dictionary) { 3968 if (*extended_dictionary != *dictionary) {
3958 if (js_object->GetElementsKind() == 3969 if (js_object->GetElementsKind() ==
3959 JSObject::NON_STRICT_ARGUMENTS_ELEMENTS) { 3970 JSObject::NON_STRICT_ARGUMENTS_ELEMENTS) {
3960 FixedArray::cast(js_object->elements())->set(1, *extended_dictionary); 3971 FixedArray::cast(js_object->elements())->set(1, *extended_dictionary);
(...skipping 8754 matching lines...) Expand 10 before | Expand all | Expand 10 after
12715 } else { 12726 } else {
12716 // Handle last resort GC and make sure to allow future allocations 12727 // Handle last resort GC and make sure to allow future allocations
12717 // to grow the heap without causing GCs (if possible). 12728 // to grow the heap without causing GCs (if possible).
12718 isolate->counters()->gc_last_resort_from_js()->Increment(); 12729 isolate->counters()->gc_last_resort_from_js()->Increment();
12719 isolate->heap()->CollectAllGarbage(false); 12730 isolate->heap()->CollectAllGarbage(false);
12720 } 12731 }
12721 } 12732 }
12722 12733
12723 12734
12724 } } // namespace v8::internal 12735 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698