From 9373ca76ed211ecc626f0ac411c420ed30092fe3 Mon Sep 17 00:00:00 2001 From: "whesse@chromium.org" Date: Thu, 13 Aug 2009 14:04:49 +0000 Subject: [PATCH] erikcorry: Remember to put objects back in fast case after adding functions. P.S. for reasons unknown the original change (2681), also by erikcorry, was attributed to Bill. Review URL: http://codereview.chromium.org/164479 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2684 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/math.js | 3 ++- src/v8natives.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/math.js b/src/math.js index 91bf206..e3d266e 100644 --- a/src/math.js +++ b/src/math.js @@ -184,7 +184,7 @@ function MathTan(x) { function SetupMath() { // Setup math constants. // ECMA-262, section 15.8.1.1. - %OptimizeObjectForAddingMultipleProperties($Math, 26); + %OptimizeObjectForAddingMultipleProperties($Math, 8); %SetProperty($Math, "E", 2.7182818284590452354, @@ -220,6 +220,7 @@ function SetupMath() { "SQRT2", 1.4142135623730951, DONT_ENUM | DONT_DELETE | READ_ONLY); + %TransformToFastProperties($Math); // Setup non-enumerable functions of the Math object and // set their names. diff --git a/src/v8natives.js b/src/v8natives.js index 605df49..be92347 100644 --- a/src/v8natives.js +++ b/src/v8natives.js @@ -457,8 +457,8 @@ function NumberToJSON(key) { // ---------------------------------------------------------------------------- function SetupNumber() { - // Setup the constructor property on the Number prototype object. %OptimizeObjectForAddingMultipleProperties($Number.prototype, 8); + // Setup the constructor property on the Number prototype object. %SetProperty($Number.prototype, "constructor", $Number, DONT_ENUM); %OptimizeObjectForAddingMultipleProperties($Number, 5); @@ -485,6 +485,7 @@ function SetupNumber() { "POSITIVE_INFINITY", 1/0, DONT_ENUM | DONT_DELETE | READ_ONLY); + %TransformToFastProperties($Number); // Setup non-enumerable functions on the Number prototype object. InstallFunctions($Number.prototype, DONT_ENUM, $Array( -- 2.7.4