Reviewers: Mads Ager,

Description:
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.

Please review this at http://codereview.chromium.org/164479

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/math.js
   M     src/v8natives.js


Index: src/v8natives.js
===================================================================
--- src/v8natives.js    (revision 2682)
+++ src/v8natives.js    (working copy)
@@ -457,8 +457,8 @@
  //  
----------------------------------------------------------------------------

  function SetupNumber() {
+  %OptimizeObjectForAddingMultipleProperties($Number.prototype, 8);
    // Setup the constructor property on the Number prototype object.
-  %OptimizeObjectForAddingMultipleProperties($Number.prototype, 8);
    %SetProperty($Number.prototype, "constructor", $Number, DONT_ENUM);

    %OptimizeObjectForAddingMultipleProperties($Number, 5);
@@ -485,6 +485,7 @@
                 "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(
Index: src/math.js
===================================================================
--- src/math.js (revision 2682)
+++ src/math.js (working copy)
@@ -184,7 +184,7 @@
  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 @@
                 "SQRT2",
                 1.4142135623730951,
                 DONT_ENUM |  DONT_DELETE | READ_ONLY);
+  %TransformToFastProperties($Math);

    // Setup non-enumerable functions of the Math object and
    // set their names.



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to