• Home
  • Raw
  • Download

Lines Matching full:wasm

13 #include "src/wasm/function-body-decoder.h"
14 #include "src/wasm/function-compiler.h"
15 #include "src/wasm/wasm-module.h"
16 #include "src/wasm/wasm-opcodes.h"
17 #include "src/wasm/wasm-result.h"
37 namespace wasm {
39 // Expose {Node} and {Graph} opaquely as {wasm::TFNode} and {wasm::TFGraph}.
44 } // namespace wasm
50 explicit TurbofanWasmCompilationUnit(wasm::WasmCompilationUnit* wasm_unit);
53 SourcePositionTable* BuildGraphForWasmFunction(wasm::WasmFeatures* detected,
58 void ExecuteCompilation(wasm::WasmFeatures* detected);
60 wasm::WasmCode* FinishCompilation(wasm::ErrorThrower*);
63 wasm::WasmCompilationUnit* const wasm_unit_;
65 wasm::WasmCode* wasm_code_ = nullptr;
66 wasm::Result<wasm::DecodeStruct*> graph_construction_result_;
71 // Wraps a JS function, producing a code object that can be called from wasm.
73 wasm::FunctionSig*, uint32_t index,
74 wasm::ModuleOrigin,
75 wasm::UseTrapHandler);
77 // Creates a code object calling a wasm function with the given signature,
79 // TODO(clemensh): Remove the {UseTrapHandler} parameter to make js-to-wasm
82 Isolate*, const wasm::NativeModule*, wasm::FunctionSig*, bool is_import,
83 wasm::UseTrapHandler);
85 // Compiles a stub that redirects a call to a wasm function to the wasm
86 // interpreter. It's ABI compatible with the compiled wasm function.
88 wasm::FunctionSig*);
103 // {CWasmEntryParameters}. It loads the wasm parameters from the argument
104 // buffer and calls the wasm function given as first parameter.
105 MaybeHandle<Code> CompileCWasmEntry(Isolate* isolate, wasm::FunctionSig* sig);
107 // Values from the instance object are cached between WASM-level function calls.
109 // and manipulated in wasm-compiler.{h,cc} instead of inside the WASM decoder.
117 // Abstracts details of building TurboFan graph nodes for wasm to separate
118 // the wasm decoder from the internal details of TurboFan.
127 WasmGraphBuilder(wasm::ModuleEnv* env, Zone* zone, MachineGraph* mcgraph,
128 wasm::FunctionSig* sig,
150 Node* Phi(wasm::ValueType type, unsigned count, Node** vals, Node* control);
162 Node* Binop(wasm::WasmOpcode opcode, Node* left, Node* right,
163 wasm::WasmCodePosition position = wasm::kNoCodePosition);
164 Node* Unop(wasm::WasmOpcode opcode, Node* input,
165 wasm::WasmCodePosition position = wasm::kNoCodePosition);
167 Node* Throw(uint32_t tag, const wasm::WasmException* exception,
172 Node** GetExceptionValues(const wasm::WasmException* except_decl);
178 void StackCheck(wasm::WasmCodePosition position, Node** effect = nullptr,
190 Node* TrapIfTrue(wasm::TrapReason reason, Node* cond,
191 wasm::WasmCodePosition position);
192 Node* TrapIfFalse(wasm::TrapReason reason, Node* cond,
193 wasm::WasmCodePosition position);
194 Node* TrapIfEq32(wasm::TrapReason reason, Node* node, int32_t val,
195 wasm::WasmCodePosition position);
196 Node* ZeroCheck32(wasm::TrapReason reason, Node* node,
197 wasm::WasmCodePosition position);
198 Node* TrapIfEq64(wasm::TrapReason reason, Node* node, int64_t val,
199 wasm::WasmCodePosition position);
200 Node* ZeroCheck64(wasm::TrapReason reason, Node* node,
201 wasm::WasmCodePosition position);
213 Node* Unreachable(wasm::WasmCodePosition position);
216 wasm::WasmCodePosition position);
218 wasm::WasmCodePosition position);
229 uint32_t offset, wasm::WasmCodePosition);
230 Node* LoadMem(wasm::ValueType type, MachineType memtype, Node* index,
232 wasm::WasmCodePosition position);
234 uint32_t alignment, Node* val, wasm::WasmCodePosition position,
235 wasm::ValueType type);
263 void GetGlobalBaseAndOffset(MachineType mem_type, const wasm::WasmGlobal&,
279 wasm::FunctionSig* GetFunctionSignature() { return sig_; } in GetFunctionSignature()
285 void SetSourcePosition(Node* node, wasm::WasmCodePosition position);
292 Node* SimdOp(wasm::WasmOpcode opcode, Node* const* inputs);
294 Node* SimdLaneOp(wasm::WasmOpcode opcode, uint8_t lane, Node* const* inputs);
296 Node* SimdShiftOp(wasm::WasmOpcode opcode, uint8_t shift,
301 Node* AtomicOp(wasm::WasmOpcode opcode, Node* const* inputs,
303 wasm::WasmCodePosition position);
307 const wasm::WasmModule* module() { return env_ ? env_->module : nullptr; } in module()
315 wasm::Decoder* decoder);
324 wasm::ModuleEnv* const env_;
343 wasm::FunctionSig* const sig_;
354 wasm::WasmCodePosition, EnforceBoundsCheck);
356 uint32_t offset, wasm::WasmCodePosition);
358 const Operator* GetSafeLoadOperator(int offset, wasm::ValueType type);
359 const Operator* GetSafeStoreOperator(int offset, wasm::ValueType type);
361 wasm::ValueType wasmtype = wasm::kWasmStmt);
363 wasm::ValueType wasmtype = wasm::kWasmStmt);
370 Node* BuildWasmCall(wasm::FunctionSig* sig, Node** args, Node*** rets,
371 wasm::WasmCodePosition position, Node* instance_node,
373 Node* BuildImportWasmCall(wasm::FunctionSig* sig, Node** args, Node*** rets,
374 wasm::WasmCodePosition position, int func_index);
375 Node* BuildImportWasmCall(wasm::FunctionSig* sig, Node** args, Node*** rets,
376 wasm::WasmCodePosition position, Node* func_index);
381 Node* BuildIntConvertFloat(Node* input, wasm::WasmCodePosition position,
382 wasm::WasmOpcode);
417 Node* BuildCcallConvertFloat(Node* input, wasm::WasmCodePosition position,
418 wasm::WasmOpcode opcode);
420 Node* BuildI32DivS(Node* left, Node* right, wasm::WasmCodePosition position);
421 Node* BuildI32RemS(Node* left, Node* right, wasm::WasmCodePosition position);
422 Node* BuildI32DivU(Node* left, Node* right, wasm::WasmCodePosition position);
423 Node* BuildI32RemU(Node* left, Node* right, wasm::WasmCodePosition position);
425 Node* BuildI64DivS(Node* left, Node* right, wasm::WasmCodePosition position);
426 Node* BuildI64RemS(Node* left, Node* right, wasm::WasmCodePosition position);
427 Node* BuildI64DivU(Node* left, Node* right, wasm::WasmCodePosition position);
428 Node* BuildI64RemU(Node* left, Node* right, wasm::WasmCodePosition position);
430 MachineType result_type, wasm::TrapReason trap_zero,
431 wasm::WasmCodePosition position);
453 uint32_t GetExceptionEncodedSize(const wasm::WasmException* exception) const;
478 TrapId GetTrapIdForTrap(wasm::TrapReason reason);
482 Zone* zone, wasm::FunctionSig* signature,