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

Side by Side Diff: src/handles.cc

Issue 3595002: Fine-tune inobject slack tracking.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 2 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.h » ('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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // If no properties are added in the constructor, they are more likely 168 // If no properties are added in the constructor, they are more likely
169 // to be added later. 169 // to be added later.
170 if (estimate == 0) estimate = 2; 170 if (estimate == 0) estimate = 2;
171 171
172 // We do not shrink objects that go into a snapshot (yet), so we adjust 172 // We do not shrink objects that go into a snapshot (yet), so we adjust
173 // the estimate conservatively. 173 // the estimate conservatively.
174 if (Serializer::enabled()) return estimate + 2; 174 if (Serializer::enabled()) return estimate + 2;
175 175
176 // Inobject slack tracking will reclaim redundant inobject space later, 176 // Inobject slack tracking will reclaim redundant inobject space later,
177 // so we can afford to adjust the estimate generously. 177 // so we can afford to adjust the estimate generously.
178 return estimate + 6; 178 return estimate + 8;
179 } 179 }
180 180
181 181
182 void SetExpectedNofPropertiesFromEstimate(Handle<SharedFunctionInfo> shared, 182 void SetExpectedNofPropertiesFromEstimate(Handle<SharedFunctionInfo> shared,
183 int estimate) { 183 int estimate) {
184 // See the comment in SetExpectedNofProperties. 184 // See the comment in SetExpectedNofProperties.
185 if (shared->live_objects_may_exist()) return; 185 if (shared->live_objects_may_exist()) return;
186 186
187 shared->set_expected_nof_properties( 187 shared->set_expected_nof_properties(
188 ExpectedNofPropertiesFromEstimate(estimate)); 188 ExpectedNofPropertiesFromEstimate(estimate));
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 837
838 OptimizedObjectForAddingMultipleProperties:: 838 OptimizedObjectForAddingMultipleProperties::
839 ~OptimizedObjectForAddingMultipleProperties() { 839 ~OptimizedObjectForAddingMultipleProperties() {
840 // Reoptimize the object to allow fast property access. 840 // Reoptimize the object to allow fast property access.
841 if (has_been_transformed_) { 841 if (has_been_transformed_) {
842 TransformToFastProperties(object_, unused_property_fields_); 842 TransformToFastProperties(object_, unused_property_fields_);
843 } 843 }
844 } 844 }
845 845
846 } } // namespace v8::internal 846 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698