Open
Bug 1271654
Opened 9 years ago
Updated 2 years ago
Implement a C++ interface for Debugger.Script instances.
Categories
(Core :: JavaScript Engine, defect, P3)
Core
JavaScript Engine
Tracking
()
NEW
Iteration:
50.4 - Aug 1
People
(Reporter: ejpbruel, Assigned: jimb)
References
(Blocks 2 open bugs)
Details
Attachments
(11 files, 1 obsolete file)
12.06 KB,
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
1.11 KB,
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
5.23 KB,
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
4.08 KB,
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
3.95 KB,
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
13.58 KB,
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
11.92 KB,
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
4.37 KB,
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
4.45 KB,
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
5.08 KB,
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
6.31 KB,
patch
|
jimb
:
review-
|
Details | Diff | Splinter Review |
This bug is part of the effort to implement a C++ interface for the debugger API. See the parent bug 1271641 for more context.
Reporter | ||
Updated•9 years ago
|
Whiteboard: [devtools-html] [triage]
Updated•9 years ago
|
Flags: qe-verify-
Priority: -- → P2
Whiteboard: [devtools-html] [triage] → [devtools-html]
Reporter | ||
Comment 1•9 years ago
|
||
Attachment #8770488 -
Flags: review?(jimb)
Reporter | ||
Updated•9 years ago
|
Assignee: nobody → ejpbruel
Reporter | ||
Comment 2•9 years ago
|
||
Hi Jim. I know we should be reluctant about changing the semantics of the debugger API in this patch series, but if I'm right, this patch just removes redundant code.
The displayName of a JSFunction is a JSAtom. According to jandem, because all atoms live in the same zone, they don't have to be copied by a call to cx->compartment()->wrap (unlike JSStrings, which can live in different zones).
There is precedent for this change too: we already don't wrap the result in DebuggerObject::displayName, which accesses the same property.
All in all, the change seems small enough to me that it's ok to land this in a separate patch. Let me know if you agree.
Attachment #8770490 -
Flags: review?(jimb)
Updated•9 years ago
|
Status: NEW → ASSIGNED
Iteration: --- → 50.3 - Jul 18
Priority: P2 → P1
Assignee | ||
Updated•9 years ago
|
Attachment #8770490 -
Flags: review?(jimb) → review+
Assignee | ||
Comment 3•9 years ago
|
||
Comment on attachment 8770488 [details] [diff] [review]
Implement a DebuggerScript class.
Review of attachment 8770488 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good.
::: js/src/vm/Debugger.cpp
@@ +5122,5 @@
>
> /*** Debugger.Script *****************************************************************************/
>
> +/* static */ NativeObject*
> +DebuggerScript::initClass(JSContext* cx, HandleObject debugCtor, HandleObject obj)
Couldn't this return a DebuggerScript*? The prototype does use the right class.
@@ +5137,5 @@
> +
> + return scriptProto;
> +}
> +
> +class DebuggerScriptSetPrivateMatcher
If we made this class private to DebuggerScript, it might make things a little less verbose. You'd put:
class SetPrivateMatcher;
inside the definition of class DebuggerScript in Debugger.h, change this to
class DebuggerScript::SetPrivateMatcher { ... };
and then change DebuggerScript::create to just say:
SetPrivateMatcher matcher(&script);
Just a suggestion.
Attachment #8770488 -
Flags: review?(jimb) → review+
Updated•9 years ago
|
Iteration: 50.3 - Jul 18 → 50.4 - Aug 1
Updated•8 years ago
|
Whiteboard: [devtools-html]
Reporter | ||
Comment 4•8 years ago
|
||
Attachment #8815389 -
Flags: review?(jimb)
Reporter | ||
Comment 5•8 years ago
|
||
Attachment #8815391 -
Flags: review?(jimb)
Reporter | ||
Comment 6•8 years ago
|
||
Attachment #8815393 -
Flags: review?(jimb)
Reporter | ||
Comment 7•8 years ago
|
||
Attachment #8815394 -
Flags: review?(jimb)
Reporter | ||
Comment 8•8 years ago
|
||
Fixed a minor (and rather daft) bug in this patch.
Attachment #8815389 -
Attachment is obsolete: true
Attachment #8815389 -
Flags: review?(jimb)
Attachment #8815684 -
Flags: review?(jimb)
Reporter | ||
Comment 9•8 years ago
|
||
Note that this patch depends on the patch in bug 1271655.
Attachment #8815704 -
Flags: review?(jimb)
Reporter | ||
Comment 10•8 years ago
|
||
Attachment #8815706 -
Flags: review?(jimb)
Reporter | ||
Comment 11•8 years ago
|
||
Attachment #8815710 -
Flags: review?(jimb)
Reporter | ||
Comment 12•8 years ago
|
||
Attachment #8816111 -
Flags: review?(jimb)
Reporter | ||
Comment 13•8 years ago
|
||
Attachment #8816112 -
Flags: review?(jimb)
Assignee | ||
Comment 14•8 years ago
|
||
Comment on attachment 8815391 [details] [diff] [review]
Implement a C++ interface for DebuggerScript.url.
Review of attachment 8815391 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/vm/Debugger.cpp
@@ +5560,3 @@
>
> + if (!DebuggerScript::requireScript(cx, script))
> + return false;
Okay, now I see that the displayName patch introduces THIS_DEBUGGER_SCRIPT and DebuggerScript::requireScript, so I'll review that first.
Assignee | ||
Comment 15•8 years ago
|
||
Comment on attachment 8815684 [details] [diff] [review]
Implement a C++ interface for DebuggerScript.displayName (v2).
Review of attachment 8815684 [details] [diff] [review]:
-----------------------------------------------------------------
Okay, skipping the wrap makes sense to me. I like the requireScript check, better than the existing DebuggerScript_checkThis.
Attachment #8815684 -
Flags: review?(jimb) → review+
Assignee | ||
Comment 16•8 years ago
|
||
To be useful as a C++ API, DebuggerScript will need `isJavaScript` and `isWasm` methods.
Assignee | ||
Updated•8 years ago
|
Attachment #8815391 -
Flags: review?(jimb) → review+
Assignee | ||
Comment 17•8 years ago
|
||
Comment on attachment 8815393 [details] [diff] [review]
Implement a C++ interface for DebuggerScript.startLine.
Review of attachment 8815393 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/vm/Debugger.cpp
@@ +5585,5 @@
> +
> + if (!DebuggerScript::requireScript(cx, script))
> + return false;
> +
> + args.rval().setNumber(uint32_t(script->startLine()));
This cast doesn't do anything, does it?
Attachment #8815393 -
Flags: review?(jimb) → review+
Assignee | ||
Comment 18•8 years ago
|
||
Comment on attachment 8815394 [details] [diff] [review]
Implement a C++ interface for DebuggerScript.lineCount.
Review of attachment 8815394 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/vm/Debugger.cpp
@@ +5606,2 @@
>
> + args.rval().setNumber(uint32_t(script->lineCount()));
This cast doesn't do anything, that I can see.
Attachment #8815394 -
Flags: review?(jimb) → review+
Assignee | ||
Updated•8 years ago
|
Attachment #8815704 -
Flags: review?(jimb) → review+
Assignee | ||
Updated•8 years ago
|
Attachment #8815706 -
Flags: review?(jimb) → review+
Assignee | ||
Updated•8 years ago
|
Attachment #8815710 -
Flags: review?(jimb) → review+
Assignee | ||
Updated•8 years ago
|
Attachment #8816111 -
Flags: review?(jimb) → review+
Assignee | ||
Comment 19•8 years ago
|
||
Comment on attachment 8816112 [details] [diff] [review]
Implement a C++ interface for DebuggerScript.format.
Review of attachment 8816112 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/vm/Debugger.cpp
@@ +5737,5 @@
>
> + JSString* str;
> + switch (script->format()) {
> + case DebuggerScriptFormat::JS:
> + str = cx->names().js;
Space at end of line.
@@ +6814,5 @@
> JS_PSG("source", DebuggerScript::sourceGetter, 0),
> JS_PSG("sourceStart", DebuggerScript::sourceStartGetter, 0),
> JS_PSG("sourceLength", DebuggerScript::sourceLengthGetter, 0),
> JS_PSG("global", DebuggerScript::globalGetter, 0),
> + JS_PSG("format", DebuggerScript::formatGetter, 0),
This is a new JS-visible API, so it needs tests and documentation.
::: js/src/vm/Debugger.h
@@ +1552,5 @@
> static MOZ_MUST_USE bool getErrorReport(JSContext* cx, HandleObject maybeError,
> JSErrorReport*& report);
> };
>
> +enum class DebuggerScriptFormat {
Make this a public member type, DebuggerScript::Format?
Attachment #8816112 -
Flags: review?(jimb) → review-
Reporter | ||
Updated•8 years ago
|
Assignee: ejpbruel → nobody
Status: ASSIGNED → NEW
Updated•7 years ago
|
Priority: P1 → P3
Updated•5 years ago
|
Blocks: js-debugger
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•