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

Side by Side Diff: src/handles.cc

Issue 6479012: Merge revision 6627 to the 3.0 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.0/
Patch Set: '' Created 9 years, 10 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/objects.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 if (result) PROFILE(FunctionCreateEvent(*function)); 867 if (result) PROFILE(FunctionCreateEvent(*function));
868 return result; 868 return result;
869 } 869 }
870 870
871 871
872 OptimizedObjectForAddingMultipleProperties:: 872 OptimizedObjectForAddingMultipleProperties::
873 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object, 873 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object,
874 int expected_additional_properties, 874 int expected_additional_properties,
875 bool condition) { 875 bool condition) {
876 object_ = object; 876 object_ = object;
877 if (condition && object_->HasFastProperties()) { 877 if (condition && object_->HasFastProperties() && !object->IsJSGlobalProxy()) {
878 // Normalize the properties of object to avoid n^2 behavior 878 // Normalize the properties of object to avoid n^2 behavior
879 // when extending the object multiple properties. Indicate the number of 879 // when extending the object multiple properties. Indicate the number of
880 // properties to be added. 880 // properties to be added.
881 unused_property_fields_ = object->map()->unused_property_fields(); 881 unused_property_fields_ = object->map()->unused_property_fields();
882 NormalizeProperties(object_, 882 NormalizeProperties(object_,
883 KEEP_INOBJECT_PROPERTIES, 883 KEEP_INOBJECT_PROPERTIES,
884 expected_additional_properties); 884 expected_additional_properties);
885 has_been_transformed_ = true; 885 has_been_transformed_ = true;
886 886
887 } else { 887 } else {
888 has_been_transformed_ = false; 888 has_been_transformed_ = false;
889 } 889 }
890 } 890 }
891 891
892 892
893 OptimizedObjectForAddingMultipleProperties:: 893 OptimizedObjectForAddingMultipleProperties::
894 ~OptimizedObjectForAddingMultipleProperties() { 894 ~OptimizedObjectForAddingMultipleProperties() {
895 // Reoptimize the object to allow fast property access. 895 // Reoptimize the object to allow fast property access.
896 if (has_been_transformed_) { 896 if (has_been_transformed_) {
897 TransformToFastProperties(object_, unused_property_fields_); 897 TransformToFastProperties(object_, unused_property_fields_);
898 } 898 }
899 } 899 }
900 900
901 } } // namespace v8::internal 901 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698