Skip to content

Commit 94db98c

Browse files
committed
[MERGE #3547 @Cellule] WASM: Update wabt and spec tests
2 parents 789ab36 + 380d1cd commit 94db98c

File tree

148 files changed

+51059
-58649
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+51059
-58649
lines changed

lib/Runtime/Library/WabtInterface.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ char16* NarrowStringToWide(Context* ctx, const char* src, const size_t* srcSize
3535
return dst;
3636
}
3737

38-
static PropertyId propertyMap[ChakraWabt::PropertyIds::COUNT] = {
38+
static PropertyId propertyMap[] = {
3939
Js::PropertyIds::as,
4040
Js::PropertyIds::action,
4141
Js::PropertyIds::args,
@@ -53,6 +53,7 @@ static PropertyId propertyMap[ChakraWabt::PropertyIds::COUNT] = {
5353

5454
bool SetProperty(Js::Var obj, PropertyId id, Js::Var value, void* user_data)
5555
{
56+
CompileAssert((sizeof(propertyMap)/sizeof(PropertyId)) == ChakraWabt::PropertyIds::COUNT);
5657
Context* ctx = (Context*)user_data;
5758
Assert(id < ChakraWabt::PropertyIds::COUNT);
5859
return !!JavascriptOperators::OP_SetProperty(obj, propertyMap[id], value, ctx->scriptContext);
@@ -92,7 +93,7 @@ Js::Var StringToVar(const char* src, uint length, void* user_data)
9293
return JavascriptString::NewCopyBuffer(buf, (charcount_t)bufSize, ctx->scriptContext);
9394
}
9495

95-
Js::Var CreateBuffer(const char* buf, uint size, void* user_data)
96+
Js::Var CreateBuffer(const uint8* buf, uint size, void* user_data)
9697
{
9798
Context* ctx = (Context*)user_data;
9899
ArrayBuffer* arrayBuffer = ctx->scriptContext->GetLibrary()->CreateArrayBuffer(size);

lib/WasmReader/WasmBinaryReader.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,6 @@ void WasmBinaryReader::ReadSignatureTypeSection()
649649
// signatures table
650650
for (uint32 i = 0; i < numTypes; i++)
651651
{
652-
TRACE_WASM_DECODER(_u("Signature #%u"), i);
653-
654652
WasmSignature* sig = m_module->GetSignature(i);
655653
sig->SetSignatureId(i);
656654
int8 form = ReadConst<int8>();
@@ -684,6 +682,14 @@ void WasmBinaryReader::ReadSignatureTypeSection()
684682
sig->SetResultType(type);
685683
}
686684
sig->FinalizeSignature();
685+
#ifdef ENABLE_DEBUG_CONFIG_OPTIONS
686+
if (DO_WASM_TRACE_DECODER)
687+
{
688+
Output::Print(_u("Signature #%u: "), i);
689+
sig->Dump();
690+
Output::Print(_u("\n"));
691+
}
692+
#endif
687693
}
688694
}
689695

lib/wabt/.gitignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
.gclient_entries
1+
/bin
22
/out
3-
/third_party/gecko-dev*
4-
/third_party/v8/depot_tools
53
/fuzz-out
64
/emscripten
75
*.pyc
8-
/built
6+
7+
.gitmodules
8+
/test
9+
/tests
10+
/third_party

lib/wabt/CMakeLists.txt

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
3030
check_symbol_exists(sysconf "unistd.h" HAVE_SYSCONF)
3131
check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP)
3232

33+
if (WIN32)
34+
check_symbol_exists(ENABLE_VIRTUAL_TERMINAL_PROCESSING "windows.h" HAVE_WIN32_VT100)
35+
endif ()
36+
3337
include(CheckTypeSize)
3438
check_type_size(ssize_t SSIZE_T)
3539
check_type_size(size_t SIZEOF_SIZE_T)
@@ -67,7 +71,7 @@ if (COMPILER_IS_CLANG)
6771
add_definitions(-fcolor-diagnostics)
6872
endif ()
6973

70-
set(AST_PARSER_GEN_C src/prebuilt/wast-parser-gen.cc)
74+
7175
include_directories(src/prebuilt)
7276

7377
if (COMPILER_IS_CLANG OR COMPILER_IS_GNU)
@@ -81,46 +85,51 @@ if (COMPILER_IS_CLANG OR COMPILER_IS_GNU)
8185
endif ()
8286

8387
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${WABT_SOURCE_DIR}/cmake)
84-
set(AST_LEXER_GEN_C src/prebuilt/wast-lexer-gen.cc)
88+
set(WAST_LEXER_GEN_CC src/prebuilt/wast-lexer-gen.cc)
8589

8690
add_custom_target(everything)
8791

8892
add_library(libwabt OBJECT
89-
${AST_LEXER_GEN_C}
90-
${AST_PARSER_GEN_C}
91-
src/apply-names.cc
92-
src/binary-error-handler.cc
93-
src/binary-reader-ir.cc
94-
src/binary-reader-logging.cc
95-
src/binary-reader-objdump.cc
96-
src/binary-reader-opcnt.cc
93+
src/opcode.cc
94+
src/error-handler.cc
95+
src/hash-util.cc
96+
src/string-view.cc
97+
src/ir.cc
98+
src/expr-visitor.cc
99+
src/lexer-source.cc
100+
src/lexer-source-line-finder.cc
101+
src/wast-parser-lexer-shared.cc
102+
${WAST_LEXER_GEN_CC}
103+
src/wast-parser.cc
104+
src/type-checker.cc
105+
src/validator.cc
106+
97107
src/binary-reader.cc
98-
src/binary-writer-spec.cc
108+
src/binary-reader-logging.cc
99109
src/binary-writer.cc
100-
src/binary.cc
110+
src/binary-writer-spec.cc
111+
src/binary-reader-ir.cc
101112
src/binding-hash.cc
113+
src/wat-writer.cc
114+
src/interpreter.cc
115+
src/binary-reader-interpreter.cc
116+
src/apply-names.cc
117+
src/generate-names.cc
118+
src/resolve-names.cc
119+
120+
src/binary.cc
121+
src/color.cc
102122
src/common.cc
103123
src/config.cc
104-
src/emscripten-helpers.cc
105-
src/expr-visitor.cc
106-
src/generate-names.cc
107-
src/hash-util.cc
108-
src/ir.cc
109-
src/lexer-source-line-finder.cc
110-
src/lexer-source.cc
124+
src/feature.cc
111125
src/literal.cc
112-
src/opcode.cc
113126
src/option-parser.cc
114-
src/resolve-names.cc
115-
src/source-error-handler.cc
116127
src/stream.cc
117-
src/string-view.cc
118-
src/type-checker.cc
128+
src/tracing.cc
119129
src/utf8.cc
120-
src/validator.cc
121-
src/wast-parser-lexer-shared.cc
122-
src/wat-writer.cc
123130
src/writer.cc
124131

125132
chakra/wabtapi.cc
133+
134+
126135
)

0 commit comments

Comments
 (0)