Closed Bug 570805 Opened 14 years ago Closed 14 years ago

JM: Implement JSOP_CALLPROP

Categories

(Core :: JavaScript Engine, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: sstangl, Unassigned)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Implement JSOP_CALLPROP. (obsolete) — Splinter Review
Implements JSOP_CALLPROP.

The code diverges from what is used by the interpreter: the section of code shared with JSOP_GETPROP is not duplicated; stubs::GetProp() is called explicitly by stubs::CallProp(). The previous iteration of JaegerMonkey handles CallProp() in a special way for PIC usage, but without PICs, the implementation this patch provides is as clean as possible.

The code passes all tests except for sunspider/check-crypto-md5.js and sunspider/check-crypto-sha1.js, which trip the assertion:

Assertion failure: !avail.empty(), at ../methodjit/FrameState.cpp:288

This assertion is unrelated to the correctness of the patch, but blocks this patch if we don't want to burn the tree.
Attachment #449927 - Flags: review?(dvander)
Comment on attachment 449927 [details] [diff] [review]
Implement JSOP_CALLPROP.


>+          BEGIN_CASE(JSOP_CALLPROP)
>+            prepareStubCall();
>+            stubCall(stubs::CallProp, Uses(1), Defs(2));
>+            frame.pushSynced();
>+          END_CASE(JSOP_CALLPROP)

This should be frame.pop() ; frame.pushSynced() ; frame.pushSynced()
Reason is, the top of the stack might be a propagated copy or constant, and then the JIT is using the wrong value. Eventually we want some sort of frame.swap() - after or during PICs.

>+    GetProp(f);

This is fallible, so some sort of check is needed. Splitting GetProp into a helper might be best.

>+    if (JS_UNLIKELY(rval.isUndefined())) {
>+        /* inline jsinterp.cpp:LOAD_ATOM */
>+        JSAtom *atom = f.fp->script->atomMap.vector[GET_INDEX(regs.pc)];

Let's pass the atom as an inparam, as it's a compile-time constant. See jsop_propinc for an example of how to do this. Long term goal is to remove regs.pc.
Attachment #449927 - Flags: review?(dvander)
Attachment #449927 - Attachment is obsolete: true
Attachment #449961 - Flags: review?(dvander)
Blocks: 570846
Comment on attachment 449961 [details] [diff] [review]
Original patch with above changes.


>+    if (!InlineGetProp(f))
>+        THROW();

Double throw here. Better to leave out THROW() in InlineGetProp, and propagate the return value up. THROW()ing only inside the actual stub calls makes the control flow more explicit.

Thanks!
Attachment #449961 - Flags: review?(dvander) → review+
Pushed.
Status: NEW → RESOLVED
Closed: 14 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: