Reviewers: Mads Ager, Description: Remove duplicate function from runtime.
Please review this at http://codereview.chromium.org/620003 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/math.js M src/runtime.h M src/runtime.cc M src/v8natives.js Index: src/v8natives.js =================================================================== --- src/v8natives.js (revision 3882) +++ src/v8natives.js (working copy) @@ -56,7 +56,7 @@ %FunctionSetName(f, key); %SetProperty(object, key, f, attributes); } - %TransformToFastProperties(object); + %ToFastProperties(object); } // Emulates JSC by installing functions on a hidden prototype that @@ -914,7 +914,7 @@ "POSITIVE_INFINITY", 1/0, DONT_ENUM | DONT_DELETE | READ_ONLY); - %TransformToFastProperties($Number); + %ToFastProperties($Number); // Setup non-enumerable functions on the Number prototype object. InstallFunctions($Number.prototype, DONT_ENUM, $Array( Index: src/runtime.cc =================================================================== --- src/runtime.cc (revision 3882) +++ src/runtime.cc (working copy) @@ -1208,17 +1208,6 @@ } -static Object* Runtime_TransformToFastProperties(Arguments args) { - HandleScope scope; - ASSERT(args.length() == 1); - CONVERT_ARG_CHECKED(JSObject, object, 0); - if (!object->HasFastProperties() && !object->IsGlobalObject()) { - TransformToFastProperties(object, 0); - } - return *object; -} - - static Object* Runtime_RegExpExec(Arguments args) { HandleScope scope; ASSERT(args.length() == 4); @@ -3520,17 +3509,23 @@ static Object* Runtime_ToFastProperties(Arguments args) { + HandleScope scope; + ASSERT(args.length() == 1); Handle<Object> object = args.at<Object>(0); if (object->IsJSObject()) { Handle<JSObject> js_object = Handle<JSObject>::cast(object); - js_object->TransformToFastProperties(0); + if (!js_object->HasFastProperties() && !js_object->IsGlobalObject()) { + js_object->TransformToFastProperties(0); + } } return *object; } static Object* Runtime_ToSlowProperties(Arguments args) { + HandleScope scope; + ASSERT(args.length() == 1); Handle<Object> object = args.at<Object>(0); if (object->IsJSObject()) { Index: src/runtime.h =================================================================== --- src/runtime.h (revision 3882) +++ src/runtime.h (working copy) @@ -266,7 +266,6 @@ F(InitializeConstGlobal, 2, 1) \ F(InitializeConstContextSlot, 3, 1) \ F(OptimizeObjectForAddingMultipleProperties, 2, 1) \ - F(TransformToFastProperties, 1, 1) \ \ /* Debugging */ \ F(DebugPrint, 1, 1) \ Index: src/math.js =================================================================== --- src/math.js (revision 3882) +++ src/math.js (working copy) @@ -233,7 +233,7 @@ "SQRT2", 1.4142135623730951, DONT_ENUM | DONT_DELETE | READ_ONLY); - %TransformToFastProperties($Math); + %ToFastProperties($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
