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 11 matching lines...) Expand all Loading... |
22 class Graph; | 22 class Graph; |
23 class Operator; | 23 class Operator; |
24 class SourcePositionTable; | 24 class SourcePositionTable; |
25 } // namespace compiler | 25 } // namespace compiler |
26 | 26 |
27 namespace wasm { | 27 namespace wasm { |
28 // Forward declarations for some WASM data structures. | 28 // Forward declarations for some WASM data structures. |
29 struct ModuleEnv; | 29 struct ModuleEnv; |
30 struct WasmFunction; | 30 struct WasmFunction; |
31 class ErrorThrower; | 31 class ErrorThrower; |
32 struct Tree; | 32 struct DecodeStruct; |
33 | 33 |
34 // Expose {Node} and {Graph} opaquely as {wasm::TFNode} and {wasm::TFGraph}. | 34 // Expose {Node} and {Graph} opaquely as {wasm::TFNode} and {wasm::TFGraph}. |
35 typedef compiler::Node TFNode; | 35 typedef compiler::Node TFNode; |
36 typedef compiler::JSGraph TFGraph; | 36 typedef compiler::JSGraph TFGraph; |
37 } // namespace wasm | 37 } // namespace wasm |
38 | 38 |
39 namespace compiler { | 39 namespace compiler { |
40 class WasmCompilationUnit final { | 40 class WasmCompilationUnit final { |
41 public: | 41 public: |
42 WasmCompilationUnit(wasm::ErrorThrower* thrower, Isolate* isolate, | 42 WasmCompilationUnit(wasm::ErrorThrower* thrower, Isolate* isolate, |
(...skipping 22 matching lines...) Expand all Loading... |
65 Isolate* isolate_; | 65 Isolate* isolate_; |
66 wasm::ModuleEnv* module_env_; | 66 wasm::ModuleEnv* module_env_; |
67 const wasm::WasmFunction* function_; | 67 const wasm::WasmFunction* function_; |
68 // The graph zone is deallocated at the end of ExecuteCompilation. | 68 // The graph zone is deallocated at the end of ExecuteCompilation. |
69 base::SmartPointer<Zone> graph_zone_; | 69 base::SmartPointer<Zone> graph_zone_; |
70 JSGraph* jsgraph_; | 70 JSGraph* jsgraph_; |
71 Zone compilation_zone_; | 71 Zone compilation_zone_; |
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::DecodeStruct*> 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, uint32_t index, |
83 Handle<String> import_module, | 83 Handle<String> import_module, |
84 MaybeHandle<String> import_function); | 84 MaybeHandle<String> import_function); |
85 | 85 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 Node** buf = Buffer(new_count); | 345 Node** buf = Buffer(new_count); |
346 if (buf != buffer) memcpy(buf, buffer, old_count * sizeof(Node*)); | 346 if (buf != buffer) memcpy(buf, buffer, old_count * sizeof(Node*)); |
347 return buf; | 347 return buf; |
348 } | 348 } |
349 }; | 349 }; |
350 } // namespace compiler | 350 } // namespace compiler |
351 } // namespace internal | 351 } // namespace internal |
352 } // namespace v8 | 352 } // namespace v8 |
353 | 353 |
354 #endif // V8_COMPILER_WASM_COMPILER_H_ | 354 #endif // V8_COMPILER_WASM_COMPILER_H_ |
OLD | NEW |