Commit bb6958ce authored by yangguo's avatar yangguo Committed by Commit bot

Revert of Always optimize for adding properties to native objects. (patchset...

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

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

Cr-Commit-Position: refs/heads/master@{#28009}
parent aec46ca5
......@@ -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];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment