[webkit-dev] Proposal about integer types used in WebKit

Jozwiak, John jjozwiak at qualcomm.com
Fri Jul 24 15:03:59 PDT 2009

"so maybe it doesn't matter" assumes on Intel?

Would the observation change on, say, ARM?

From: webkit-dev-bounces at lists.webkit.org [webkit-dev-bounces at lists.webkit.org] On Behalf Of Geoffrey Garen [ggaren at apple.com]
Sent: Friday, July 24, 2009 2:27 PM
To: Darin Adler
Cc: WebKit Development
Subject: Re: [webkit-dev] Proposal about integer types used in WebKit

> Am I missing something? Is there some real benefit to using types
> like int32_t instead of int in some places in our code and not
> others? If so, what are these critical places and what makes them
> different from the rest of the code?

In JavaScriptCore, some structures have integer members that must be
32bits in size, regardless of processor type. In those places, int32_t
and uint32_t are useful.

Less clear to me is whether clients of such structures should also use
int32_t / uint32_t. For example:

struct {
        int32_t i;
} s;

int32_t i32 = s.i; // option 1
int i = s.i; // option 2

Technically, option 2, which converts from int32_t to int, requires a
"32bit move with sign extension to 64bit" instead of just a "32bit
move", but Intel's documentation says that 32bit to 64bit sign
extension is the very fastest instruction on the processor, so maybe
it doesn't matter.

webkit-dev mailing list
webkit-dev at lists.webkit.org

More information about the webkit-dev mailing list