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

Unified Diff: src/handles.cc

Issue 160382: Avoid dictionary expansion during bootstrapping (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 5 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/handles.h ('k') | src/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles.cc
===================================================================
--- src/handles.cc (revision 2578)
+++ src/handles.cc (working copy)
@@ -164,8 +164,11 @@
void NormalizeProperties(Handle<JSObject> object,
- PropertyNormalizationMode mode) {
- CALL_HEAP_FUNCTION_VOID(object->NormalizeProperties(mode));
+ PropertyNormalizationMode mode,
+ int expected_additional_properties) {
+ CALL_HEAP_FUNCTION_VOID(object->NormalizeProperties(
+ mode,
+ expected_additional_properties));
}
@@ -651,13 +654,17 @@
OptimizedObjectForAddingMultipleProperties::
OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object,
+ int expected_additional_properties,
bool condition) {
object_ = object;
if (condition && object_->HasFastProperties()) {
// Normalize the properties of object to avoid n^2 behavior
- // when extending the object multiple properties.
+ // when extending the object multiple properties. Indicate the number of
+ // properties to be added.
unused_property_fields_ = object->map()->unused_property_fields();
- NormalizeProperties(object_, KEEP_INOBJECT_PROPERTIES);
+ NormalizeProperties(object_,
+ KEEP_INOBJECT_PROPERTIES,
+ expected_additional_properties);
has_been_transformed_ = true;
} else {
« no previous file with comments | « src/handles.h ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698