Closed Bug 862926 Opened 12 years ago Closed 12 years ago

Parallel JS: Generalize the DEBUG spew in ParCallToUncompiledScript.

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: pnkfelix, Assigned: pnkfelix)

References

Details

Attachments

(1 file, 1 obsolete file)

The old code assumed that the argument `func` will always have a script associated with it. But this is not true in some cases, e.g. in the case of ES6 bound functions `(a,b) => ...`. We must remove the assumption that the input function has a script. We should also try to provide what information we can e.g. for bound functions.
Blocks: PJS
Assignee: general → pnkfelix
Status: NEW → ASSIGNED
Attachment #738603 - Flags: review?(shu)
Some relevant conversation from #jsapi: http://logbot.glob.com.au/?c=mozilla%23jsapi#c162408
Comment on attachment 738603 [details] [diff] [review] patch A v1: generalizes DEBUG spew on call to uncompiled Review of attachment 738603 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. Just some style nits for our coding style. ::: js/src/ion/ParallelFunctions.cpp @@ +226,5 @@ > JS_ASSERT(InParallelSection()); > > #ifdef DEBUG > + if (func->hasScript()) { > + RawScript script = func->nonLazyScript(); Nit: Suggested style going forward by the GC folks is that T * should be used over RawT for honesty. Some more instances below. @@ +230,5 @@ > + RawScript script = func->nonLazyScript(); > + Spew(SpewBailouts, "Call to uncompiled script: %p:%s:%d", > + script, script->filename(), script->lineno); > + } else if (func->isBoundFunction()) { > + int maxDepth = 5; Nit: Make this a static const and move to an easier-to-modify location. @@ +236,5 @@ > + JSFunction *target = func->getBoundFunctionTarget()->toFunction(); > + while (depth < maxDepth) { > + if (target->hasScript()) { > + break; > + } else if (target->isBoundFunction()) { Nit: No else if the then body is a jump. @@ +238,5 @@ > + if (target->hasScript()) { > + break; > + } else if (target->isBoundFunction()) { > + target = target->getBoundFunctionTarget()->toFunction(); > + } Nit: No surrounding braces if the body of a block is one line. @@ +249,5 @@ > + } else { > + Spew(SpewBailouts, "Call to bound function (excessive depth: %d)", depth); > + } > + } else { > + Spew(SpewBailouts, "Call to strange function."); Should this be an assert? What are some legitimate functions that we can attempt to call in parallel that do not have a script and are not ES6 bound functions?
Attachment #738603 - Flags: review?(shu) → review+
incoporating review comments from shu. Carrying forward R+ from shu from earlier.
Attachment #739578 - Flags: review+
Attachment #738603 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: