Bug 13386 - [js-collector-tweaks] Shrink Array by 4 bytes
Summary: [js-collector-tweaks] Shrink Array by 4 bytes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Maciej Stachowiak
URL:
Keywords:
Depends on:
Blocks: 13389
  Show dependency treegraph
 
Reported: 2007-04-18 00:52 PDT by Maciej Stachowiak
Modified: 2007-04-23 02:13 PDT (History)
0 users

See Also:


Attachments
06-js-gc-array-shrink.patch.txt (4.22 KB, patch)
2007-04-18 00:54 PDT, Maciej Stachowiak
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2007-04-18 00:52:24 PDT
Shrink ArrayInstance objects by 4 bytes. This enables further optimizations.
Comment 1 Maciej Stachowiak 2007-04-18 00:54:09 PDT
Created attachment 14067 [details]
06-js-gc-array-shrink.patch.txt
Comment 2 Darin Adler 2007-04-18 11:18:23 PDT
Comment on attachment 14067 [details]
06-js-gc-array-shrink.patch.txt

+  JSValue** storage = ((JSValue **)fastCalloc(capacity + 1, sizeof(JSValue *))) + 1;

I'd like to see this use static_cast rather than C-style cast, and put the * next to JSValue instead of including a space.

+    storage =  allocateStorage(newCapacity);

Two spaces after the equal sign.

+  storage = ((JSValue **)fastRealloc(storage - 1, (newCapacity + 1) * sizeof (JSValue*))) + 1;

static_cast again.

r=me
Comment 3 Maciej Stachowiak 2007-04-18 15:02:36 PDT
(In reply to comment #2)
> (From update of attachment 14067 [details] [edit])
> +  JSValue** storage = ((JSValue **)fastCalloc(capacity + 1, sizeof(JSValue
> *))) + 1;
> 
> I'd like to see this use static_cast rather than C-style cast, and put the *
> next to JSValue instead of including a space.
> 
> +    storage =  allocateStorage(newCapacity);
> 
> Two spaces after the equal sign.
> 
> +  storage = ((JSValue **)fastRealloc(storage - 1, (newCapacity + 1) * sizeof
> (JSValue*))) + 1;
> 
> static_cast again.
> 
> r=me
> 

Agreed on both of those.