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

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

Issue 2263953002: [wasm] Use the right context in the wasm-to-js wrapper. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup the test. 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
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 CompilationInfo info_; 74 CompilationInfo info_;
75 std::unique_ptr<CompilationJob> job_; 75 std::unique_ptr<CompilationJob> job_;
76 uint32_t index_; 76 uint32_t index_;
77 wasm::Result<wasm::DecodeStruct*> graph_construction_result_; 77 wasm::Result<wasm::DecodeStruct*> graph_construction_result_;
78 bool ok_; 78 bool ok_;
79 79
80 DISALLOW_COPY_AND_ASSIGN(WasmCompilationUnit); 80 DISALLOW_COPY_AND_ASSIGN(WasmCompilationUnit);
81 }; 81 };
82 82
83 // Wraps a JS function, producing a code object that can be called from WASM. 83 // Wraps a JS function, producing a code object that can be called from WASM.
84 Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, Handle<JSReceiver> target, 84 Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, Handle<Context> context,
85 Handle<JSReceiver> target,
85 wasm::FunctionSig* sig, uint32_t index, 86 wasm::FunctionSig* sig, uint32_t index,
86 Handle<String> import_module, 87 Handle<String> import_module,
87 MaybeHandle<String> import_function); 88 MaybeHandle<String> import_function);
88 89
89 // Wraps a given wasm code object, producing a code object. 90 // Wraps a given wasm code object, producing a code object.
90 Handle<Code> CompileJSToWasmWrapper(Isolate* isolate, wasm::ModuleEnv* module, 91 Handle<Code> CompileJSToWasmWrapper(Isolate* isolate, wasm::ModuleEnv* module,
91 Handle<Code> wasm_code, uint32_t index); 92 Handle<Code> wasm_code, uint32_t index);
92 93
93 // Abstracts details of building TurboFan graph nodes for WASM to separate 94 // Abstracts details of building TurboFan graph nodes for WASM to separate
94 // 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
150 Node* ReturnVoid(); 151 Node* ReturnVoid();
151 Node* Unreachable(wasm::WasmCodePosition position); 152 Node* Unreachable(wasm::WasmCodePosition position);
152 153
153 Node* CallDirect(uint32_t index, Node** args, 154 Node* CallDirect(uint32_t index, Node** args,
154 wasm::WasmCodePosition position); 155 wasm::WasmCodePosition position);
155 Node* CallImport(uint32_t index, Node** args, 156 Node* CallImport(uint32_t index, Node** args,
156 wasm::WasmCodePosition position); 157 wasm::WasmCodePosition position);
157 Node* CallIndirect(uint32_t index, Node** args, 158 Node* CallIndirect(uint32_t index, Node** args,
158 wasm::WasmCodePosition position); 159 wasm::WasmCodePosition position);
159 void BuildJSToWasmWrapper(Handle<Code> wasm_code, wasm::FunctionSig* sig); 160 void BuildJSToWasmWrapper(Handle<Code> wasm_code, wasm::FunctionSig* sig);
160 void BuildWasmToJSWrapper(Handle<JSReceiver> target, wasm::FunctionSig* sig); 161 void BuildWasmToJSWrapper(Handle<Context> context, Handle<JSReceiver> target,
162 wasm::FunctionSig* sig);
161 163
162 Node* ToJS(Node* node, wasm::LocalType type); 164 Node* ToJS(Node* node, wasm::LocalType type);
163 Node* FromJS(Node* node, Node* context, wasm::LocalType type); 165 Node* FromJS(Node* node, Node* context, wasm::LocalType type);
164 Node* Invert(Node* node); 166 Node* Invert(Node* node);
165 Node* FunctionTable(uint32_t index); 167 Node* FunctionTable(uint32_t index);
166 168
167 //----------------------------------------------------------------------- 169 //-----------------------------------------------------------------------
168 // Operations that concern the linear memory. 170 // Operations that concern the linear memory.
169 //----------------------------------------------------------------------- 171 //-----------------------------------------------------------------------
170 Node* MemSize(uint32_t offset); 172 Node* MemSize(uint32_t offset);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 Node** buf = Buffer(new_count); 337 Node** buf = Buffer(new_count);
336 if (buf != buffer) memcpy(buf, buffer, old_count * sizeof(Node*)); 338 if (buf != buffer) memcpy(buf, buffer, old_count * sizeof(Node*));
337 return buf; 339 return buf;
338 } 340 }
339 }; 341 };
340 } // namespace compiler 342 } // namespace compiler
341 } // namespace internal 343 } // namespace internal
342 } // namespace v8 344 } // namespace v8
343 345
344 #endif // V8_COMPILER_WASM_COMPILER_H_ 346 #endif // V8_COMPILER_WASM_COMPILER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698