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

Side by Side Diff: src/runtime.cc

Issue 6694021: Merge revision 6179 to trunk (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 9 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 | « no previous file | 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 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 3744 matching lines...) Expand 10 before | Expand all | Expand 10 after
3755 // Make sure that we never go back to fast case. 3755 // Make sure that we never go back to fast case.
3756 dictionary->set_requires_slow_elements(); 3756 dictionary->set_requires_slow_elements();
3757 PropertyDetails details = PropertyDetails(attr, NORMAL); 3757 PropertyDetails details = PropertyDetails(attr, NORMAL);
3758 NumberDictionarySet(dictionary, index, obj_value, details); 3758 NumberDictionarySet(dictionary, index, obj_value, details);
3759 return *obj_value; 3759 return *obj_value;
3760 } 3760 }
3761 3761
3762 LookupResult result; 3762 LookupResult result;
3763 js_object->LookupRealNamedProperty(*name, &result); 3763 js_object->LookupRealNamedProperty(*name, &result);
3764 3764
3765 // To be compatible with safari we do not change the value on API objects
3766 // in defineProperty. Firefox disagrees here, and actually changes the value.
3767 if (result.IsProperty() &&
3768 (result.type() == CALLBACKS) &&
3769 result.GetCallbackObject()->IsAccessorInfo()) {
3770 return Heap::undefined_value();
3771 }
3772
3765 // Take special care when attributes are different and there is already 3773 // Take special care when attributes are different and there is already
3766 // a property. For simplicity we normalize the property which enables us 3774 // a property. For simplicity we normalize the property which enables us
3767 // to not worry about changing the instance_descriptor and creating a new 3775 // to not worry about changing the instance_descriptor and creating a new
3768 // map. The current version of SetObjectProperty does not handle attributes 3776 // map. The current version of SetObjectProperty does not handle attributes
3769 // correctly in the case where a property is a field and is reset with 3777 // correctly in the case where a property is a field and is reset with
3770 // new attributes. 3778 // new attributes.
3771 if (result.IsProperty() && 3779 if (result.IsProperty() &&
3772 (attr != result.GetAttributes() || result.type() == CALLBACKS)) { 3780 (attr != result.GetAttributes() || result.type() == CALLBACKS)) {
3773 // New attributes - normalize to avoid writing to instance descriptor 3781 // New attributes - normalize to avoid writing to instance descriptor
3774 if (js_object->IsJSGlobalProxy()) { 3782 if (js_object->IsJSGlobalProxy()) {
(...skipping 7850 matching lines...) Expand 10 before | Expand all | Expand 10 after
11625 } else { 11633 } else {
11626 // Handle last resort GC and make sure to allow future allocations 11634 // Handle last resort GC and make sure to allow future allocations
11627 // to grow the heap without causing GCs (if possible). 11635 // to grow the heap without causing GCs (if possible).
11628 Counters::gc_last_resort_from_js.Increment(); 11636 Counters::gc_last_resort_from_js.Increment();
11629 Heap::CollectAllGarbage(false); 11637 Heap::CollectAllGarbage(false);
11630 } 11638 }
11631 } 11639 }
11632 11640
11633 11641
11634 } } // namespace v8::internal 11642 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698