Bug 123042
| Summary: | Adjust JSC Call Frame layout to conform to native calling conventions | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Michael Saboff <msaboff> |
| Component: | JavaScriptCore | Assignee: | Michael Saboff <msaboff> |
| Status: | ASSIGNED | ||
| Severity: | Normal | ||
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | All | ||
| Bug Depends on: | 123444 | ||
| Bug Blocks: | |||
Michael Saboff
The current JavaScript call frame is made up of 64 bit slots (arg count and codeLocation together make one slot). The ordering and size of these slots doesn't map well with native calling conventions.
struct oldCallFrameLayout {
JSValue codeBlock;
JSValue returnPC;
JSValue scopeChain;
JSValue callee;
JSValue callerFrame;
int32_t argCount;
uint32_t codeLocation;
JSValue arg0; // this
// Args 1 ... n
};
By changing the format of the call frame, JavaScript stack frames will be much more compliant with native calling conventions.
struct newCallFrameLayout {
void* callerFrame;
void* returnPC;
JSScope* scopeChain;
CodeBlock* codeBlock;
unsigned argCount;
unsigned codeOrigin;
JSValue callee;
JSValue arg0; // this
// Args 1 ... n
};
When fully transitioned, the callFrame pointer will point to a frame of this format on the stack. Local variables will begin at the callFrame pointer - 8.
For 32 bit platforms, the pointers will be 32 bits. For some platforms, callerFrame and returnPC should be reversed to conform with the order that the prior PC and frame pointer or pushed.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |