Closed Bug 837747 Opened 12 years ago Closed 12 years ago

BaselineCompiler: Add optimized stub for calls via JSOP_NEW

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: djvj, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

JSOP_NEW is not optimized, so we're entering the VM and re-entering baseline (or ion) for each of these. Fix.
Attached patch Patch (obsolete) — Splinter Review
Attachment #710315 - Flags: review?(jdemooij)
Attached patch Patch 2. (obsolete) — Splinter Review
New patch with fixes: previous one forgot to mark the Callee in the ICCall_NewScripted stub.
Attachment #710315 - Attachment is obsolete: true
Attachment #710315 - Flags: review?(jdemooij)
Attachment #710335 - Flags: review?(jdemooij)
Comment on attachment 710335 [details] [diff] [review] Patch 2. Review of attachment 710335 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/ion/BaselineIC.cpp @@ +3198,5 @@ > +typedef bool (*CreateThisFn)(JSContext *cx, HandleObject callee, MutableHandleValue rval); > +static const VMFunction CreateThisInfo = FunctionInfo<CreateThisFn>(CreateThis); > + > +bool > +ICCall_NewScripted::Compiler::generateStubCode(MacroAssembler &masm) I think we can avoid a lot of code duplication if we use the Call_Scripted stub for JSOP_NEW as well (Ion's LCallGeneric also works with both constructing and non-constructing). We can make getKey encode the isConstructing bit, and wrap the CreateThis and check-return-type-is-primitive parts in an "if (isConstructing)" or something. Would you mind giving this a try? I think it would be really nice if we can make it work.
I thought about doing this, but the main issue I have with it is that register usage gets really tight on x86. The combined version may have a couple of extra pushes or pops, but I suppose that's not too bad of a price to pay. I'll look into it.
Attached patch Patch 3.Splinter Review
Fixed up to reuse code for ICCall_Scripted.
Attachment #710335 - Attachment is obsolete: true
Attachment #710335 - Flags: review?(jdemooij)
Attachment #710920 - Flags: review?(jdemooij)
Comment on attachment 710920 [details] [diff] [review] Patch 3. Review of attachment 710920 [details] [diff] [review]: ----------------------------------------------------------------- Looks great.
Attachment #710920 - Flags: review?(jdemooij) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: