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, uint32_t index, | 82 wasm::FunctionSig* sig, |
83 Handle<String> import_module, | 83 wasm::WasmName module_name, |
84 MaybeHandle<String> import_function); | 84 wasm::WasmName function_name); |
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(Isolate* isolate, | 88 Handle<JSFunction> CompileJSToWasmWrapper( |
89 wasm::ModuleEnv* module, | 89 Isolate* isolate, wasm::ModuleEnv* module, Handle<String> name, |
90 Handle<String> name, | 90 Handle<Code> wasm_code, Handle<JSObject> module_object, uint32_t index); |
91 Handle<Code> wasm_code, | |
92 uint32_t index); | |
93 | 91 |
94 // Abstracts details of building TurboFan graph nodes for WASM to separate | 92 // Abstracts details of building TurboFan graph nodes for WASM to separate |
95 // the WASM decoder from the internal details of TurboFan. | 93 // the WASM decoder from the internal details of TurboFan. |
96 class WasmTrapHelper; | 94 class WasmTrapHelper; |
97 class WasmGraphBuilder { | 95 class WasmGraphBuilder { |
98 public: | 96 public: |
99 WasmGraphBuilder( | 97 WasmGraphBuilder( |
100 Zone* z, JSGraph* g, wasm::FunctionSig* function_signature, | 98 Zone* z, JSGraph* g, wasm::FunctionSig* function_signature, |
101 compiler::SourcePositionTable* source_position_table = nullptr); | 99 compiler::SourcePositionTable* source_position_table = nullptr); |
102 | 100 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 Node** buf = Buffer(new_count); | 343 Node** buf = Buffer(new_count); |
346 if (buf != buffer) memcpy(buf, buffer, old_count * sizeof(Node*)); | 344 if (buf != buffer) memcpy(buf, buffer, old_count * sizeof(Node*)); |
347 return buf; | 345 return buf; |
348 } | 346 } |
349 }; | 347 }; |
350 } // namespace compiler | 348 } // namespace compiler |
351 } // namespace internal | 349 } // namespace internal |
352 } // namespace v8 | 350 } // namespace v8 |
353 | 351 |
354 #endif // V8_COMPILER_WASM_COMPILER_H_ | 352 #endif // V8_COMPILER_WASM_COMPILER_H_ |
OLD | NEW |