[INFER] Check for heavyweight functions when deciding to inline, bug 645645.
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 29 Mar 2011 06:39:09 -0700
changeset 74862 85c24589029cbf7d4bc4e1b6b40d006c23303e58
parent 74861 6acd5754040b1919189d86de431058c91e3625f9
child 74863 f6a77f725bbca8a3b25038a400c092cf9b2645fa
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
bugs645645
milestone2.0b13pre
[INFER] Check for heavyweight functions when deciding to inline, bug 645645.
js/src/jit-test/tests/jaeger/inline/bug645645.js
js/src/jsanalyze.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/jaeger/inline/bug645645.js
@@ -0,0 +1,4 @@
+function f() {
+    f = Math.x;
+}
+f();
--- a/js/src/jsanalyze.cpp
+++ b/js/src/jsanalyze.cpp
@@ -304,16 +304,17 @@ Script::analyze(JSContext *cx, JSScript 
      * If the script is in debug mode, JS_SetFrameReturnValue can be called at
      * any safe point.
      */
     if (cx->compartment->debugMode)
         usesRval = true;
 
     isInlineable = true;
     if (script->nClosedArgs || script->nClosedVars ||
+        (script->fun && script->fun->isHeavyweight()) ||
         script->usesEval || script->usesArguments || cx->compartment->debugMode) {
         isInlineable = false;
     }
 
     /*
      * If we are in the middle of one or more jumps, the offset of the highest
      * target jumping over this bytecode.  Includes implicit jumps from
      * try/catch/finally blocks.