Closed
Bug 623050
Opened 15 years ago
Closed 15 years ago
TM: ProhibitFlush is incorrect now that TM is in compartment
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
| Tracking | Status | |
|---|---|---|
| blocking2.0 | --- | betaN+ |
People
(Reporter: billm, Assigned: billm)
References
Details
(Whiteboard: [hardblocker] [fixed-in-tracemonkey])
Attachments
(1 file)
|
44.16 KB,
patch
|
gal
:
review+
n.nethercote
:
feedback+
|
Details | Diff | Splinter Review |
When the TraceMonitor moved into the compartment in bug 584860, I didn't change ProhibitFlush so that we don't flush the trace cache of a compartment when some other thread is running code from the same compartment. Andreas says this is necessary.
| Assignee | ||
Updated•15 years ago
|
Assignee: general → wmccloskey
blocking2.0: --- → ?
Updated•15 years ago
|
blocking2.0: ? → betaN+
Whiteboard: hardblocker
| Assignee | ||
Comment 1•15 years ago
|
||
This patch moves tracerState and bailExit from JSContext to the TraceMonitor.
Nick, could you look over the code in Writer.{cpp,h}? I added ACCSET_TM for access inside the TraceMonitor. The intention is that you will always be accessing a baked-in address. In this case, I'm accessing bailExit. I'm pretty sure that this does not need to be a volatile access. The only place bailExit is changed outside of tracejit-generated code is in DeepBail, and that's only after we've already done LeaveTree.
Attachment #501513 -
Flags: review?(gal)
Attachment #501513 -
Flags: feedback?(nnethercote)
Comment 2•15 years ago
|
||
Comment on attachment 501513 [details] [diff] [review]
patch
>+ProhibitFlush(TraceMonitor *tm)
>+{
>+ return !!tm->tracerState; // early out if the given is in native code
comment doesn't make sense (early out? given?)
compartment and thus traceMonitor should be now constant for a given script, right? so we can just embed direct addresses instead of loading them?
| Assignee | ||
Comment 3•15 years ago
|
||
(In reply to comment #2)
> comment doesn't make sense (early out? given?)
I guess it's supposed to mean "don't flush if we're in native code". It's a stupid comment; I'll take it out.
> compartment and thus traceMonitor should be now constant for a given script,
> right? so we can just embed direct addresses instead of loading them?
The patch embeds the address of bailExit. I didn't see any other loads from tm on trace. What were you thinking of?
Comment 4•15 years ago
|
||
Comment on attachment 501513 [details] [diff] [review]
patch
Most important thing: You need to update accNames[] in jstracer.cpp. Once
you've done that, do a run with TMFLAGS=afterdce and check that the accset
annotations on the loads and stores look ok.
>+ nj::LIns *stTraceMonitorField(nj::LIns *value, void *dest, const char *destName) const {
>+ return lir->insStore(value, name(lir->insImmP(dest), destName), 0, ACCSET_TM);
>+ }
>+ #define stTraceMonitorField(value, tm, fieldname) \
>+ stTraceMonitorField(value, &(tm)->fieldname, #fieldname)
You could remove the 2nd arg and hardwire the macro to use 'traceMonitor',
like stContextField() does with 'cx_ins'. Not crucial, though.
>+ nj::LIns *ldpVolatile(nj::LIns *base) const {
>+ return lir->insLoad(nj::LIR_ldp, base, 0, nj::ACCSET_LOAD_ANY, nj::LOAD_VOLATILE);
>+ }
>+
>+ nj::LIns *stpVolatile(nj::LIns *value, nj::LIns *base) const {
>+ return lir->insStore(nj::LIR_stp, value, base, 0, nj::ACCSET_STORE_ANY);
>+ }
These aren't used, take them out.
f=me with these fixed.
Attachment #501513 -
Flags: feedback?(nnethercote) → feedback+
| Assignee | ||
Comment 5•15 years ago
|
||
(In reply to comment #4)
> Most important thing: You need to update accNames[] in jstracer.cpp. Once
> you've done that, do a run with TMFLAGS=afterdce and check that the accset
> annotations on the loads and stores look ok.
What do you think of the idea of making accNames public in LInsPrinter so that we can JS_STATIC_ASSERT that it has the right size? I.e.,
JS_STATIC_ASSERT(JS_ARRAY_LENGTH(nanojit::LInsPrinter::accNames) ==
TM_NUM_USED_ACCS + 1);
Comment 6•15 years ago
|
||
Could use a list-generating macro like FUNCTION_KIND_METER_LIST to avoid all duplication and potential loss of array parallelism maintenance hazards.
/be
Comment 7•15 years ago
|
||
Comment on attachment 501513 [details] [diff] [review]
patch
r=me, nice work, as usual
Attachment #501513 -
Flags: review?(gal) → review+
Comment 8•15 years ago
|
||
Is this ready to land?
| Assignee | ||
Comment 9•15 years ago
|
||
(In reply to comment #8)
> Is this ready to land?
As soon as the try server is ready to reveal its precious results. It's been "Loading 75%" for about an hour.
| Assignee | ||
Comment 10•15 years ago
|
||
Whiteboard: hardblocker → [hardblocker] [fixed-in-tracemonkey]
Comment 11•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•