Bug 141362

Summary: Use a PairHash for DFGByteCodeParser's ConstantBufferKey
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: New BugsAssignee: Benjamin Poulain <benjamin>
Status: NEW ---    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch darin: review+

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.