Bug 1600204 - Part 2: Remove Debugger.Frame.prototype.generator since it is already on script. r=jimb
authorLogan Smyth <loganfsmyth@gmail.com>
Fri, 06 Dec 2019 02:57:20 +0000
changeset 568138 73c33bf110d6034266cbe615b9e018476a128d63
parent 568137 d70ec1e7988710de0b79351f730a2498972cd7e0
child 568139 2828f072134e0425521de5ad9d60ae880c57e944
push id12493
push userffxbld-merge
push dateMon, 06 Jan 2020 15:38:57 +0000
treeherdermozilla-beta@63ae456b848d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimb
bugs1600204
milestone73.0a1
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
Bug 1600204 - Part 2: Remove Debugger.Frame.prototype.generator since it is already on script. r=jimb Differential Revision: https://phabricator.services.mozilla.com/D55232
devtools/server/actors/replay/debugger.js
devtools/server/actors/replay/replay.js
js/src/debugger/Frame.cpp
js/src/debugger/Frame.h
js/src/doc/Debugger/Debugger.Frame.md
js/src/jit-test/tests/binast/lazy/debug/Frame-01.binjs
js/src/jit-test/tests/binast/lazy/debug/breakpoint-11.binjs
js/src/jit-test/tests/binast/nonlazy/debug/Frame-01.binjs
js/src/jit-test/tests/binast/nonlazy/debug/breakpoint-11.binjs
js/src/jit-test/tests/debug/Frame-01.js
js/src/jit-test/tests/debug/Frame-onStack-03.js
js/src/jit-test/tests/debug/breakpoint-11.js
js/src/jit-test/tests/debug/onEnterFrame-generator-01.js
--- a/devtools/server/actors/replay/debugger.js
+++ b/devtools/server/actors/replay/debugger.js
@@ -1008,19 +1008,16 @@ ReplayDebuggerFrame.prototype = {
     return this._data.type;
   },
   get callee() {
     return this._pool.getObject(this._data.callee);
   },
   get environment() {
     return this._pool.getObject(this._data.environment);
   },
-  get generator() {
-    return this._data.generator;
-  },
   get constructing() {
     return this._data.constructing;
   },
   get this() {
     return this._pool.convertValue(this._data.this);
   },
   get script() {
     return this._dbg._getScript(this._data.script);
--- a/devtools/server/actors/replay/replay.js
+++ b/devtools/server/actors/replay/replay.js
@@ -1345,17 +1345,16 @@ function getFrameData(index) {
   }
 
   const script = gScripts.getId(frame.script);
   return {
     index,
     type: frame.type,
     callee: getObjectId(frame.callee),
     environment: getObjectId(frame.environment),
-    generator: frame.generator,
     constructing: frame.constructing,
     this: convertValue(frame.this),
     script,
     offset: frame.offset,
     arguments: _arguments,
   };
 }
 
--- a/js/src/debugger/Frame.cpp
+++ b/js/src/debugger/Frame.cpp
@@ -538,22 +538,16 @@ bool DebuggerFrame::getEnvironment(JSCon
       return false;
     }
   }
 
   return dbg->wrapEnvironment(cx, env, result);
 }
 
 /* static */
