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)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: billm, Assigned: billm)

References

Details

(Whiteboard: [hardblocker] [fixed-in-tracemonkey])

Attachments

(1 file)

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: general → wmccloskey
blocking2.0: --- → ?
blocking2.0: ? → betaN+
Whiteboard: hardblocker
Attached patch patchSplinter Review
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 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?
(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 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+
(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);
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 on attachment 501513 [details] [diff] [review] patch r=me, nice work, as usual
Attachment #501513 - Flags: review?(gal) → review+
Is this ready to land?
(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.
Whiteboard: hardblocker → [hardblocker] [fixed-in-tracemonkey]
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Blocks: 648769
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: