2008-10-17 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Oct 2008 22:26:44 +0000 (22:26 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Oct 2008 22:26:44 +0000 (22:26 +0000)
        Reviewed by Cameron Zwarich

        - don't bother to do arguments tearoff when it will have no effect

        ~1% on v8 raytrace

        * VM/CodeGenerator.cpp:
        (JSC::CodeGenerator::emitReturn):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37664 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/VM/CodeGenerator.cpp

index 58b612fe95b1e37925a0f8f2d1989638153c771f..330e71704b5fbe2758385ccabf8f3315198a4b6d 100644 (file)
@@ -1,3 +1,14 @@
+2008-10-17  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Cameron Zwarich
+        
+        - don't bother to do arguments tearoff when it will have no effect
+
+        ~1% on v8 raytrace
+        
+        * VM/CodeGenerator.cpp:
+        (JSC::CodeGenerator::emitReturn):
+
 2008-10-17  Marco Barisione  <marco.barisione@collabora.co.uk>
 
         Reviewed by Sam Weinig. Landed by Jan Alonzo.
 2008-10-17  Marco Barisione  <marco.barisione@collabora.co.uk>
 
         Reviewed by Sam Weinig. Landed by Jan Alonzo.
index 0f7b5370e1114e8fdbbdd5e42d369d5ea5f61b78..4cfa7d78bde1ffe7cb167f4fc6ee5fc714e746d6 100644 (file)
@@ -1168,7 +1168,7 @@ RegisterID* CodeGenerator::emitReturn(RegisterID* src)
     if (m_codeBlock->needsFullScopeChain) {
         emitOpcode(op_tear_off_activation);
         instructions().append(m_activationRegisterIndex);
     if (m_codeBlock->needsFullScopeChain) {
         emitOpcode(op_tear_off_activation);
         instructions().append(m_activationRegisterIndex);
-    } else if (m_codeBlock->usesArguments)
+    } else if (m_codeBlock->usesArguments && m_codeBlock->numParameters > 1)
         emitOpcode(op_tear_off_arguments);
 
     return emitUnaryNoDstOp(op_ret, src);
         emitOpcode(op_tear_off_arguments);
 
     return emitUnaryNoDstOp(op_ret, src);