Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/Runtime/Library/WabtInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ char16* NarrowStringToWide(Context* ctx, const char* src, const size_t* srcSize
return dst;
}

static PropertyId propertyMap[ChakraWabt::PropertyIds::COUNT] = {
static PropertyId propertyMap[] = {
Js::PropertyIds::as,
Js::PropertyIds::action,
Js::PropertyIds::args,
Expand All @@ -53,6 +53,7 @@ static PropertyId propertyMap[ChakraWabt::PropertyIds::COUNT] = {

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

Js::Var CreateBuffer(const char* buf, uint size, void* user_data)
Js::Var CreateBuffer(const uint8* buf, uint size, void* user_data)
{
Context* ctx = (Context*)user_data;
ArrayBuffer* arrayBuffer = ctx->scriptContext->GetLibrary()->CreateArrayBuffer(size);
Expand Down
10 changes: 8 additions & 2 deletions lib/WasmReader/WasmBinaryReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,6 @@ void WasmBinaryReader::ReadSignatureTypeSection()
// signatures table
for (uint32 i = 0; i < numTypes; i++)
{
TRACE_WASM_DECODER(_u("Signature #%u"), i);

WasmSignature* sig = m_module->GetSignature(i);
sig->SetSignatureId(i);
int8 form = ReadConst<int8>();
Expand Down Expand Up @@ -684,6 +682,14 @@ void WasmBinaryReader::ReadSignatureTypeSection()
sig->SetResultType(type);
}
sig->FinalizeSignature();
#ifdef ENABLE_DEBUG_CONFIG_OPTIONS
if (DO_WASM_TRACE_DECODER)
{
Output::Print(_u("Signature #%u: "), i);
sig->Dump();
Output::Print(_u("\n"));
}
#endif
}
}

Expand Down
10 changes: 6 additions & 4 deletions lib/wabt/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.gclient_entries
/bin
/out
/third_party/gecko-dev*
/third_party/v8/depot_tools
/fuzz-out
/emscripten
*.pyc
/built

.gitmodules
/test
/tests
/third_party
63 changes: 36 additions & 27 deletions lib/wabt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
check_symbol_exists(sysconf "unistd.h" HAVE_SYSCONF)
check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP)

if (WIN32)
check_symbol_exists(ENABLE_VIRTUAL_TERMINAL_PROCESSING "windows.h" HAVE_WIN32_VT100)
endif ()

include(CheckTypeSize)
check_type_size(ssize_t SSIZE_T)
check_type_size(size_t SIZEOF_SIZE_T)
Expand Down Expand Up @@ -67,7 +71,7 @@ if (COMPILER_IS_CLANG)
add_definitions(-fcolor-diagnostics)
endif ()

set(AST_PARSER_GEN_C src/prebuilt/wast-parser-gen.cc)

include_directories(src/prebuilt)

if (COMPILER_IS_CLANG OR COMPILER_IS_GNU)
Expand All @@ -81,46 +85,51 @@ if (COMPILER_IS_CLANG OR COMPILER_IS_GNU)
endif ()

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

add_custom_target(everything)

add_library(libwabt OBJECT
${AST_LEXER_GEN_C}
${AST_PARSER_GEN_C}
src/apply-names.cc
src/binary-error-handler.cc
src/binary-reader-ir.cc
src/binary-reader-logging.cc
src/binary-reader-objdump.cc
src/binary-reader-opcnt.cc
src/opcode.cc
src/error-handler.cc
src/hash-util.cc
src/string-view.cc
src/ir.cc
src/expr-visitor.cc
src/lexer-source.cc
src/lexer-source-line-finder.cc
src/wast-parser-lexer-shared.cc
${WAST_LEXER_GEN_CC}
src/wast-parser.cc
src/type-checker.cc
src/validator.cc

src/binary-reader.cc
src/binary-writer-spec.cc
src/binary-reader-logging.cc
src/binary-writer.cc
src/binary.cc
src/binary-writer-spec.cc
src/binary-reader-ir.cc
src/binding-hash.cc
src/wat-writer.cc
src/interpreter.cc
src/binary-reader-interpreter.cc
src/apply-names.cc
src/generate-names.cc
src/resolve-names.cc

src/binary.cc
src/color.cc
src/common.cc
src/config.cc
src/emscripten-helpers.cc
src/expr-visitor.cc
src/generate-names.cc
src/hash-util.cc
src/ir.cc
src/lexer-source-line-finder.cc
src/lexer-source.cc
src/feature.cc
src/literal.cc
src/opcode.cc
src/option-parser.cc
src/resolve-names.cc
src/source-error-handler.cc
src/stream.cc
src/string-view.cc
src/type-checker.cc
src/tracing.cc
src/utf8.cc
src/validator.cc
src/wast-parser-lexer-shared.cc
src/wat-writer.cc
src/writer.cc

chakra/wabtapi.cc


)
Loading