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)
Tracking
()
RESOLVED
FIXED
People
(Reporter: djvj, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 2 obsolete files)
18.14 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
JSOP_NEW is not optimized, so we're entering the VM and re-entering baseline (or ion) for each of these. Fix.
Reporter | ||
Comment 1•12 years ago
|
||
Attachment #710315 -
Flags: review?(jdemooij)
Reporter | ||
Comment 2•12 years ago
|
||
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 3•12 years ago
|
||
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.
Reporter | ||
Comment 4•12 years ago
|
||
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.
Reporter | ||
Comment 5•12 years ago
|
||
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 6•12 years ago
|
||
Comment on attachment 710920 [details] [diff] [review]
Patch 3.
Review of attachment 710920 [details] [diff] [review]:
-----------------------------------------------------------------
Looks great.
Attachment #710920 -
Flags: review?(jdemooij) → review+
Reporter | ||
Comment 7•12 years ago
|
||
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.
Description
•