Bug 79271 - Allocations from CopiedBlocks should always be 8-byte aligned
Summary: Allocations from CopiedBlocks should always be 8-byte aligned
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Hahnenberg
URL:
Keywords:
Depends on:
Blocks: 79199
  Show dependency treegraph
 
Reported: 2012-02-22 13:06 PST by Mark Hahnenberg
Modified: 2012-02-22 14:27 PST (History)
1 user (show)

See Also:


Attachments
Patch (6.28 KB, patch)
2012-02-22 13:55 PST, Mark Hahnenberg
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hahnenberg 2012-02-22 13:06:45 PST
Currently, we only assert that allocations are pointer aligned. Since we don't want JSValues to potentially span cache lines, we need to make sure that all backing stores for storing JSValues are always 8-byte aligned.
Comment 1 Mark Hahnenberg 2012-02-22 13:55:15 PST
Created attachment 128282 [details]
Patch
Comment 2 Geoffrey Garen 2012-02-22 14:06:45 PST
Comment on attachment 128282 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=128282&action=review

r=me

> Source/JavaScriptCore/wtf/StdLibExtras.h:120
> +    ASSERT(sizeof(unsigned long long) == 8);
> +    return !((unsigned long long)(p) & (sizeof(unsigned long long) - 1));

The best data type for the cast is uintptr_t.

There's no reason to use sizeof(unsigned long long). You should just use 7 and 8, which is what your function guarantees, or sizeof(JSValue), since that's what you're worried about, or sizeof(double), which you should also be worried about.
Comment 3 Mark Hahnenberg 2012-02-22 14:27:51 PST
Committed r108553: <http://trac.webkit.org/changeset/108553>