Bug 20389 - 31 bit immediates FTW!
Summary: 31 bit immediates FTW!
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Gavin Barraclough
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-14 19:09 PDT by Gavin Barraclough
Modified: 2008-08-15 03:43 PDT (History)
1 user (show)

See Also:


Attachments
Patch (18.14 KB, patch)
2008-08-14 19:10 PDT, Gavin Barraclough
no flags Details | Formatted Diff | Diff
SunSpider Results (+2.3%, some runs are lower so I'm just calling this +2%) (5.55 KB, text/plain)
2008-08-14 19:12 PDT, Gavin Barraclough
no flags Details
Fix INT_MAX portability issue identified by bdash. (18.31 KB, patch)
2008-08-14 19:40 PDT, Gavin Barraclough
no flags Details | Formatted Diff | Diff
Replace a couple of magic constants (1 and 2) with their symbolic names. (18.41 KB, patch)
2008-08-14 20:19 PDT, Gavin Barraclough
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 2008-08-14 19:09:39 PDT
Shuffle around the encoding of JSImmediate to allow it to hold 31 bit signed integer values.  This is hugely helpful to JavaScript programs that, um, use 31 bit signed integer values.

+2% on SunSpider.
Comment 1 Gavin Barraclough 2008-08-14 19:10:32 PDT
Created attachment 22805 [details]
Patch
Comment 2 Gavin Barraclough 2008-08-14 19:12:50 PDT
Created attachment 22806 [details]
SunSpider Results (+2.3%, some runs are lower so I'm just calling this +2%)
Comment 3 Mark Rowe (bdash) 2008-08-14 19:21:57 PDT
I don't think that __INT_MAX__ is portable.  You should use either INT_MAX or std::numeric_limits<int>::max().
Comment 4 Gavin Barraclough 2008-08-14 19:40:56 PDT
Created attachment 22807 [details]
Fix INT_MAX portability issue identified by bdash.

Also remove redundant parens (again ty bdash).
Comment 5 Gavin Barraclough 2008-08-14 20:19:09 PDT
Created attachment 22810 [details]
Replace a couple of magic constants (1 and 2) with their symbolic names.

Stop fiddling around Gavin and go to sleep.  Bah.
Comment 6 Geoffrey Garen 2008-08-14 21:52:01 PDT
Comment on attachment 22810 [details]
Replace a couple of magic constants (1 and 2) with their symbolic names.

r=me
Comment 7 Gavin Barraclough 2008-08-15 03:43:29 PDT
Landed.

Sending        JavaScriptCore/ChangeLog
Sending        JavaScriptCore/kjs/JSImmediate.h
Transmitting file data ..
Committed revision 35778.