Revision: 9152
Author:   [email protected]
Date:     Tue Sep  6 07:03:32 2011
Log: Fix map space explosion from changing the arguments and caller properties on native functions.

Adding these local properties on all native functions made us do a
ConvertDescriptorToField on the callback on each and every native
functions, resulting in us creating an extra map for each of these.
Review URL: http://codereview.chromium.org/7779046
http://code.google.com/p/v8/source/detail?r=9152

Modified:
 /branches/bleeding_edge/src/accessors.cc
 /branches/bleeding_edge/src/v8natives.js

=======================================
--- /branches/bleeding_edge/src/accessors.cc    Thu Aug 25 06:38:58 2011
+++ /branches/bleeding_edge/src/accessors.cc    Tue Sep  6 07:03:32 2011
@@ -599,6 +599,7 @@
   if (!found_it) return isolate->heap()->undefined_value();
   Handle<JSFunction> function(holder, isolate);

+  if (function->shared()->native()) return isolate->heap()->null_value();
   // Find the top invocation of the function by traversing frames.
   List<JSFunction*> functions(2);
   for (JavaScriptFrameIterator it(isolate); !it.done(); it.Advance()) {
@@ -732,6 +733,7 @@
   bool found_it = false;
   JSFunction* holder = FindInPrototypeChain<JSFunction>(object, &found_it);
   if (!found_it) return isolate->heap()->undefined_value();
+  if (holder->shared()->native()) return isolate->heap()->null_value();
   Handle<JSFunction> function(holder, isolate);

   FrameFunctionIterator it(isolate, no_alloc);
=======================================
--- /branches/bleeding_edge/src/v8natives.js    Mon Sep  5 04:08:57 2011
+++ /branches/bleeding_edge/src/v8natives.js    Tue Sep  6 07:03:32 2011
@@ -54,15 +54,6 @@
     var f = functions[i + 1];
     %FunctionSetName(f, key);
     %FunctionRemovePrototype(f);
-    // We match firefox on this, but not Safari (which does not have the
-    // property at all).
-    %IgnoreAttributesAndSetProperty(f, "caller",
-                                    null,
-                                    DONT_ENUM | DONT_DELETE);
-    %IgnoreAttributesAndSetProperty(f, "arguments",
-                                    null,
-                                    DONT_ENUM | DONT_DELETE);
-
     %SetProperty(object, key, f, attributes);
     %SetNativeFlag(f);
   }

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

Reply via email to