Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: src/compiler/wasm-compiler.h

Issue 2208703002: [wasm] Allow import function to be any kind of callables. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comments. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/wasm-compiler.cc » ('j') | src/compiler/wasm-compiler.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_WASM_COMPILER_H_ 5 #ifndef V8_COMPILER_WASM_COMPILER_H_
6 #define V8_COMPILER_WASM_COMPILER_H_ 6 #define V8_COMPILER_WASM_COMPILER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 // Clients of this interface shouldn't depend on lots of compiler internals. 10 // Clients of this interface shouldn't depend on lots of compiler internals.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 CompilationInfo info_; 75 CompilationInfo info_;
76 std::unique_ptr<CompilationJob> job_; 76 std::unique_ptr<CompilationJob> job_;
77 uint32_t index_; 77 uint32_t index_;
78 wasm::Result<wasm::DecodeStruct*> graph_construction_result_; 78 wasm::Result<wasm::DecodeStruct*> graph_construction_result_;
79 bool ok_; 79 bool ok_;
80 80
81 DISALLOW_COPY_AND_ASSIGN(WasmCompilationUnit); 81 DISALLOW_COPY_AND_ASSIGN(WasmCompilationUnit);
82 }; 82 };
83 83
84 // Wraps a JS function, producing a code object that can be called from WASM. 84 // Wraps a JS function, producing a code object that can be called from WASM.
85 Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, 85 Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, Handle<JSReceiver> target,
86 Handle<JSFunction> function,
87 wasm::FunctionSig* sig, uint32_t index, 86 wasm::FunctionSig* sig, uint32_t index,
88 Handle<String> import_module, 87 Handle<String> import_module,
89 MaybeHandle<String> import_function); 88 MaybeHandle<String> import_function);
90 89
91 // Wraps a given wasm code object, producing a code object. 90 // Wraps a given wasm code object, producing a code object.
92 Handle<Code> CompileJSToWasmWrapper(Isolate* isolate, wasm::ModuleEnv* module, 91 Handle<Code> CompileJSToWasmWrapper(Isolate* isolate, wasm::ModuleEnv* module,
93 Handle<Code> wasm_code, uint32_t index); 92 Handle<Code> wasm_code, uint32_t index);
94 93
95 // Abstracts details of building TurboFan graph nodes for WASM to separate 94 // Abstracts details of building TurboFan graph nodes for WASM to separate
96 // the WASM decoder from the internal details of TurboFan. 95 // the WASM decoder from the internal details of TurboFan.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 Node* ReturnVoid(); 151 Node* ReturnVoid();
153 Node* Unreachable(wasm::WasmCodePosition position); 152 Node* Unreachable(wasm::WasmCodePosition position);
154 153
155 Node* CallDirect(uint32_t index, Node** args, 154 Node* CallDirect(uint32_t index, Node** args,
156 wasm::WasmCodePosition position); 155 wasm::WasmCodePosition position);
157 Node* CallImport(uint32_t index, Node** args, 156 Node* CallImport(uint32_t index, Node** args,
158 wasm::WasmCodePosition position); 157 wasm::WasmCodePosition position);
159 Node* CallIndirect(uint32_t index, Node** args, 158 Node* CallIndirect(uint32_t index, Node** args,
160 wasm::WasmCodePosition position); 159 wasm::WasmCodePosition position);
161 void BuildJSToWasmWrapper(Handle<Code> wasm_code, wasm::FunctionSig* sig); 160 void BuildJSToWasmWrapper(Handle<Code> wasm_code, wasm::FunctionSig* sig);
162 void BuildWasmToJSWrapper(Handle<JSFunction> function, 161 void BuildWasmToJSWrapper(Handle<JSReceiver> target, wasm::FunctionSig* sig);
163 wasm::FunctionSig* sig);
164 162
165 Node* ToJS(Node* node, Node* context, wasm::LocalType type); 163 Node* ToJS(Node* node, wasm::LocalType type);
166 Node* FromJS(Node* node, Node* context, wasm::LocalType type); 164 Node* FromJS(Node* node, Node* context, wasm::LocalType type);
167 Node* Invert(Node* node); 165 Node* Invert(Node* node);
168 Node* FunctionTable(uint32_t index); 166 Node* FunctionTable(uint32_t index);
169 Node* ChangeToRuntimeCall(Node* node, Runtime::FunctionId function_id, 167 Node* ChangeToRuntimeCall(Node* node, Runtime::FunctionId function_id,
170 Signature<Conversion>* signature); 168 Signature<Conversion>* signature);
171 169
172 //----------------------------------------------------------------------- 170 //-----------------------------------------------------------------------
173 // Operations that concern the linear memory. 171 // Operations that concern the linear memory.
174 //----------------------------------------------------------------------- 172 //-----------------------------------------------------------------------
175 Node* MemSize(uint32_t offset); 173 Node* MemSize(uint32_t offset);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 345 }
348 346
349 // Simd helper functions 347 // Simd helper functions
350 MachineOperatorBuilder* simd(); 348 MachineOperatorBuilder* simd();
351 }; 349 };
352 } // namespace compiler 350 } // namespace compiler
353 } // namespace internal 351 } // namespace internal
354 } // namespace v8 352 } // namespace v8
355 353
356 #endif // V8_COMPILER_WASM_COMPILER_H_ 354 #endif // V8_COMPILER_WASM_COMPILER_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/wasm-compiler.cc » ('j') | src/compiler/wasm-compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698