Skip to content

Conversation

@Cellule
Copy link
Contributor

@Cellule Cellule commented Jul 6, 2016

Implement deferred parsing for Wasm functions under a flag -on:wasmdeferred
Added new class WasmModuleGenerator which reads only what is necessary to create the wasm module.
Then WasmBytecodeGenerator only generates the bytecode for the function bodies.
Simplified logic for LazyTraps
Added instrumentation for -profile with Wasm

Took the opportunity to do some cleanup in the Wasm classes notably some unused methods and some rearrangement.


This change is Reviewable

@Cellule
Copy link
Contributor Author

Cellule commented Jul 6, 2016

This change is mostly related to WebAssembly/design#719
Regardless of the outcome of that proposal, I think this refactoring will come in handy for the new js api

@Cellule
Copy link
Contributor Author

Cellule commented Jul 8, 2016

@MikeHolman @commonlisp Can you review this please?

@Cellule
Copy link
Contributor Author

Cellule commented Jul 18, 2016

ping

mov eax, ecx
#endif
pop ebp
// Although we don't restore ESP here on WinCE, this is fine because script profiler is not shipped for WinCE.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this comment mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got this from another thunk in this file, I don't really know what it means exactly either

@MikeHolman
Copy link
Contributor

right now this will have memory cost, so a bit hesitant about merging unless it will be used

Cellule and others added 3 commits July 19, 2016 17:04
Made some Wasm tracing available in test build
Update basic.wast to latest syntax (haven't update the baseline, because I am unsure what it is supposed to do)
Added new class WasmModuleGenerator which reads only what is necessary to create the wasm module.
Then WasmBytecodeGenerator only generates the bytecode for the function bodies.

Added thunks for x64/x86 for deferred parsing entry points.

Simplified logic for LazyTraps
Create a new ArenaAllocator on the WasmBinaryReader that has the same lifetime as the reader
m_scriptContext(scriptContext),
m_recycler(scriptContext->GetRecycler())
{
m_reader = RecyclerNew(m_recycler, Binary::WasmBinaryReader, scriptContext, binaryBuffer, binaryBufferLength);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be leaf.

@MikeHolman
Copy link
Contributor

:shipit:

body->GetAsmJsFunctionInfo()->SetIsHeapBufferConst(true);

WasmReaderInfo* readerInfo = RecyclerNew(m_recycler, WasmReaderInfo);
WasmReaderInfo* readerInfo = RecyclerNewLeaf(m_recycler, WasmReaderInfo);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this can't be leaf

Cellule added a commit to Cellule/ChakraCore that referenced this pull request Jul 20, 2016
Merge pull request chakra-core#1243 from Cellule:wasm/deferred

Implement deferred parsing for Wasm functions under a flag `-on:wasmdeferred`
Added new class WasmModuleGenerator which reads only what is necessary to create the wasm module.
Then WasmBytecodeGenerator only generates the bytecode for the function bodies.
Simplified logic for LazyTraps
Added instrumentation for `-profile` with Wasm

Took the opportunity to do some cleanup in the Wasm classes notably some unused methods and some rearrangement.
@Cellule Cellule merged commit 58f32dd into chakra-core:WebAssembly Jul 20, 2016
@Cellule Cellule deleted the wasm/deferred branch July 25, 2016 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants