erikcorry: Remember to put objects back in fast case after adding functions.
authorwhesse@chromium.org <whesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 13 Aug 2009 14:04:49 +0000 (14:04 +0000)
committerwhesse@chromium.org <whesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 13 Aug 2009 14:04:49 +0000 (14:04 +0000)
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
src/v8natives.js

index 91bf206..e3d266e 100644 (file)
@@ -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.
index 605df49..be92347 100644 (file)
@@ -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(