Closed Bug 1448039 Opened 6 years ago Closed 6 years ago

Use ICState consistently for all ICs

Categories

(Core :: JavaScript Engine: JIT, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla64
Performance Impact high
Tracking Status
firefox61 --- wontfix
firefox62 --- wontfix
firefox63 --- wontfix
firefox64 --- fixed

People

(Reporter: mgaudet, Assigned: khyperia)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

While exploring something else, it became clear that the InstanceOf IC attempts to attach regardless of how many failures it has seen. 

The test case here: 

```
function bar() { this.y = 10; }
bar.__proto__ = {}
k = new bar();

for (var i =0; i < 100; i++) {
    assertEq(k instanceof bar, true);
}
```

The IC will fail to attach; yet, if run with either CACHEIR_LOGS=1 or IONFLAGS=bl-ic-fb it's clear that we attempt to attach the stub nearly 100 times.
I'm seeing a similar problem on Google Docs (Bug 1488435). I have a CacheIR log that has thousands of IC attachment failures for a particular pc that look like this: 

    Type	InstanceOf 	
    Mode	Specialized
    Location	https://docs.google.com/static/document/client/js/1419346799-kix_main_i18n_kix_core.js:1183
    Column	1018
    PC	12862ded0
    LHS	Object 1267ab7e0 (shape: 0)
    RHS	Function 125ba9780 (shape: 126472d30)

It seems for a particular PC, we ought not try to attach an IC 3063 times... seems wasteful.
See Also: → 1488435
Whiteboard: [qf]
This is not just for InstanceOf; I have similar issues that show up for BinaryArith
Summary: InstanceOf IC continues to try to attach even after many failures → ICs continue to try to attach even after many failures
Blocks: CacheIR
Whiteboard: [qf] → [qf:p1:f64]
Assignee: nobody → mgaudet
Leaving a note for myself: I'm in this area due to weird interactions with https://bugzilla.mozilla.org/show_bug.cgi?id=1487022 , and I think I figured out the issue. Once I'm done with that bug, I'll look at this one.

mgaudet, do you mind if I steal the assignment?
Not at all. I have done it for you :)
Assignee: mgaudet → khyperia
Blocks: 1492920
I think :khyperia has a stack of patches here to cover (roughly):
- Converting the stub->noteUnoptimized* to use ICState failed-to-attach counts
- Template out the boring baseline fallback functions since they are almost identical.

The result should end up fixing the Comment 0 issue.
Summary: ICs continue to try to attach even after many failures → Use ICState consistently for all ICs
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/57de113fc712
Remove UNOPTIMIZEABLE bits from baseline IC fallback stubs. r=tcampbell
https://hg.mozilla.org/mozilla-central/rev/57de113fc712
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Performance Impact: --- → P1
Whiteboard: [qf:p1:f64]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: