From 616bc79533b4b95279cb4c0058ecd15e93fb04b1 Mon Sep 17 00:00:00 2001 From: yangguo Date: Wed, 22 Apr 2015 07:14:01 -0700 Subject: [PATCH] Revert of Revert of Always optimize for adding properties to native objects. (patchset #1 id:1 of https://codereview.chromium.org/1098223004/) Reason for revert: Test failure was not due to this. Original issue's description: > Revert of Always optimize for adding properties to native objects. (patchset #1 id:1 of https://codereview.chromium.org/1094383004/) > > 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 > > Committed: https://crrev.com/bb6958ceff221e66adbc4581471a8ce1b41a4684 > Cr-Commit-Position: refs/heads/master@{#28009} TBR=jkummerow@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1100123002 Cr-Commit-Position: refs/heads/master@{#28011} --- src/v8natives.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/v8natives.js b/src/v8natives.js index 9eaf5d4ba05..41453d0b536 100644 --- a/src/v8natives.js +++ b/src/v8natives.js @@ -17,9 +17,7 @@ var $isFinite = GlobalIsFinite; // Helper function used to install functions on objects. function InstallFunctions(object, attributes, functions) { - if (functions.length >= 8) { - %OptimizeObjectForAddingMultipleProperties(object, functions.length >> 1); - } + %OptimizeObjectForAddingMultipleProperties(object, functions.length >> 1); for (var i = 0; i < functions.length; i += 2) { var key = functions[i]; var f = functions[i + 1]; @@ -69,9 +67,7 @@ function InstallGetterSetter(object, name, getter, setter) { // Helper function for installing constant properties on objects. function InstallConstants(object, constants) { - if (constants.length >= 4) { - %OptimizeObjectForAddingMultipleProperties(object, constants.length >> 1); - } + %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];