Bug 1279129 - Should schedule delazification for Debugger when relazifying scripts. r=jandem
authorEddy Bruel <ejpbruel@mozilla.com>
Tue, 19 Jul 2016 17:41:32 +0200
changeset 330785 81cb60fb8fbd8ef529f2a2c21852888b5fdab88b
parent 330784 340f2259b820df20fe88a489763c9f82eb4918b0
child 330786 71f037e18d18d1b5241d31e27f8cbb987a21230a
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1279129
milestone50.0a1
Bug 1279129 - Should schedule delazification for Debugger when relazifying scripts. r=jandem
js/src/jit-test/tests/debug/Debugger-findScripts-23.js
js/src/jsfun.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/debug/Debugger-findScripts-23.js
@@ -0,0 +1,19 @@
+// If a script is (re)lazified, findScripts should delazify it.
+
+var dbg = new Debugger();
+
+var g = newGlobal();
+g.eval('function f(){}');
+assertEq(g.eval('isLazyFunction(f)'), true);
+
+dbg.addDebuggee(g);
+dbg.findScripts();
+assertEq(g.eval('isLazyFunction(f)'), false);
+
+dbg.removeAllDebuggees();
+relazifyFunctions();
+assertEq(g.eval('isLazyFunction(f)'), true);
+
+dbg.addDebuggee(g);
+var scripts = dbg.findScripts();
+assertEq(g.eval('isLazyFunction(f)'), false);
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -1776,16 +1776,18 @@ JSFunction::maybeRelazify(JSRuntime* rt)
     u.i.s.lazy_ = lazy;
     if (lazy) {
         MOZ_ASSERT(!isSelfHostedBuiltin());
     } else {
         MOZ_ASSERT(isSelfHostedBuiltin());
         MOZ_ASSERT(isExtended());
         MOZ_ASSERT(getExtendedSlot(LAZY_FUNCTION_NAME_SLOT).toString()->isAtom());
     }
+
+    comp->scheduleDelazificationForDebugger();
 }
 
 static bool
 fun_isGenerator(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     JSFunction* fun;
     if (!IsFunctionObject(args.thisv(), &fun)) {