Closed Bug 604448 Opened 11 years ago Closed 11 years ago

pull some tricks from jsval.h into PunboxAssembler.h

Categories

(Core :: JavaScript Engine, defect)

x86_64
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: luke, Unassigned)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

There are a couple of cases in PunboxAssembler.h where we can avoid the convertValueToType and work directly on the value like jsval.h:

JSVAL_IS_NUMBER_IMPL(jsval_layout l) {
    return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET;
}

JSVAL_IS_PRIMITIVE_IMPL(jsval_layout l) {
    return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET;
}

JSVAL_IS_OBJECT_IMPL(jsval_layout l) {
    return l.asBits >= JSVAL_SHIFTED_TAG_OBJECT;
}

JSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l) {
    return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET;
}
Thanks, Luke. I updated PunboxAssembler to have the same implementation as in jsval.h, and expressed the testFoo(Address) code in terms of testFoo(RegisterID), which eliminates redundancy.

Eliminating calls to convertValueTo{Type,Payload)() when possible is a larger problem: tempRegForType() automatically performs the type masking, when that may only be required after some guards have already tripped.

A general solution to this problem would most likely involve:
- Separate x86,x64 FrameStates, since x86 should be unaffected;
- Tracking 'Value' as a Register type, a very invasive change;
- Explicit Value-to-register(s) conversions.

It's on the radar.
Attachment #483395 - Flags: review?(dvander)
Attachment #483395 - Flags: review?(dvander) → review+
http://hg.mozilla.org/mozilla-central/rev/59b339eca10f
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.