WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
181262
WebAssembly: add C API and shell
https://bugs.webkit.org/show_bug.cgi?id=181262
Summary
WebAssembly: add C API and shell
JF Bastien
Reported
2018-01-03 15:49:35 PST
Now that our WebAssembly implementation doesn't assume that it's embedded into JavaScript, we can expose a native API where WebAssembly is embedded into C programs, using our full BBQ and OMG compilation pipeline. WebAssembly as implemented by WebKit is then truly neither Web nor Assembly. What better way to test this native API than to create a `wasm` shell which relies solely on the API and on no other part of WebKit? This `wasm` shell can load regular .wasm files, and do a few things with them as explained in its --help. Most interestingly it can call any exported function, passing arguments from the command-line as well as call results from other import calls. The first version of this patch has plenty of outstanding FIXMEs but has enough going that it can pass some of the spec tests (which don't have any imports). To reduce patch size I'll commit the 1665 spec .wasm files in a separate commit once they all pass. This will require implementing imports. I also have well over 10000 other .wasm files that I want to commit as a regression suite, which I'll also do separately.
Attachments
patch
(257.48 KB, patch)
2018-01-03 15:55 PST
,
JF Bastien
oliver
: review-
Details
Formatted Diff
Diff
patch
(262.55 KB, patch)
2018-01-04 16:09 PST
,
JF Bastien
achristensen
: review-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
JF Bastien
Comment 1
2018-01-03 15:51:24 PST
<
rdar://problem/34873616
>
JF Bastien
Comment 2
2018-01-03 15:52:21 PST
<
rdar://problem/35395338
>
JF Bastien
Comment 3
2018-01-03 15:55:12 PST
Created
attachment 330417
[details]
patch
EWS Watchlist
Comment 4
2018-01-03 15:57:56 PST
Attachment 330417
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/API/WAOptions.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAMemoryDescriptor.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAMemoryDescriptor.h:55: The parameter name "descriptor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAMemoryDescriptor.h:64: The parameter name "descriptor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATableDescriptor.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WATableDescriptor.h:54: The parameter name "table" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATableDescriptor.h:63: The parameter name "descriptor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.cpp:128: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/API/WAModule.cpp:129: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] ERROR: Source/JavaScriptCore/API/WAModule.cpp:138: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/API/WATable.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WATable.h:46: The parameter name "descriptor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:46: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:53: The parameter name "table" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:61: The parameter name "table" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:70: The parameter name "table" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:80: The parameter name "table" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:80: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:90: The parameter name "table" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:90: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WABase.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/wasm.cpp:33: Streams are highly discouraged. [readability/streams] [3] ERROR: Source/JavaScriptCore/wasm.cpp:37: Multi-line string ("...") found. This lint script doesn't do well with such strings, and may give bogus warnings. They're ugly and unnecessary, and you should use concatenation instead". [readability/multiline_string] [5] ERROR: Source/JavaScriptCore/wasm.cpp:37: Missing spaces around | [whitespace/operators] [3] ERROR: Source/JavaScriptCore/wasm.cpp:38: Extra space before [. [whitespace/brackets] [5] ERROR: Source/JavaScriptCore/wasm.cpp:42: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:43: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:44: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:45: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:46: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:47: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:48: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/wasm.cpp:48: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:49: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/wasm.cpp:49: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:50: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/wasm.cpp:50: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:54: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/wasm.cpp:56: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:60: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:61: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:62: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:66: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/wasm.cpp:66: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:70: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:71: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:72: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:73: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:74: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:75: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:76: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:77: Multi-line string ("...") found. This lint script doesn't do well with such strings, and may give bogus warnings. They're ugly and unnecessary, and you should use concatenation instead". [readability/multiline_string] [5] ERROR: Source/JavaScriptCore/wasm.cpp:77: Missing spaces around | [whitespace/operators] [3] ERROR: Source/JavaScriptCore/wasm.cpp:90: More than one command on the same line [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:92: More than one command on the same line [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:94: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:96: A case label should not be indented, but line up with its switch statement. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/wasm.cpp:113: More than one command on the same line [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:119: More than one command on the same line [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:123: More than one command on the same line [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:177: Use 'WTFMove()' instead of 'std::move()'. [runtime/wtf_move] [4] ERROR: Source/JavaScriptCore/wasm.cpp:191: More than one command on the same line [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:211: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/wasm.cpp:216: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/wasm.cpp:223: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:224: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:234: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:277: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:288: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:299: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:311: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:320: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:322: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/wasm.cpp:328: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:330: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/wasm.cpp:336: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:338: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/wasm.cpp:350: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:356: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:361: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:416: More than one command on the same line [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:416: Use equivelent function in <wtf/ASCIICType.h> instead of the isspace() function. [runtime/ctype_function] [4] ERROR: Source/JavaScriptCore/wasm.cpp:416: More than one command on the same line in while [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:436: Use equivelent function in <wtf/ASCIICType.h> instead of the tolower() function. [runtime/ctype_function] [4] ERROR: Source/JavaScriptCore/wasm.cpp:439: Use equivelent function in <wtf/ASCIICType.h> instead of the isxdigit() function. [runtime/ctype_function] [4] ERROR: Source/JavaScriptCore/wasm.cpp:439: More than one command on the same line in while [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:440: Use equivelent function in <wtf/ASCIICType.h> instead of the tolower() function. [runtime/ctype_function] [4] ERROR: Source/JavaScriptCore/wasm.cpp:441: Use equivelent function in <wtf/ASCIICType.h> instead of the tolower() function. [runtime/ctype_function] [4] ERROR: Source/JavaScriptCore/wasm.cpp:441: More than one command on the same line in while [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:449: More than one command on the same line in while [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:450: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:456: More than one command on the same line in while [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:457: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:466: More than one command on the same line in while [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:467: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:500: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:508: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:509: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:510: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:511: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:512: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:513: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:514: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:515: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:516: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:517: Else clause should never be on same line as else (use 2 lines) [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:558: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:592: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:597: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:628: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:643: next_import is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/JavaScriptCore/wasm.cpp:647: Semicolon defining empty statement. Use { } instead. [whitespace/semicolon] [5] ERROR: Source/JavaScriptCore/wasm.cpp:661: One line control clauses should not use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp:42: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/JavaScriptCore/API/WAImportObject.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAImportObject.h:51: The parameter name "importObject" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImportObject.h:63: The parameter name "importObject" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImportObject.h:63: The parameter name "function" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImportObject.h:75: The parameter name "importObject" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImportObject.h:75: The parameter name "table" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImportObject.h:87: The parameter name "importObject" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImportObject.h:87: The parameter name "memory" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:49: The parameter name "context" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:49: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:49: The parameter name "importObject" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:49: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:56: The parameter name "instance" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:67: The parameter name "instance" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:76: The parameter name "instance" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:85: The parameter name "instance" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:94: The parameter name "instance" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:48: The parameter name "global" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:56: The parameter name "global" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:64: The parameter name "global" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:72: The parameter name "global" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:80: The parameter name "global" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:88: The parameter name "global" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:96: The parameter name "global" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAExport.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAExport.h:49: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAExport.h:49: The parameter name "expor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAExport.h:58: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAExport.h:58: The parameter name "expor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAExport.h:67: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAExport.h:67: The parameter name "expor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAName.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAName.h:49: The parameter name "size" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAName.h:56: The parameter name "name" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAName.h:63: The parameter name "name" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAName.h:71: The parameter name "name" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:49: The parameter name "context" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:49: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:61: The parameter name "context" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:61: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:68: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:78: The parameter name "context" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:78: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:78: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:87: The parameter name "context" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:87: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:87: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:95: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:104: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:113: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:122: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WASignature.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WASignature.h:48: The parameter name "signature" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WASignature.h:56: The parameter name "signature" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WASignature.h:65: The parameter name "signature" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WASignature.h:73: The parameter name "signature" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WASignature.h:82: The parameter name "signature" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAMemory.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAMemory.h:46: The parameter name "descriptor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAMemory.h:46: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAMemory.h:53: The parameter name "memory" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAMemory.h:60: The parameter name "memory" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAMemory.h:68: The parameter name "memory" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAMemory.h:78: The parameter name "memory" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAException.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAException.h:48: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAException.h:56: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAException.h:64: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:38: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:51: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:80: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:97: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:306: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:312: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:357: An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:415: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:416: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:417: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:418: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/API/WAFunction.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAFunction.h:47: The parameter name "signature" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAFunction.h:54: The parameter name "function" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAFunction.h:62: The parameter name "function" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAFunction.h:73: The parameter name "instance" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAFunction.h:73: The parameter name "function" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAFunction.h:73: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WebAssembly.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:49: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:49: The parameter name "import" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:58: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:58: The parameter name "import" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:67: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:67: The parameter name "import" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:76: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:76: The parameter name "import" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAContext.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAContext.h:51: The parameter name "context" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:31: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:46: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:47: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:69: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:85: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:86: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:87: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:88: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:113: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:119: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:120: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:121: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:122: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:123: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:124: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:125: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] Total errors found: 231 in 60 files If any of these errors are false positives, please file a bug against check-webkit-style.
Oliver Hunt
Comment 5
2018-01-03 16:41:01 PST
Comment on
attachment 330417
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=330417&action=review
There's a lot of work needed for this. The Release functions should all be single parameter, otherwise you're just requiring the developer to maintain two separate object lifetimes. Almost all const char*s should be JSStringRef, ditto for WAName, etc. Have a look at the rest of the JSC C API to get an idea of what things are char* vs. jsstringref
> Source/JavaScriptCore/API/APICast.h:56 > +class ExecState; > +class PropertyNameArray; > +class VM; > +class JSObject; > +class JSValue; > +namespace Wasm { > +struct Context; > +struct Export; > +struct Import; > +class Memory; > +class Module; > +class Signature; > +class Table; > +namespace API { > +struct Exception; > +struct Function; > +struct Global; > +struct ImportObject; > +struct Instance; > +struct Name; > +} > +}
r-
> Source/JavaScriptCore/API/WABase.h:75 > +@constant kWAExceptionAPIUsageFailure Failure wasn't due to WebAssembly, but to usage of the API. > +@constant kWAExceptionValidationError Validation error of a WebAssembly Module. > +@constant kWAExceptionCompileError Compile error during validation or decoding of a WebAssembly Module. > +@constant kWAExceptionLinkError Link error during instantiation of a WebAssembly Module (other than traps from the start function). > +@constant kWAExceptionRuntimeError Runtime error due to a WebAssembly trap during execution. > +@constant kWAExceptionStackOverflow Stack overflow. > +@constant kWAExceptionOutOfMemory Out of memory.
I'm not sure I like the wording of the descriptions for these
> Source/JavaScriptCore/API/WABase.h:88 > +/*! @typedef A WebAssembly context holds global state which enables fast execution. */
"fast execution"? Why isn't this something like "A WAContextRef provides the environment for execution a web assembly program"
> Source/JavaScriptCore/API/WABase.h:118 > +/*! @typedef A WebAssembly name, specified to be a valid UTF-8 byte sequence. */
if this is a utf8 string, then this should just be const char*, but I'm fairly sure you actually want it to be a ref counted string, so my inclination would be to replace WANameRef with JSStringRef -- we don't need more string types.
> Source/JavaScriptCore/API/WAContext.h:44 > +JS_EXPORT WAContextRef WAContextCreate() CF_AVAILABLE(10_14, 12_0);
Are there any properties you could want? This should probably take a versioned configuration struct, I would expect that to at minimum include a name field, so people can identify their contexts.
> Source/JavaScriptCore/API/WAException.cpp:42 > +const char* WAExceptionGetReason(WAExceptionRef exception)
JSStringRef would be more consistent, but jsstringref is so terrible to work with. ggaren may have feelings on this.
> Source/JavaScriptCore/API/WAException.h:64 > +JS_EXPORT const char* WAExceptionGetReason(WAExceptionRef exception) CF_AVAILABLE(10_14, 12_0);
JSStringRef?
> Source/JavaScriptCore/API/WAExport.h:49 > +JS_EXPORT void WAExportRelease(WAModuleRef module, WAExportRef expor) CF_AVAILABLE(10_14, 12_0);
Release functions don't generally take more than one argument -- if a WAExportRef is strictly tied to a Module, then it should retain that information internally. You would presumably need to do that anyway to guard against corruptions due to misuse of the API. (The fact that JSValue[Unp/P]rotect requires a context make JSC obtuse to use)
> Source/JavaScriptCore/API/WAExport.h:58 > +JS_EXPORT WANameRef WAExportGetField(WAModuleRef module, WAExportRef expor) CF_AVAILABLE(10_14, 12_0);
GetFieldName? JSStringRef. Remove the module parameter.
> Source/JavaScriptCore/API/WAExport.h:67 > +JS_EXPORT WAExternalKind WAExportGetKind(WAModuleRef module, WAExportRef expor) CF_AVAILABLE(10_14, 12_0);
remove module
> Source/JavaScriptCore/API/WAFunction.h:46 > + */
my inclination here would be const void* and void*. I think that there should also be a return type so you can report an error from the call back. I would probably do (and making the typedef will be necessary for API review); typedef int32_t (*WAFunctionCallBack)(WASignatureRef, const void* arguments, void* return_value); This also makes the layout ABI, and requires developers to understand how that works. If you had typedef struct OpaqueWAFunctionArguments *WAFunctionArgumentsRef; WASignatureRef WAFunctionArgumentsGetSignature(WAFunctionArgumentsRef); WAFunctionArgumentsGetArgument(WAFunctionArgumentsRef, WAValueType, void* out); WAFunctionArgumentsSetReturn(WAFunctionArgumentsRef, WAValueType, void* in); Having got to the end WAFunctionArguments should probably be something like WAFunctionCallContext
> Source/JavaScriptCore/API/WAFunction.h:73 > +JS_EXPORT void WAFunctionCall(WAInstanceRef instance, const char arguments[], char returns[], WAFunctionRef function, WAExceptionRef* exception) CF_AVAILABLE(10_14, 12_0);
WACallContextRef :D
> Source/JavaScriptCore/API/WAImportObject.h:87 > +JS_EXPORT void WAImportObjectAddMemory(WAImportObjectRef importObject, const char* module, size_t moduleLength, const char * field, size_t fieldLength, WAMemoryRef memory) CF_AVAILABLE(10_14, 12_0);
Why is this not an array strings? is the '.' semantically important? What happens if I do Add*(..., "foo.bar", "wibble", ...)? Does it need to be separated? or can we just use .'s? JSStringRef. :D
> Source/JavaScriptCore/API/WAModule.h:87 > +JS_EXPORT void WAModuleCompile(WAContextRef context, WAModuleRef module, WAExceptionRef* exception) CF_AVAILABLE(10_14, 12_0);
Am I allowed to compile without validating first? I assume so, but I want confirmation (not in the documentation, just for review purposes)
JF Bastien
Comment 6
2018-01-04 16:09:14 PST
Created
attachment 330501
[details]
patch - Address some comments. - Fix release build (I had an unused debug variable). - Disable 32-bit compilation with #if ENABLE_WEBASSEMBLY in .cpp files. - Disable Windows build through cmake with ENABLE_WEBASSEMBLY. - Fix GTK build by not including config.h in wasm.cpp, and defining everything in that file instead. It's meant to stand alone without any WTF or other support (just using the wasm API from the framework) so it really shouldn't have config.h.
> The Release functions should all be > single parameter, otherwise you're just requiring the developer to maintain > two separate object lifetimes.
That was just on import and export, right? If so, done.
> Almost all const char*s should be JSStringRef, ditto for WAName, etc. Have > a look at the rest of the JSC C API to get an idea of what things are char* > vs. jsstringref
I don't believe this is correct. I expanded the WAName documentation to explain why. Reproduced here: A WebAssembly Name, as defined by the WebAssembly specification, isn't the same as a C or C++ string. The string is sized, and is not null-terminated. The bytes are valid UTF-8 encoded codepoints, but may not be valid Unicode. Of note: the Name can contain null characters, isn't necessarily canonical, may have mismatched surrogate pairs, may have misplaced BOMs, etc. Other char* APIs: - WAException could be something else than char*, but the goal here is to offer a C API. It's unclear that I'd ever want to return non-ASCII errors. - WAMemoryBuffer / WAModule / WATableDescriptor are char* because it's a bunch of bytes. Without std::byte the only appropriate types are char* and unsigned char*.
> > Source/JavaScriptCore/API/APICast.h:56 > > +class ExecState; > > +class PropertyNameArray; > > +class VM; > > +class JSObject; > > +class JSValue; > > +namespace Wasm { > > +struct Context; > > +struct Export; > > +struct Import; > > +class Memory; > > +class Module; > > +class Signature; > > +class Table; > > +namespace API { > > +struct Exception; > > +struct Function; > > +struct Global; > > +struct ImportObject; > > +struct Instance; > > +struct Name; > > +} > > +} > > r-
What's r- here? It follows the above pattern.
> > Source/JavaScriptCore/API/WABase.h:75 > > +@constant kWAExceptionAPIUsageFailure Failure wasn't due to WebAssembly, but to usage of the API. > > +@constant kWAExceptionValidationError Validation error of a WebAssembly Module. > > +@constant kWAExceptionCompileError Compile error during validation or decoding of a WebAssembly Module. > > +@constant kWAExceptionLinkError Link error during instantiation of a WebAssembly Module (other than traps from the start function). > > +@constant kWAExceptionRuntimeError Runtime error due to a WebAssembly trap during execution. > > +@constant kWAExceptionStackOverflow Stack overflow. > > +@constant kWAExceptionOutOfMemory Out of memory. > > I'm not sure I like the wording of the descriptions for these
What specifically?
> > Source/JavaScriptCore/API/WABase.h:88 > > +/*! @typedef A WebAssembly context holds global state which enables fast execution. */ > > "fast execution"?
>
> Why isn't this something like "A WAContextRef provides the environment for > execution a web assembly program"
Improved.
> > Source/JavaScriptCore/API/WABase.h:118 > > +/*! @typedef A WebAssembly name, specified to be a valid UTF-8 byte sequence. */ > > if this is a utf8 string, then this should just be const char*, but I'm > fairly sure you actually want it to be a ref counted string, so my > inclination would be to replace WANameRef with JSStringRef -- we don't need > more string types.
See above.
> > Source/JavaScriptCore/API/WAContext.h:44 > > +JS_EXPORT WAContextRef WAContextCreate() CF_AVAILABLE(10_14, 12_0); > > Are there any properties you could want? > > This should probably take a versioned configuration struct, I would expect > that to at minimum include a name field, so people can identify their > contexts.
Context is used in two ways: - During compilation it's a key that tells us whether we're already compiling something. - At runtime it's a thread-specific global which the JITed code accesses as a fast cache for data. Right now it basically only contains the Wasm::Instance, but we've got bugs filed to remove indirections by adding more to the context. If that helps: in a JavaScript embedding it's something that lives on VM. For the wasm shell I just create it on the stack, because there's just one. Once we support threads we'll have one per thread. I don't understand why you'd want to give it a name. It looks like JSContext can have a name for remote debugging? Setting names after creating the context is better than using versioned structs TBH. The name really isn't a fundamental property of the context.
> > Source/JavaScriptCore/API/WAException.cpp:42 > > +const char* WAExceptionGetReason(WAExceptionRef exception) > > JSStringRef would be more consistent, but jsstringref is so terrible to work > with. ggaren may have feelings on this.
See above.
> > Source/JavaScriptCore/API/WAException.h:64 > > +JS_EXPORT const char* WAExceptionGetReason(WAExceptionRef exception) CF_AVAILABLE(10_14, 12_0); > > JSStringRef?
See above.
> > Source/JavaScriptCore/API/WAExport.h:49 > > +JS_EXPORT void WAExportRelease(WAModuleRef module, WAExportRef expor) CF_AVAILABLE(10_14, 12_0); > > Release functions don't generally take more than one argument -- if a > WAExportRef is strictly tied to a Module, then it should retain that > information internally. You would presumably need to do that anyway to guard > against corruptions due to misuse of the API. > > (The fact that JSValue[Unp/P]rotect requires a context make JSC obtuse to > use)
Fixed. Right now it's a no-op because the Module just owns import / export.
> > Source/JavaScriptCore/API/WAExport.h:58 > > +JS_EXPORT WANameRef WAExportGetField(WAModuleRef module, WAExportRef expor) CF_AVAILABLE(10_14, 12_0); > > GetFieldName? JSStringRef.
Again, this is a WebAssembly concept.
> Remove the module parameter.
Why? I guess what's coming out is that import / export might just need to be indices into Module, and then I'd move all import / export functionality to the module?
> > Source/JavaScriptCore/API/WAExport.h:67 > > +JS_EXPORT WAExternalKind WAExportGetKind(WAModuleRef module, WAExportRef expor) CF_AVAILABLE(10_14, 12_0); > > remove module
Ditto.
> > Source/JavaScriptCore/API/WAFunction.h:46 > > + */ > > my inclination here would be const void* and void*.
Why? The Right Way to point to bytes in C is char* or unsigned char*.
> I think that there > should also be a return type so you can report an error from the call back.
That's simply not how the WebAssembly import mechanism works. The embedder gives imports to the module, and that import must take in + return values from the 4 basic datatypes. There's no built-in way in which errors can be propagated. Code which wants to return errors must do so on their own (say use an enum and return i32 / i64, or write a value in a special part of the memory, or just trap / unwind). It's true, however, that JavaScript can throw, which will totally unwind through WebAssembly and be catchable by the caller (so in js0 -> wasm -> js1, js1 can throw and js0 can catch). We've talked about supporting exception catching in wasm, but it's still very handwavy. Given this, I could have a return value enum that, for now, just says: enum CallResult { Continue, Abort }; That's not really great though, because you want to be able to propagate arbitrary embedder exceptions... So maybe the callee should return a WAEmbedderExceptionRef or something like this? nullptr means carry on, and (for now) non-nullptr means unwind over WebAssembly? Eventually, when we support exceptions in WebAssembly, you can catch the embedder exception. WDYT?
> > Source/JavaScriptCore/API/WAFunction.h:73 > > +JS_EXPORT void WAFunctionCall(WAInstanceRef instance, const char arguments[], char returns[], WAFunctionRef function, WAExceptionRef* exception) CF_AVAILABLE(10_14, 12_0); > > WACallContextRef :D
The instance already has a context. You can't call into an instance from a different context. I'm not sure what a *call* context would be.
> > Source/JavaScriptCore/API/WAImportObject.h:87 > > +JS_EXPORT void WAImportObjectAddMemory(WAImportObjectRef importObject, const char* module, size_t moduleLength, const char * field, size_t fieldLength, WAMemoryRef memory) CF_AVAILABLE(10_14, 12_0); > > Why is this not an array strings? is the '.' semantically important? What > happens if I do Add*(..., "foo.bar", "wibble", ...)? Does it need to be > separated? or can we just use .'s?
"module" and "field" are a double-namespace as defined by WebAssembly's import object. I'm not sure what you mean by "array strings". These aren't strings, they're a collection of valid UTF-8 codepoints, so any value can be in there and I can't really steal one for my own purpose.
> > Source/JavaScriptCore/API/WAModule.h:87 > > +JS_EXPORT void WAModuleCompile(WAContextRef context, WAModuleRef module, WAExceptionRef* exception) CF_AVAILABLE(10_14, 12_0); > > Am I allowed to compile without validating first? I assume so, but I want > confirmation (not in the documentation, just for review purposes)
Yes. The exception will be a validation error if compilation fails because of validation.
EWS Watchlist
Comment 7
2018-01-04 16:12:56 PST
Attachment 330501
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/API/WAOptions.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAMemoryDescriptor.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAMemoryDescriptor.h:55: The parameter name "descriptor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAMemoryDescriptor.h:64: The parameter name "descriptor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATableDescriptor.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WATableDescriptor.h:54: The parameter name "table" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATableDescriptor.h:63: The parameter name "descriptor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.cpp:130: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/API/WAModule.cpp:131: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] ERROR: Source/JavaScriptCore/API/WAModule.cpp:140: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/API/WATable.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WATable.h:46: The parameter name "descriptor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:46: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:53: The parameter name "table" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:61: The parameter name "table" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:70: The parameter name "table" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:80: The parameter name "table" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:80: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:90: The parameter name "table" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WATable.h:90: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WABase.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/wasm.cpp:32: Streams are highly discouraged. [readability/streams] [3] ERROR: Source/JavaScriptCore/wasm.cpp:36: Multi-line string ("...") found. This lint script doesn't do well with such strings, and may give bogus warnings. They're ugly and unnecessary, and you should use concatenation instead". [readability/multiline_string] [5] ERROR: Source/JavaScriptCore/wasm.cpp:36: Missing spaces around | [whitespace/operators] [3] ERROR: Source/JavaScriptCore/wasm.cpp:37: Extra space before [. [whitespace/brackets] [5] ERROR: Source/JavaScriptCore/wasm.cpp:41: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:42: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:43: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:44: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:45: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:46: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:47: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/wasm.cpp:47: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:48: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/wasm.cpp:48: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:49: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/wasm.cpp:49: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:53: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/wasm.cpp:55: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:59: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:60: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:61: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:65: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/wasm.cpp:65: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:69: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:70: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:71: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:72: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:73: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:74: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:75: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:76: Multi-line string ("...") found. This lint script doesn't do well with such strings, and may give bogus warnings. They're ugly and unnecessary, and you should use concatenation instead". [readability/multiline_string] [5] ERROR: Source/JavaScriptCore/wasm.cpp:76: Missing spaces around | [whitespace/operators] [3] ERROR: Source/JavaScriptCore/wasm.cpp:95: More than one command on the same line [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:97: More than one command on the same line [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:99: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:101: A case label should not be indented, but line up with its switch statement. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/wasm.cpp:118: More than one command on the same line [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:124: More than one command on the same line [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:128: More than one command on the same line [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:182: Use 'WTFMove()' instead of 'std::move()'. [runtime/wtf_move] [4] ERROR: Source/JavaScriptCore/wasm.cpp:196: More than one command on the same line [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:216: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/wasm.cpp:221: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/wasm.cpp:228: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:229: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:239: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:282: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:293: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:304: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:316: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:325: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:327: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/wasm.cpp:333: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:335: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/wasm.cpp:341: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:343: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/wasm.cpp:355: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:361: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:366: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:421: More than one command on the same line [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:421: Use equivelent function in <wtf/ASCIICType.h> instead of the isspace() function. [runtime/ctype_function] [4] ERROR: Source/JavaScriptCore/wasm.cpp:421: More than one command on the same line in while [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:441: Use equivelent function in <wtf/ASCIICType.h> instead of the tolower() function. [runtime/ctype_function] [4] ERROR: Source/JavaScriptCore/wasm.cpp:444: Use equivelent function in <wtf/ASCIICType.h> instead of the isxdigit() function. [runtime/ctype_function] [4] ERROR: Source/JavaScriptCore/wasm.cpp:444: More than one command on the same line in while [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:445: Use equivelent function in <wtf/ASCIICType.h> instead of the tolower() function. [runtime/ctype_function] [4] ERROR: Source/JavaScriptCore/wasm.cpp:446: Use equivelent function in <wtf/ASCIICType.h> instead of the tolower() function. [runtime/ctype_function] [4] ERROR: Source/JavaScriptCore/wasm.cpp:446: More than one command on the same line in while [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:454: More than one command on the same line in while [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:455: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:461: More than one command on the same line in while [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:462: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:471: More than one command on the same line in while [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:472: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:505: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:513: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:514: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:515: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:516: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:517: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:518: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:519: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:520: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:521: More than one command on the same line in if [whitespace/parens] [4] ERROR: Source/JavaScriptCore/wasm.cpp:522: Else clause should never be on same line as else (use 2 lines) [whitespace/newline] [4] ERROR: Source/JavaScriptCore/wasm.cpp:563: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:597: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:602: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm.cpp:633: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] ERROR: Source/JavaScriptCore/wasm.cpp:648: next_import is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/JavaScriptCore/wasm.cpp:652: Semicolon defining empty statement. Use { } instead. [whitespace/semicolon] [5] ERROR: Source/JavaScriptCore/wasm.cpp:666: One line control clauses should not use braces. [whitespace/braces] [4] ERROR: Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp:42: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/JavaScriptCore/API/WAImportObject.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAImportObject.h:51: The parameter name "importObject" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImportObject.h:63: The parameter name "importObject" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImportObject.h:63: The parameter name "function" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImportObject.h:75: The parameter name "importObject" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImportObject.h:75: The parameter name "table" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImportObject.h:87: The parameter name "importObject" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImportObject.h:87: The parameter name "memory" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:49: The parameter name "context" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:49: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/Ja vaScriptCore/API/WAInstance.h:49: The parameter name "importObject" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:49: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:56: The parameter name "instance" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:67: The parameter name "instance" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:76: The parameter name "instance" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:85: The parameter name "instance" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.h:94: The parameter name "instance" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:48: The parameter name "global" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:56: The parameter name "global" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:64: The parameter name "global" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:72: The parameter name "global" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:80: The parameter name "global" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:88: The parameter name "global" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAGlobal.h:96: The parameter name "global" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAExport.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAExport.h:48: The parameter name "expor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAExport.h:57: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAExport.h:57: The parameter name "expor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAExport.h:66: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAExport.h:66: The parameter name "expor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAName.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAName.h:50: The parameter name "size" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAName.h:57: The parameter name "name" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAName.h:64: The parameter name "name" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAName.h:72: The parameter name "name" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:49: The parameter name "context" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:49: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:61: The parameter name "context" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:61: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:68: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:78: The parameter name "context" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:78: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:78: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:87: The parameter name "context" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:87: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:87: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:95: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:104: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:113: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAModule.h:122: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WASignature.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WASignature.h:48: The parameter name "signature" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WASignature.h:56: The parameter name "signature" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WASignature.h:65: The parameter name "signature" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WASignature.h:73: The parameter name "signature" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WASignature.h:82: The parameter name "signature" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAMemory.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAMemory.h:46: The parameter name "descriptor" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAMemory.h:46: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAMemory.h:53: The parameter name "memory" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAMemory.h:60: The parameter name "memory" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAMemory.h:68: The parameter name "memory" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAMemory.h:78: The parameter name "memory" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAException.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAException.h:48: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAException.h:56: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAException.h:64: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:40: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:53: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:82: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:99: Missing space before { [whitespace/braces] [5] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:308: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:314: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:361: An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:419: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:420: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:421: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/API/WAInstance.cpp:422: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/JavaScriptCore/API/WAFunction.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAFunction.h:47: The parameter name "signature" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAFunction.h:54: The parameter name "function" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAFunction.h:62: The parameter name "function" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAFunction.h:73: The parameter name "instance" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAFunction.h:73: The parameter name "function" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAFunction.h:73: The parameter name "exception" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WebAssembly.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:48: The parameter name "import" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:57: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:57: The parameter name "import" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:66: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:66: The parameter name "import" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:75: The parameter name "module" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAImport.h:75: The parameter name "import" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAContext.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/JavaScriptCore/API/WAContext.h:51: The parameter name "context" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:33: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:48: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:49: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:71: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:87: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:88: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:89: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:90: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:115: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:121: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:122: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:123: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:124: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:125: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:126: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/API/WAAPIWrappers.h:127: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] Total errors found: 229 in 59 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alex Christensen
Comment 8
2018-01-26 12:50:50 PST
Comment on
attachment 330501
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=330501&action=review
> Source/JavaScriptCore/API/WAContext.h:51 > +JS_EXPORT void WAContextRelease(WAContextRef context) CF_AVAILABLE(10_14, 12_0);
WAContextDestroy?
> Source/JavaScriptCore/API/WAModule.h:61 > +JS_EXPORT WAModuleRef WAModuleCreateFromText(WAContextRef context, const char* module, size_t byteLength, WAExceptionRef* exception) CF_AVAILABLE(10_14, 12_0);
We can create a module from binary or from text. Will anyone want to have a getter for the text form or binary form?
> Source/JavaScriptCore/API/WAModule.h:87 > +JS_EXPORT void WAModuleCompile(WAContextRef context, WAModuleRef module, WAExceptionRef* exception) CF_AVAILABLE(10_14, 12_0);
I don't think we need parameter names like context, module, and exception. Do we always want to compile synchronously? Will we ever want a callback once the compiling is done on a different thread?
> Source/JavaScriptCore/API/WAModule.h:104 > +JS_EXPORT void WAModuleForEachExport(WAModuleRef module, void (*action)(WAModuleRef, WAExportRef)) CF_AVAILABLE(10_14, 12_0);
I think all of these need a const void* that you give to the function that it gives back in the callback so we can pass in a structure and have access to things inside of the callback from outside of the callback. We do something similar in WKPageNavigationClient. const void*.
> Source/JavaScriptCore/API/WAName.cpp:44 > +size_t WANameGetSize(WANameRef name)
This looks a lot like JSStringRef, which has "Length" instead of "Size". Also, is the size always the same as the utf8 size even if you have characters that need encoding? JSStringRef has comparison functions. Will we ever have anything else in WebAssembly that we use Strings for?
> Source/JavaScriptCore/API/WAName.h:57 > +JS_EXPORT void WANameRelease(WANameRef name) CF_AVAILABLE(10_14, 12_0);
Destroy?
> Source/JavaScriptCore/API/WAOptions.cpp:34 > +void WAEnableFastMemory()
Is there a way to disable fast memory?
> Source/JavaScriptCore/API/WAOptions.h:46 > + @discussion Fast memories aren't enabled by default because they require large virtual allocations for each memory (slightly above 4GiB per), and require installing signal handlers to handle out-of-bounds memory accesses. Fast memory provides on the order of 20% performance improvement over explicit bounds-check.
I'm not sure we should be making performance claims in the API.
> Source/JavaScriptCore/API/WASignature.h:48 > +JS_EXPORT void WASignatureRelease(WASignatureRef signature) CF_AVAILABLE(10_14, 12_0);
There's no corresponding retain.
> Source/JavaScriptCore/API/WATableDescriptor.h:54 > +JS_EXPORT void WATableDescriptorRelease(WATableRef table) CF_AVAILABLE(10_14, 12_0);
This has no implementation and no corresponding retain.
Oliver Hunt
Comment 9
2018-01-26 13:08:03 PST
Comment on
attachment 330501
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=330501&action=review
>> Source/JavaScriptCore/API/WAContext.h:51 >> +JS_EXPORT void WAContextRelease(WAContextRef context) CF_AVAILABLE(10_14, 12_0); > > WAContextDestroy?
release is standard nomenclature
letz
Comment 10
2018-01-31 03:24:54 PST
"We can expose a native API where WebAssembly is embedded into C programs" ==> I am *very* interested by this kind of use-case in the context of our Faust DSL language for DSP audio programming (
http://faust.grame.fr
and
http://faust.grame.fr/news/2017/09/15/backend-benchmarks.html
). I've already created a WAVM<==>Faust link that allows to run Faust wasm generated code in the C++/LLVM based WAVM runtime see
https://github.com/sletz/WAVM/tree/faust
. Is there any release date for this feature?
JF Bastien
Comment 11
2018-01-31 08:50:14 PST
(In reply to letz from
comment #10
)
> "We can expose a native API where WebAssembly is embedded into C programs" > ==> I am *very* interested by this kind of use-case in the context of our > Faust DSL language for DSP audio programming (
http://faust.grame.fr
and >
http://faust.grame.fr/news/2017/09/15/backend-benchmarks.html
). > > I've already created a WAVM<==>Faust link that allows to run Faust wasm > generated code in the C++/LLVM based WAVM runtime see >
https://github.com/sletz/WAVM/tree/faust
. > > Is there any release date for this feature?
It'll get checked in once I address comments, but right now I'm unfortunately dealing with another high-priority thing. I should be able to get back to this in a bit. This says nothing of release dates, or whether it'll ever get released :-)
letz
Comment 12
2018-01-31 09:41:27 PST
Thanks. Is there any way to "push" si that this would be released :-) ? Developer feedback? Use-case more precise explanation?
Alex Christensen
Comment 13
2018-01-31 15:52:56 PST
(In reply to letz from
comment #10
)
> Is there any release date for this feature?
We do not comment on future releases. (In reply to letz from
comment #12
)
> Thanks. Is there any way to "push" si that this would be released :-) ? > Developer feedback? Use-case more precise explanation?
If you want, you could build your own JavaScriptCore with this patch applied, and build your own application that uses it. If there's anything obviously missing or anything that doesn't work that should, then let us know.
letz
Comment 14
2018-02-02 06:23:20 PST
The patch does not apply properly on a fresh Webkit github clone. Is there a new one somewhere, or a public git branch with this patch? Thanks.
JF Bastien
Comment 15
2018-02-02 08:22:16 PST
(In reply to letz from
comment #14
)
> The patch does not apply properly on a fresh Webkit github clone. Is there a > new one somewhere, or a public git branch with this patch? > Thanks.
No, it needs to be rebased.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug