[Webkit-unassigned] [Bug 34939] Fix the SP at ctiOpThrowNotCaught on Thumb2 (JSVALUE32)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 15 22:41:26 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=34939


Gavin Barraclough <barraclough at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #48747|review?                     |review+
               Flag|                            |




--- Comment #4 from Gavin Barraclough <barraclough at apple.com>  2010-02-15 22:41:26 PST ---
(From update of attachment 48747)
r+, but...

Here's one way you could make this awesomer.

The underlying problem here is that the hardcoded constants in the asm make
this code really error prone - it's really easy to miss one of these & end up
with a typo like this.  So.

The magic value 0x40 represents the amount of stack frame that needs to be
dynamically allocated on entry through the cti trampoline stub.  We expect this
to be equal to the offset of enabledProfilerReference within JITStackFrame (and
assert such in the JITThunks constructor).

You could so something like:

    #define JIT_STACK_FRAME_ALLOCATION 0x40
    #define JIT_STACK_FRAME_ALLOCATION_string
STRINGIZE(JIT_STACK_FRAME_ALLOCATION)

then change all the asm to use this string instead of the hardcoded constant,
e.g.:

    "add sp, sp," JIT_STACK_FRAME_ALLOCATION_string "\n"

and make the assert in JITThunks::JITThunks be:

    // The fifth argument is the first item already on the stack.
    ASSERT(OBJECT_OFFSETOF(struct JITStackFrame, enabledProfilerReference) ==
JIT_STACK_FRAME_ALLOCATION);

Less had coded constants should hopefully make this code less fragile in the
future.

r+ with or without the asm/ASSERT changes suggested.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list