Closed Bug 733950 Opened 12 years ago Closed 12 years ago

create arguments object eagerly

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: luke, Assigned: luke)

References

Details

Attachments

(4 files, 1 obsolete file)

These patches create arguments objects eagerly or not at all.  They are a prerequisite to bug 659577.  I'd like to land it now that I think we can assume bug 718022 stuck.
Assignee: ashuk → general
Component: Java APIs for DOM → JavaScript Engine
QA Contact: dom-apis → general
Attached patch eager argumentsSplinter Review
This patch creates arguments eagerly.  It disables the important fun.apply optimization; a later patch adds it back.
Assignee: general → luke
Status: NEW → ASSIGNED
Attachment #603914 - Flags: review?(bhackett1024)
Depends on: 730497
Attached patch rm a checkSplinter Review
I was weirded out by what it would mean if we had an ARGUMENTS opcode but no Bytecode so I just asserted it doesn't happen... is this valid?
Attachment #603915 - Flags: review?(bhackett1024)
With this patch, we go back to our previous optimization level: zero arguments objects are created in v8.
Attachment #603916 - Flags: review?(bhackett1024)
Oops, wrong version
Attachment #603916 - Attachment is obsolete: true
Attachment #603946 - Flags: review?(bhackett1024)
Attachment #603916 - Flags: review?(bhackett1024)
Comment on attachment 603914 [details] [diff] [review]
eager arguments

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

Nice!  Sorry for the late review.

::: js/src/jsscript.h
@@ +422,5 @@
>  #endif
>      bool            callDestroyHook:1;/* need to call destroy hook */
>  
> +    /*
> +     * TODO: describe

Needs a comment.
Attachment #603914 - Flags: review?(bhackett1024) → review+
Comment on attachment 603915 [details] [diff] [review]
rm a check

This check for 'code' needs to be left in.  In general, the Bytecode for an opcode will not be present if the opcode is unreachable in the script's CFG, e.g. 'function foo() { return 0; return arguments; }'.  The SSA code will get crash if it is fed SSA values referring to unreachable opcodes.  It would be good to add a comment describing why the check is here.
Attachment #603915 - Flags: review?(bhackett1024)
Comment on attachment 603914 [details] [diff] [review]
eager arguments

Also, this patch looks like it's supposed to have ArgumentsObject.cpp.  Can you attach a separate patch with that file for review?
Comment on attachment 603946 [details] [diff] [review]
reoptimize f.apply(arguments)

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

::: js/src/jsscript.cpp
@@ +1988,5 @@
> +
> +    if (hasAnalysis() && analysis()->ranInference()) {
> +        types::AutoEnterTypeInference enter(cx);
> +        for (unsigned off = 0; off < length; off += GetBytecodeLength(code + off)) {
> +            if (code[off] == JSOP_ARGUMENTS) {

This should also check that analysis->maybeCode(off) != NULL.
Attachment #603946 - Flags: review?(bhackett1024) → review+
(In reply to Brian Hackett (:bhackett) from comment #8)
Thanks for the reviews.  Diff is making it look weird, but what I did (to preserve hg history and minimize rebase pain) was to "hg cp jsfun.cpp vm/ArgumentsObject.cpp" and then delete all the not-arguments-object stuff.  Diff shows it as two separate edits to jsfun.cpp.
While I was waiting for the dependencies to get landed I noticed I'm not actually ensuring the !heavyweight assertion in JSScript::applySpeculationFailed.  I'll fold the fix in to the prev patch, but here's the diff.
Attachment #605615 - Flags: review?(bhackett1024)
Attachment #605615 - Flags: review?(bhackett1024) → review+
https://hg.mozilla.org/mozilla-central/rev/85bef04d1258
https://hg.mozilla.org/mozilla-central/rev/e2144e6ee774
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
Depends on: 737575
Depends on: 737388
Depends on: 738083
Depends on: 769987
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: