Skip to content

Commit

Permalink
Revert of Always optimize for adding properties to native objects. (p…
Browse files Browse the repository at this point in the history
…atchset #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}
  • Loading branch information
hashseed authored and Commit bot committed Apr 22, 2015
1 parent aec46ca commit bb6958c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/v8natives.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit bb6958c

Please sign in to comment.