-
Notifications
You must be signed in to change notification settings - Fork 1.2k
WASM Xplat: Linux #1727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WASM Xplat: Linux #1727
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| add_library (Chakra.WasmReader OBJECT | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: unneeded extra blank line
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will remove. |
||
| WasmReaderPch.cpp | ||
| WasmDataSegment.cpp | ||
| WasmFunctionInfo.cpp | ||
| WasmModule.cpp | ||
| WasmSection.cpp | ||
| WasmSignature.cpp | ||
| WasmBinaryReader.cpp | ||
| WasmByteCodeGenerator.cpp | ||
| ) | ||
|
|
||
| target_include_directories ( | ||
| Chakra.WasmReader PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} | ||
| ../JITIDL | ||
| ../Backend | ||
| ../Runtime | ||
| ../Runtime/ByteCode | ||
| ../Parser | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,6 @@ | |
|
|
||
| #include "WasmReaderPch.h" | ||
|
|
||
|
|
||
| #ifdef ENABLE_WASM | ||
|
|
||
| namespace Wasm | ||
|
|
@@ -174,11 +173,7 @@ WasmBinaryReader::ReadSectionHeader() | |
|
|
||
| #if ENABLE_DEBUG_CONFIG_OPTIONS | ||
| Assert(idSize < 64); | ||
| char16 buf[64]; | ||
| size_t convertedChars = 0; | ||
| mbstowcs_s(&convertedChars, buf, idSize + 1, sectionName, _TRUNCATE); | ||
| buf[idSize] = 0; | ||
| TRACE_WASM_SECTION(_u("Section Header: %s, length = %u (0x%x)"), buf, sectionSize, sectionSize); | ||
| TRACE_WASM_SECTION(_u("Section Header: %s, length = %u (0x%x)"), sectionName, sectionSize, sectionSize); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Had changed sectionName to wchar_t to avoid the use of mbstowcs_s in linux to get around a method not defined error. Will change this back to char16* and look for another workaround to make it compile in xplat. |
||
| #endif | ||
| return header; | ||
| } | ||
|
|
@@ -217,7 +212,7 @@ WasmBinaryReader::PrintOps() | |
| case opcode: \ | ||
| Output::Print(_u("%s\r\n"), _u(#opname)); \ | ||
| break; | ||
| #include "WasmBinaryOpcodes.h" | ||
| #include "WasmBinaryOpCodes.h" | ||
| } | ||
| } | ||
| HeapDeleteArray(m_ops->Count(), ops); | ||
|
|
@@ -372,7 +367,7 @@ WasmBinaryReader::ReadExpr() | |
| case wb##opname: \ | ||
| m_currentNode.op = MemNode(op); \ | ||
| break; | ||
| #include "WasmBinaryOpcodes.h" | ||
| #include "WasmBinaryOpCodes.h" | ||
| default: | ||
| m_currentNode.op = op; | ||
| } | ||
|
|
@@ -677,7 +672,7 @@ WasmBinaryReader::ReadDataSegments() | |
|
|
||
| for (uint32 i = 0; i < entries; ++i) | ||
| { | ||
| TRACE_WASM_DECODER(L"Data Segment #%u", i); | ||
| TRACE_WASM_DECODER(_u("Data Segment #%u"), i); | ||
| UINT32 offset = LEB128(len); | ||
| UINT32 dataByteLen = LEB128(len); | ||
| WasmDataSegment *dseg = Anew(m_alloc, WasmDataSegment, m_alloc, offset, dataByteLen, m_pc); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this to have
()in a field name (weird, why do we want that)? From the change I assume directly##0doesn't work, right? #ResolvedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
() is part of the macro name and it is not going to be part of the actual field name. The tricky part was to have the number to be appended to the end of the filed name to avoid naming conflicts.
##0 does not work as ## expects strings as operands.