Closed
Bug 606955
Opened 15 years ago
Closed 15 years ago
JM: Use the correct BKPT encoding.
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jbramley, Assigned: jbramley)
References
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file)
|
1.23 KB,
patch
|
cdleary
:
review+
|
Details | Diff | Splinter Review |
Chris noted that the breakpoint() function wasn't behaving as expected on his platform. We had assumed that GDB was getting confused with BKPT instructions that it hadn't placed itself.
Whilst investigating something unrelated, I realized that the definition of BKPT in ARMAssembler.h was actually incorrect. I also fixed the padForAlign32 value, which also looked like it should have held a BKPT, but actually encoded an obscure MRC instruction.
Attachment #485723 -
Flags: review?(cdleary)
Comment 1•15 years ago
|
||
Comment on attachment 485723 [details] [diff] [review]
Use the correct BKPT encoding on ARM.
Heroic catch! Confirmed that's indeed the correct instruction.
Just out of curiosity, do we pad32 with bkpt instructions because that could do something more desirable than executing the constant pool? i.e. putting all-zero instructions would not cause the processor to enter debug state?
Attachment #485723 -
Flags: review?(cdleary) → review+
| Assignee | ||
Comment 2•15 years ago
|
||
(In reply to comment #1)
> Just out of curiosity, do we pad32 with bkpt instructions because that could do
> something more desirable than executing the constant pool? i.e. putting
> all-zero instructions would not cause the processor to enter debug state?
Note that we don't always use padForAlign32. It's only used if the pool isn't already aligned on an 8-byte-boundary. That alignment is chosen, most likely, to take advantage of 64-bit data paths that might exist. Alignment on cache-line boundaries might be interesting, but might waste too much space. I recall the developers at Szeged doing some tuning here (for JavaScriptCore).
We can't rely on padForAlign32 being used as a safety barrier, but if we do use it we might as well use something that will throw a spanner in the works. 0x00000000 encodes "andeq r0, r0, r0", which is essentially a conditional NOP.
| Assignee | ||
Comment 3•15 years ago
|
||
Whiteboard: fixed-in-tracemonkey
Comment 4•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•