Avoid heap allocating the root scope chain node for eval and closure free functions
[WebKit.git] / JavaScriptCore / ChangeLog
index 8e69e1d4c55a563d6fa63d0fb4d0809e3efea43b..e4d6d1851d4fa68bc46162e51f0ae4e9c6aa28e1 100644 (file)
@@ -1,3 +1,20 @@
+2008-03-19  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Maciej.
+
+        Avoid heap allocating the root scope chain node for eval and closure free functions
+
+        Maciej suggested using an inline ScopeChainNode for functions that don't use eval
+        or closures as they are unable to ever capture the scope chain.  This gives us a 2.4%
+        win in sunspider, a 15% win in controlflow-recursive, and big (>5%) wins in a number 
+        of other tests.
+
+        * kjs/ExecState.cpp:
+        (KJS::ExecState::ExecState):
+        * kjs/ExecState.h:
+        * kjs/scope_chain.h:
+        (KJS::ScopeChain::push):
+
 2008-03-19  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Sam Weinig.