[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 75878 85c24589029cbf7d4bc4e1b6b40d006c23303e58
parent 75877 6acd5754040b1919189d86de431058c91e3625f9
child 75879 f6a77f725bbca8a3b25038a400c092cf9b2645fa
push id67
push userclegnitto@mozilla.com
push dateFri, 04 Nov 2011 22:39:41 +0000
treeherdermozilla-release@04778346a3b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs645645
milestone2.0b13pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
[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.