Revert of Always optimize for adding properties to native objects. (patchset #1 id...
authoryangguo <yangguo@chromium.org>
Wed, 22 Apr 2015 13:23:43 +0000 (06:23 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 22 Apr 2015 13:23:26 +0000 (13:23 +0000)
Reason for revert:
GC stress failure (custom snapshot)

Original issue's description:
> Always optimize for adding properties to native objects.
>
> R=jkummerow@chromium.org
>
> Committed: https://crrev.com/c715098e85b93def76c0b3f54290c811dea04f01
> Cr-Commit-Position: refs/heads/master@{#28003}

TBR=jkummerow@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1098223004

Cr-Commit-Position: refs/heads/master@{#28009}

src/v8natives.js

index 41453d0..9eaf5d4 100644 (file)
@@ -17,7 +17,9 @@ var $isFinite = GlobalIsFinite;
 
 // Helper function used to install functions on objects.
 function InstallFunctions(object, attributes, functions) {
-  %OptimizeObjectForAddingMultipleProperties(object, functions.length >> 1);
+  if (functions.length >= 8) {
+    %OptimizeObjectForAddingMultipleProperties(object, functions.length >> 1);
+  }
   for (var i = 0; i < functions.length; i += 2) {
     var key = functions[i];
     var f = functions[i + 1];
@@ -67,7 +69,9 @@ function InstallGetterSetter(object, name, getter, setter) {
 
 // Helper function for installing constant properties on objects.
 function InstallConstants(object, constants) {
-  %OptimizeObjectForAddingMultipleProperties(object, constants.length >> 1);
+  if (constants.length >= 4) {
+    %OptimizeObjectForAddingMultipleProperties(object, constants.length >> 1);
+  }
   var attributes = DONT_ENUM | DONT_DELETE | READ_ONLY;
   for (var i = 0; i < constants.length; i += 2) {
     var name = constants[i];