Implement helper routines for inspecting and breaking on mark bits

RESOLVED FIXED in Firefox 54

Status

()

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: sfink, Assigned: sfink)

Tracking

unspecified
mozilla54
Points:
---

Firefox Tracking Flags

(firefox54 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
Whenever I've been working with marking, it seems like I've wanted these.
(Assignee)

Comment 1

2 years ago
Created attachment 8834080 [details] [diff] [review]
Implement helper routines for inspecting and breaking on mark bits

I'm not sure about the best namespace. js::gc::debug? js::gc::detail? I went for something short.

The help message should perhaps mention that it's breaking on setting a mark in that case; clearing a mark would be

  cond 7 !(*$100 & $101)
Attachment #8834080 - Flags: review?(jcoppeard)
Comment on attachment 8834080 [details] [diff] [review]
Implement helper routines for inspecting and breaking on mark bits

Review of attachment 8834080 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, and I'm fine with the namespace.

::: js/src/gc/Heap.h
@@ +1396,5 @@
> +
> +namespace debug {
> +
> +// Utility functions meant to be called from an interactive debugger.
> +enum class MarkColor : int {

Suggestion: this has more information than just the mark color so maybe it could be called MarkInfo or something.

@@ +1415,5 @@
> +//   $101 = 0x200000000
> +//   (gdb) watch *$100
> +//   Hardware watchpoint 7: *$100
> +//   (gdb) cond 7 *$100 & $101
> +//   (gdb) cont

Nice!
Attachment #8834080 - Flags: review?(jcoppeard) → review+
This is very handy. I was able to easily figure out two different sources of excessive unmark gray calls in bug 1336811 using it.
(Assignee)

Comment 4

2 years ago
The only reason I haven't landed it is because I'm hitting a test failure with Promises where it's accessing a dead object, and I was blaming something in the stack of patches I was trying to land along with this. It's looking like it may not have been my changes in the first place, though.

Comment 5

2 years ago
Pushed by sfink@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/96b7a5189c50
Implement helper routines for inspecting and breaking on mark bits, r=jonco

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/96b7a5189c50
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox54: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.