Bug 161500 - Rename WASM classes dropping the WASM prefix
Summary: Rename WASM classes dropping the WASM prefix
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Miller
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-01 12:01 PDT by Keith Miller
Modified: 2016-09-01 13:06 PDT (History)
4 users (show)

See Also:


Attachments
Patch (33.10 KB, patch)
2016-09-01 12:04 PDT, Keith Miller
mark.lam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Miller 2016-09-01 12:01:07 PDT
Rename WASM classes dropping the WASM prefix
Comment 1 Keith Miller 2016-09-01 12:04:46 PDT
Created attachment 287652 [details]
Patch
Comment 2 WebKit Commit Bot 2016-09-01 12:07:26 PDT
Attachment 287652 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/wasm/WASMFormat.h:63:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 1 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Keith Miller 2016-09-01 12:09:26 PDT
(In reply to comment #2)
> Attachment 287652 [details] did not pass style-queue:
> 
> 
> ERROR: Source/JavaScriptCore/wasm/WASMFormat.h:63:  Tests for true/false,
> null/non-null, and zero/non-zero should all be done without equality
> comparisons.  [readability/comparison_to_zero] [5]
> Total errors found: 1 in 14 files
> 
> 
> If any of these errors are false positives, please file a bug against
> check-webkit-style.

While this is technically a violation of WebKit style I think its are warranted in this case. The case is surrounded by other checks that the result of similar expressions are equal to non-zero values. Using ! instead just makes the code harder to read.
Comment 4 Mark Lam 2016-09-01 12:15:04 PDT
Comment on attachment 287652 [details]
Patch

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

r=me if you resolve the question about the Signature vector in WASMModuleParser.h.

> Source/JavaScriptCore/ChangeLog:11
> +        primitive type makes it much trivial to convert a Vector of WASM

/much/more/ or /much/much more/

> Source/JavaScriptCore/wasm/WASMModuleParser.h:61
> +    Vector<FunctionInformation> m_functions;
> +    Vector<Signature> m_signatures;

FunctionInformation embeds a Signature.  Why do we need this separate Signature Vector?  I also don't see it used anywhere.
Comment 5 Mark Lam 2016-09-01 12:15:46 PDT
Please fix the build failures too.
Comment 6 Keith Miller 2016-09-01 12:21:31 PDT
Comment on attachment 287652 [details]
Patch

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

Fixed the build failure locally.

>> Source/JavaScriptCore/wasm/WASMModuleParser.h:61
>> +    Vector<Signature> m_signatures;
> 
> FunctionInformation embeds a Signature.  Why do we need this separate Signature Vector?  I also don't see it used anywhere.

m_signatures owns the signatures used by FunctionInformation. It's likely that many functions all have the same signature so rather than duplicate that everywhere we just have each function point to a shared signature. You're right that it's not used in this patch. I'll delete them.
Comment 7 Mark Lam 2016-09-01 12:24:44 PDT
Comment on attachment 287652 [details]
Patch

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

>>> Source/JavaScriptCore/wasm/WASMModuleParser.h:61
>>> +    Vector<Signature> m_signatures;
>> 
>> FunctionInformation embeds a Signature.  Why do we need this separate Signature Vector?  I also don't see it used anywhere.
> 
> m_signatures owns the signatures used by FunctionInformation. It's likely that many functions all have the same signature so rather than duplicate that everywhere we just have each function point to a shared signature. You're right that it's not used in this patch. I'll delete them.

Ah.  I missed the detail that the signature in FunctionInformation is a Signature* and not the Signature itself.
Comment 8 Keith Miller 2016-09-01 13:06:00 PDT
Committed r205309: <http://trac.webkit.org/changeset/205309>