Bug 69821 - Switch RegisterSizedBoolean/dfgConvertJSValueToInt32 return type to size_t
Summary: Switch RegisterSizedBoolean/dfgConvertJSValueToInt32 return type to size_t
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-11 00:13 PDT by Gavin Barraclough
Modified: 2011-10-11 09:02 PDT (History)
2 users (show)

See Also:


Attachments
The patch (23.02 KB, patch)
2011-10-11 00:29 PDT, Gavin Barraclough
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 2011-10-11 00:13:44 PDT
Operations returning types Z (int32_t) and B (RegisterSizedBoolean - implemented as an intptr_t) are indistinguishable on 32-bit Linux, preventing the DFG JIT from building.

dfgConvertJSValueToInt32 would be better returning a value known to be register sized, for JSVALUE64 (we currently zero-extend in JIT code, potentially introducing an unnecessary mov), so by switching all associated operations to return a size_t we can fix the type problem on Linux & make it a small tweak that removes an unnecessary instruction.
Comment 1 Gavin Barraclough 2011-10-11 00:29:25 PDT
Created attachment 110482 [details]
The patch
Comment 2 WebKit Review Bot 2011-10-11 00:34:54 PDT
Attachment 110482 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1

Source/JavaScriptCore/dfg/DFGOperations.h:79:  DFG_OPERATION is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Source/JavaScriptCore/dfg/DFGOperations.h:80:  DFG_OPERATION is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Total errors found: 2 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Filip Pizlo 2011-10-11 00:42:58 PDT
Comment on attachment 110482 [details]
The patch

Wouldn't it be better to use uintptr_t instead of size_t?  size_t implies that you're describing the size of something in memory.  uintptr_t implies any unsigned pointer-sized word for holding any kind of integer or pointer, and doesn't imply any meaning (unlike size_t).  It might be less confusing in this case, since these operations are pretty much never returning the size of things.
Comment 4 Filip Pizlo 2011-10-11 00:44:24 PDT
Comment on attachment 110482 [details]
The patch

Eh, r=me to fix the build.  Your call if you want size_t or uintptr_t.
Comment 5 WebKit Review Bot 2011-10-11 09:01:58 PDT
Comment on attachment 110482 [details]
The patch

Clearing flags on attachment: 110482

Committed r97153: <http://trac.webkit.org/changeset/97153>
Comment 6 WebKit Review Bot 2011-10-11 09:02:02 PDT
All reviewed patches have been landed.  Closing bug.