static analysis incorrectly requires JS_REQUIRES_STACK

RESOLVED WORKSFORME

Status

()

Core
JavaScript Engine
RESOLVED WORKSFORME
9 years ago
6 years ago

People

(Reporter: gal, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Comment hidden (empty)
(Reporter)

Comment 1

9 years ago
Applying this patch makes static analysis fail, but shouldn't.

http://hg.mozilla.org/tracemonkey/rev/186ae511d5f2

Comment 3

9 years ago
It looks like the analysis is correct: you're calling guard(), which requires a stack, from guardNotGlobalObject which doesn't have a stack.
(In reply to comment #3)
> It looks like the analysis is correct: you're calling guard(), which requires a
> stack, from guardNotGlobalObject which doesn't have a stack.

Why do we have to hand-annotate the transitive closure of calls-JS_REQUIRES_STACK? I recall being told we did not need to do anything that computers can infer for us. If a method uses cx->fp, we should hand-annotate. If a method calls a JS_REQUIRES_STACK method, no annotation should be required.

/be

Comment 5

9 years ago
All the automatic analyses are function-local. They can only operate on the declared signature of the functions that are being called. So any method that calls a JS_REQUIRES_STACK method must either

1) be annotated JS_REQUIRES_STACK
2) somewhere in the body of the method, call a function which is JS_FORCES_STACK, so that you know you have safely bailed off trace.

Comment 6

6 years ago
JS_REQUIRES_STACK has been removed.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.