Bug 141362 - Use a PairHash for DFGByteCodeParser's ConstantBufferKey
Summary: Use a PairHash for DFGByteCodeParser's ConstantBufferKey
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-07 14:35 PST by Benjamin Poulain
Modified: 2015-02-07 15:49 PST (History)
0 users

See Also:


Attachments
Patch (2.62 KB, patch)
2015-02-07 14:37 PST, Benjamin Poulain
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2015-02-07 14:35:52 PST
Use a PairHash for DFGByteCodeParser's ConstantBufferKey
Comment 1 Benjamin Poulain 2015-02-07 14:37:22 PST
Created attachment 246218 [details]
Patch
Comment 2 Darin Adler 2015-02-07 15:49:14 PST
Comment on attachment 246218 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=246218&action=review

> Source/JavaScriptCore/ChangeLog:10
> +        Use nullptr for pointers when possible.

Seems like we’d also want to use member initialization rather than initializing in each constructor. Makes it harder to accidentally leave m_codeBlock uninitialized.

> Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:84
> +        return WTF::pairIntHash(PtrHash<CodeBlock*>::hash(m_codeBlock), IntHash<unsigned>::hash(m_index));

Doesn’t pairIntHash already do enough hashing that we don’t need the IntHash<unsigned>::hash here? Also, that could just be WTF::intHash(m_index). I’m also not sure why HashFunctions.h doesn’t do using WTF::intHash and WTF::pairIntHash. No reason for us to be inconsistent about things like that.