OLD | NEW |
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 // Clients of this interface shouldn't depend on lots of compiler internals. | 8 // Clients of this interface shouldn't depend on lots of compiler internals. |
9 // Do not include anything from src/compiler here! | 9 // Do not include anything from src/compiler here! |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 CompilationInfo info_; | 72 CompilationInfo info_; |
73 base::SmartPointer<CompilationJob> job_; | 73 base::SmartPointer<CompilationJob> job_; |
74 uint32_t index_; | 74 uint32_t index_; |
75 wasm::Result<wasm::Tree*> graph_construction_result_; | 75 wasm::Result<wasm::Tree*> graph_construction_result_; |
76 bool ok_; | 76 bool ok_; |
77 }; | 77 }; |
78 | 78 |
79 // Wraps a JS function, producing a code object that can be called from WASM. | 79 // Wraps a JS function, producing a code object that can be called from WASM. |
80 Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, | 80 Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, |
81 Handle<JSFunction> function, | 81 Handle<JSFunction> function, |
82 wasm::FunctionSig* sig, | 82 wasm::FunctionSig* sig, uint32_t index, |
83 wasm::WasmName module_name, | 83 Handle<String> import_module, |
84 wasm::WasmName function_name); | 84 MaybeHandle<String> import_function); |
85 | 85 |
86 // Wraps a given wasm code object, producing a JSFunction that can be called | 86 // Wraps a given wasm code object, producing a JSFunction that can be called |
87 // from JavaScript. | 87 // from JavaScript. |
88 Handle<JSFunction> CompileJSToWasmWrapper( | 88 Handle<JSFunction> CompileJSToWasmWrapper(Isolate* isolate, |
89 Isolate* isolate, wasm::ModuleEnv* module, Handle<String> name, | 89 wasm::ModuleEnv* module, |
90 Handle<Code> wasm_code, Handle<JSObject> module_object, uint32_t index); | 90 Handle<String> name, |
| 91 Handle<Code> wasm_code, |
| 92 uint32_t index); |
91 | 93 |
92 // Abstracts details of building TurboFan graph nodes for WASM to separate | 94 // Abstracts details of building TurboFan graph nodes for WASM to separate |
93 // the WASM decoder from the internal details of TurboFan. | 95 // the WASM decoder from the internal details of TurboFan. |
94 class WasmTrapHelper; | 96 class WasmTrapHelper; |
95 class WasmGraphBuilder { | 97 class WasmGraphBuilder { |
96 public: | 98 public: |
97 WasmGraphBuilder( | 99 WasmGraphBuilder( |
98 Zone* z, JSGraph* g, wasm::FunctionSig* function_signature, | 100 Zone* z, JSGraph* g, wasm::FunctionSig* function_signature, |
99 compiler::SourcePositionTable* source_position_table = nullptr); | 101 compiler::SourcePositionTable* source_position_table = nullptr); |
100 | 102 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 Node** buf = Buffer(new_count); | 343 Node** buf = Buffer(new_count); |
342 if (buf != buffer) memcpy(buf, buffer, old_count * sizeof(Node*)); | 344 if (buf != buffer) memcpy(buf, buffer, old_count * sizeof(Node*)); |
343 return buf; | 345 return buf; |
344 } | 346 } |
345 }; | 347 }; |
346 } // namespace compiler | 348 } // namespace compiler |
347 } // namespace internal | 349 } // namespace internal |
348 } // namespace v8 | 350 } // namespace v8 |
349 | 351 |
350 #endif // V8_COMPILER_WASM_COMPILER_H_ | 352 #endif // V8_COMPILER_WASM_COMPILER_H_ |
OLD | NEW |