Closed
Bug 862926
Opened 12 years ago
Closed 12 years ago
Parallel JS: Generalize the DEBUG spew in ParCallToUncompiledScript.
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla23
People
(Reporter: pnkfelix, Assigned: pnkfelix)
References
Details
Attachments
(1 file, 1 obsolete file)
|
3.29 KB,
patch
|
pnkfelix
:
review+
|
Details | Diff | Splinter Review |
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.
| Assignee | ||
Comment 1•12 years ago
|
||
| Assignee | ||
Comment 2•12 years ago
|
||
Some relevant conversation from #jsapi:
http://logbot.glob.com.au/?c=mozilla%23jsapi#c162408
Comment 3•12 years ago
|
||
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+
| Assignee | ||
Comment 4•12 years ago
|
||
incoporating review comments from shu.
Carrying forward R+ from shu from earlier.
Attachment #739578 -
Flags: review+
| Assignee | ||
Updated•12 years ago
|
Attachment #738603 -
Attachment is obsolete: true
| Assignee | ||
Comment 5•12 years ago
|
||
| Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 6•12 years ago
|
||
Keywords: checkin-needed
Comment 7•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
| Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
| Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•