Closed Bug 933293 Opened 11 years ago Closed 4 years ago

Optimize ConvertAndCopyTo calls in MIR code

Categories

(Core :: JavaScript Engine: JIT, defect, P5)

x86
Linux
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: nmatsakis, Assigned: nmatsakis)

References

Details

Attachments

(2 obsolete files)

Both new object creation (bug 933277) and assignments (bug 933289) can result in calls to the self-hosted helper ConvertAndCopyTo. In some cases we should be able to further optimize these calls by "unrolling" them into a series of accesses and assignments. We have to be very careful because if a jit bailout should occur it may not be observable, and there is no convenient bytecode to jump back into. Therefore I would probably write this optimization to examine the value being converted and handle two cases: 1. The value being converted is known to be a typed object of equivalent type. We can use memcpy in that case. This may be better done in IonBuilder directly. 2. TI can guarantee for us that loading the properties and converting the values we need to load/convert will not have side-effects, so it's okay for these loads/conversions to be replayed if necessary. This will frequently occur in the common case of users using literal syntax (`new Point({x: 22, y: 44})`) -- in that case we should be able to determine the precise *value* that is being loaded (22 for `x`, etc).
Depends on: 933277, 933289
Assignee: nobody → nmatsakis
Attached patch Bug933293.diff (obsolete) — Splinter Review
Attachment #830572 - Flags: review?(jdemooij)
Attachment #830572 - Flags: feedback?(pnkfelix)
Attached file jaswanth.js (obsolete) —
Test case that performs better. I'm reluctant to add this as a jit-test, instead I'd like to setup some benchmarks in awfy (perhaps including this one).
Comment on attachment 830572 [details] [diff] [review] Bug933293.diff Attached to wrong bug (argh).
Attachment #830572 - Attachment is obsolete: true
Attachment #830572 - Flags: review?(jdemooij)
Attachment #830572 - Flags: feedback?(pnkfelix)
Comment on attachment 830574 [details] jaswanth.js Attached to wrong bug (argh).
Attachment #830574 - Attachment is obsolete: true
Assuming p5 because related to typed objects, which are nightly-only and not specced yet.
Priority: -- → P5

No longer valid, self-hosting code for typed object has been removed.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: