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

Unified Diff: src/handles.cc

Issue 6441: - Added fast case for extending the JSObject properties storage.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/date-delay.js ('k') | src/ic.h » ('j') | src/ic.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles.cc
===================================================================
--- src/handles.cc (revision 415)
+++ src/handles.cc (working copy)
@@ -86,21 +86,26 @@
}
-void SetExpectedNofPropertiesFromEstimate(Handle<SharedFunctionInfo> shared,
- int estimate) {
+static int ExpectedNofPropertiesFromEstimate(int estimate) {
// TODO(1231235): We need dynamic feedback to estimate the number
// of expected properties in an object. The static hack below
// is barely a solution.
- shared->set_expected_nof_properties(estimate + 2);
+ if (estimate == 0) return 4;
+ return estimate + 2;
}
+void SetExpectedNofPropertiesFromEstimate(Handle<SharedFunctionInfo> shared,
+ int estimate) {
+ shared->set_expected_nof_properties(
+ ExpectedNofPropertiesFromEstimate(estimate));
+}
+
+
void SetExpectedNofPropertiesFromEstimate(Handle<JSFunction> func,
int estimate) {
- // TODO(1231235): We need dynamic feedback to estimate the number
- // of expected properties in an object. The static hack below
- // is barely a solution.
- SetExpectedNofProperties(func, estimate + 2);
+ SetExpectedNofProperties(
+ func, ExpectedNofPropertiesFromEstimate(estimate));
}
« no previous file with comments | « src/date-delay.js ('k') | src/ic.h » ('j') | src/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698