-bool DebuggerFrame::getIsGenerator(HandleDebuggerFrame frame) {
-  AbstractFramePtr referent = DebuggerFrame::getReferent(frame);
-  return referent.hasScript() && referent.script()->isGenerator();
-}
-
-/* static */
 bool DebuggerFrame::getOffset(JSContext* cx, HandleDebuggerFrame frame,
                               size_t& result) {
   if (frame->isOnStack()) {
     Maybe<FrameIter> maybeIter;
     if (!DebuggerFrame::getFrameIter(cx, frame, maybeIter)) {
       return false;
     }
     FrameIter& iter = *maybeIter;
@@ -1403,22 +1397,20 @@ bool DebuggerFrame::CallData::calleeGett
     return false;
   }
 
   args.rval().setObjectOrNull(result);
   return true;
 }
 
 bool DebuggerFrame::CallData::generatorGetter() {
-  if (!ensureOnStack()) {
-    return false;
-  }
-
-  args.rval().setBoolean(DebuggerFrame::getIsGenerator(frame));
-  return true;
+  JS_ReportErrorASCII(cx,
+                      "Debugger.Frame.prototype.generator has been removed. "
+                      "Use frame.script.isGeneratorFunction instead.");
+  return false;
 }
 
 bool DebuggerFrame::CallData::constructingGetter() {
   if (!ensureOnStack()) {
     return false;
   }
 
   bool result;
--- a/js/src/debugger/Frame.h
+++ b/js/src/debugger/Frame.h
@@ -158,17 +158,16 @@ class DebuggerFrame : public NativeObjec
   static MOZ_MUST_USE bool getCallee(JSContext* cx, HandleDebuggerFrame frame,
                                      MutableHandleDebuggerObject result);
   static MOZ_MUST_USE bool getIsConstructing(JSContext* cx,
                                              HandleDebuggerFrame frame,
                                              bool& result);
   static MOZ_MUST_USE bool getEnvironment(
       JSContext* cx, HandleDebuggerFrame frame,
       MutableHandleDebuggerEnvironment result);
-  static bool getIsGenerator(HandleDebuggerFrame frame);
   static MOZ_MUST_USE bool getOffset(JSContext* cx, HandleDebuggerFrame frame,
                                      size_t& result);
   static MOZ_MUST_USE bool getOlder(JSContext* cx, HandleDebuggerFrame frame,
                                     MutableHandleDebuggerFrame result);
   static MOZ_MUST_USE bool getAsyncPromise(JSContext* cx,
                                            HandleDebuggerFrame frame,
                                            MutableHandleDebuggerObject result);
   static MOZ_MUST_USE bool getThis(JSContext* cx, HandleDebuggerFrame frame,
--- a/js/src/doc/Debugger/Debugger.Frame.md
+++ b/js/src/doc/Debugger/Debugger.Frame.md
@@ -256,21 +256,16 @@ non-debuggee functions, host functions o
 Accessing this property will throw if `.onStack == false`.
 
 ### `callee`
 The function whose application created this frame, as a debuggee value,
 or `null` if this is not a `"call"` frame.
 
 Accessing this property will throw if `.terminated == true`.
 
-### `generator`
-True if this frame is a generator frame, false otherwise.
-
-Accessing this property will throw if `.onStack == false`.
-
 ### `constructing`
 True if this frame is for a function called as a constructor, false
 otherwise.
 
 Accessing this property will throw if `.onStack == false`.
 
 ### `arguments`
 The arguments passed to the current frame, or `null` if this is not a
index fe8d103e824541f5fa0f0d4e1af291011baeb899..5608399d9cb7db04a851d0d6a26d81ee2bc7b426
GIT binary patch
literal 1929
zc$|$?-D=}T6h0n|5JDIuj4{TTAsDah1aBI`65=%7{BJ_y1Up?yLoZ}$tZ0!XcQoF{
zEqQ@HOP`=m)%)J`jAU7gH-Q?)=zQm!bH4K<9bXQvM&#jQcyx1fH2lSLSRg#H=>Mx8
znwPOL@fbgQnsF9IUKrF)En(g9aK^Y;w68tExaFtzz?!n&5*rEb1#Wh6dx;;1q0g)!
zbF{O^k+1}tV$#Nm<@*`FB^{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lUz{G*2V~
zsC}ILLb`$0O8d2z)#2|jvCWhv|7LH2X=A6l4eIKwh>8NPtM&#~1+AA{e5MVk{m6@x
z{dh5-Dj9r$ynW5tp9>|VA?8Ww;KVkX^a0uJmRpj)7^nc&u;k5Te1L*6^jFOs)M{M|
zuQ=a}N;nht_pJDb^Mg2z2JSvSj0S`J3jT6Vs!nmoK}F<jA+)>g;2jUS=m_uQkCnsY
ztpwO{(LP3q_+7Mf(grt-4iVbJAHWlBQS7<9Ww+=73xRJDz9k1Cw}p`BVRZDy6Cq4o
z$3gCK0po6x0NmZvL@K%tDm8Hd13|lllBd!;NNgn45h^?&o2hk*Ms-4LNZ)Bf55!jO
zA<sgnfZzY%1MFjpE4YmBaUDZ(co%=f!!!v0mI;@c@F^2+h>NzNbW~lJk|Dhm`RCUR
Jxk!;g?_W9x$4>wN
--- a/js/src/jit-test/tests/debug/Frame-01.js
+++ b/js/src/jit-test/tests/debug/Frame-01.js
@@ -1,17 +1,17 @@
-// Test .type and .generator fields of topmost stack frame passed to onDebuggerStatement.
+// Test .type fields of topmost stack frame passed to onDebuggerStatement.
 
 var g = newGlobal({newCompartment: true});
 var dbg = Debugger(g);
 var expected, hits;
 dbg.onDebuggerStatement = function (f) {
     assertEq(Object.getPrototypeOf(f), Debugger.Frame.prototype);
     assertEq(f.type, expected.type);
-    assertEq(f.generator, expected.generator);
+    assertEq(f.script.isGeneratorFunction, expected.generator);
     assertEq(f.constructing, expected.constructing);
     hits++;
 };
 
 function test(code, expectobj, expectedHits) {
     expected = expectobj;
     hits = 0;
     g.evaluate(code);
--- a/js/src/jit-test/tests/debug/Frame-onStack-03.js
+++ b/js/src/jit-test/tests/debug/Frame-onStack-03.js
@@ -5,23 +5,21 @@ load(libdir + "asserts.js");
 var g = newGlobal({newCompartment: true});
 var f;
 Debugger(g).onDebuggerStatement = function (frame) {
     assertEq(frame.onStack, true);
     assertEq(frame.type, "call");
     assertEq(frame.this instanceof Object, true);
     assertEq(frame.older instanceof Debugger.Frame, true);
     assertEq(frame.callee instanceof Debugger.Object, true);
-    assertEq(frame.generator, false);
     assertEq(frame.constructing, false);
     assertEq(frame.arguments.length, 0);
     f = frame;
 };
 
 g.eval("(function () { debugger; }).call({});");
 assertEq(f.onStack, false);
 assertThrowsInstanceOf(function () { f.type; }, Error);
 assertThrowsInstanceOf(function () { f.this; }, Error);
 assertThrowsInstanceOf(function () { f.older; }, Error);
 assertThrowsInstanceOf(function () { f.callee; }, Error);
-assertThrowsInstanceOf(function () { f.generator; }, Error);
 assertThrowsInstanceOf(function () { f.constructing; }, Error);
 assertThrowsInstanceOf(function () { f.arguments; }, Error);
--- a/js/src/jit-test/tests/debug/breakpoint-11.js
+++ b/js/src/jit-test/tests/debug/breakpoint-11.js
@@ -1,18 +1,16 @@
 // Setting a breakpoint in a generator function works, and we can
 // traverse the stack and evaluate expressions in the context of older
 // generator frames.
 
 var g = newGlobal({newCompartment: true});
 var dbg = Debugger(g);
 dbg.onDebuggerStatement = function (frame) {
     function hit(frame) {
-        assertEq(frame.generator, true);
-        assertEq(frame.older.generator, true);
         frame.older.eval("q += 16");
     }
 
     var s = frame.script;
     var offs = s.getLineOffsets(g.line0 + 9);
     for (var i = 0; i < offs.length; i++)
         s.setBreakpoint(offs[i], {hit: hit});
 };
--- a/js/src/jit-test/tests/debug/onEnterFrame-generator-01.js
+++ b/js/src/jit-test/tests/debug/onEnterFrame-generator-01.js
@@ -43,17 +43,16 @@ function check(frame) {
         savedScript = frame.script;
     } else {
         assertEq(frame.environment, savedEnv);
         assertEq(frame.script, savedScript);
     }
     let a_expected = hits < 3 ? undefined : 1/2;
     assertEq(savedEnv.getVariable("a"), a_expected);
 
-    assertEq(frame.generator, true);
     assertEq(frame.onStack, true);
 
     let pc = frame.offset;
     assertEq(savedOffsets.has(pc), false);
     savedOffsets.add(pc);
 
     assertEq(frame.older, null);
     assertEq(frame.this, gw.makeDebuggeeValue(g));