Closed Bug 902383 Opened 11 years ago Closed 11 years ago

Remove left over analysis stuff in interpreter

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: h4writer, Assigned: h4writer)

Details

Attachments

(2 files)

I was digging more into type analysis when encounter this code. I remember we only start generating the analysis info when we hit the baseline. So checking hasAnalysis in the interpreter should always return false.  In other words this is dead code, IIRC.

Time to clean.
Assignee: general → hv1989
Attachment #786829 - Flags: review?(jdemooij)
One-liner, removing getStringElement too. Looks like we never use that information and we now don't set either. So goodbye.
Attachment #786834 - Flags: review?(jdemooij)
I tried removing some analysis code in bug 894948, and failed pretty hard, because it regressed several benchmarks. So I'd recommend carefully measuring the impact and making sure that no regressions occur.
(In reply to Till Schneidereit [:till] from comment #3)
> I tried removing some analysis code in bug 894948, and failed pretty hard,
> because it regressed several benchmarks. So I'd recommend carefully
> measuring the impact and making sure that no regressions occur.

I just looked to your patch. It is almost the same as this one, but there is a big fault in IonBuilder. You were probably a bit to eager. I think that caused the regression!
I'm absolutely sure that someone who actually knows much about this stuff can do a lot better than me. :) Just wanted to make you aware of potential pitfalls.
Comment on attachment 786829 [details] [diff] [review]
bug902383-remove-leftovers

Review of attachment 786829 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/vm/Interpreter.cpp
@@ +1265,5 @@
>          if ((uint32_t)i >= length) {
> +            // Annotate script if provided with information (e.g. baseline)
> +            if (script && script->hasAnalysis()) {
> +                JS_ASSERT(pc);
> +                script->analysis()->getCode(pc).arrayWriteHole = true;

For most scripts, ScriptAnalysis is only allocated once we Ion-compile (Baseline has its own bytecode analysis now that's freed immediately after compilation). So this could trigger unnecessary bailouts because most of the time script->hasAnalysis() will be false.

Would you mind filing a new bug/patch to remove this code as well, and have DoSetElemFallback set a bit on the baseline IC instead? See also the stub->noteNonNativeAccess() call there.
Attachment #786829 - Flags: review?(jdemooij) → review+
Attachment #786834 - Flags: review?(jdemooij) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/1cd4230f5809

(In reply to Jan de Mooij [:jandem] from comment #6)
> Would you mind filing a new bug/patch to remove this code as well, and have
> DoSetElemFallback set a bit on the baseline IC instead? See also the
> stub->noteNonNativeAccess() call there.

Till already opened one: bug 895332
https://hg.mozilla.org/mozilla-central/rev/1cd4230f5809
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: