Bug 58198 - Clean up JSValue implementation for JSVALUE64.
Summary: Clean up JSValue implementation for JSVALUE64.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Gavin Barraclough
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-09 21:12 PDT by Gavin Barraclough
Modified: 2011-04-11 11:32 PDT (History)
2 users (show)

See Also:


Attachments
The patch (96.36 KB, patch)
2011-04-09 21:50 PDT, Gavin Barraclough
sam: 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 2011-04-09 21:12:36 PDT
Remove JSNumberCell, JSImmediate, unify some methods between JSVALUE32_64/JSVALUE64

JSNumberCell.h largely just contained the constructors for JSValue on JSVALUE64, which should not have been here.  JSImmediate mostly contained uncalled methods, along with the internal implementation of the JSValue constructors split unnecessarily across a number of layers of function calls.  These could largely be merged back together.  Many methods and constructors from JSVALUE32_64 and JSVALUE64 can by unified.  The .cpp files are empty.

Moving all these methods into JSValue.h seems to be a repro measurable regression, so I have kept these methods in a separate JSValueInlineMethods.h.  Adding the 64-bit tag values as static const members of JSValue also measures as a repro regression, so I have made these #defines.
Comment 1 Gavin Barraclough 2011-04-09 21:50:42 PDT
Created attachment 88944 [details]
The patch
Comment 2 Cameron Zwarich (cpst) 2011-04-10 02:43:12 PDT
It's unfortunate that you have to make those things #defines...
Comment 3 Gavin Barraclough 2011-04-11 00:19:35 PDT
(In reply to comment #2)
> It's unfortunate that you have to make those things #defines...

Yeah. :-(  Still, on balance I think its clear that this is a really great clean up still, and these values are not used in ways that the lack of type checking is particularly concerning in this case, so I'm not too worried about this overall.

But I guess I really should be filing a bug against the compiler on this – adding a few static const integers to a class really shouldn't be a 2% regression.  Do you know what radar component I should be filing this against?

cheers, G.
Comment 4 Geoffrey Garen 2011-04-11 11:23:54 PDT
I love it!
Comment 5 Gavin Barraclough 2011-04-11 11:32:30 PDT
Fixed in r83459