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 #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. |
11 // Do not include anything from src/compiler here! | 11 // Do not include anything from src/compiler here! |
12 #include "src/compilation-info.h" | 12 #include "src/compilation-info.h" |
13 #include "src/compiler.h" | 13 #include "src/compiler.h" |
| 14 #include "src/wasm/wasm-module.h" |
14 #include "src/wasm/wasm-opcodes.h" | 15 #include "src/wasm/wasm-opcodes.h" |
15 #include "src/wasm/wasm-result.h" | 16 #include "src/wasm/wasm-result.h" |
16 #include "src/zone/zone.h" | 17 #include "src/zone/zone.h" |
17 | 18 |
18 namespace v8 { | 19 namespace v8 { |
19 namespace internal { | 20 namespace internal { |
20 | 21 |
21 namespace compiler { | 22 namespace compiler { |
22 // Forward declarations for some compiler data structures. | 23 // Forward declarations for some compiler data structures. |
23 class Node; | 24 class Node; |
(...skipping 25 matching lines...) Expand all Loading... |
49 Zone* graph_zone() { return graph_zone_.get(); } | 50 Zone* graph_zone() { return graph_zone_.get(); } |
50 int index() const { return index_; } | 51 int index() const { return index_; } |
51 | 52 |
52 void ExecuteCompilation(); | 53 void ExecuteCompilation(); |
53 Handle<Code> FinishCompilation(); | 54 Handle<Code> FinishCompilation(); |
54 | 55 |
55 static Handle<Code> CompileWasmFunction(wasm::ErrorThrower* thrower, | 56 static Handle<Code> CompileWasmFunction(wasm::ErrorThrower* thrower, |
56 Isolate* isolate, | 57 Isolate* isolate, |
57 wasm::ModuleEnv* module_env, | 58 wasm::ModuleEnv* module_env, |
58 const wasm::WasmFunction* function) { | 59 const wasm::WasmFunction* function) { |
59 WasmCompilationUnit unit(thrower, isolate, module_env, function, 0); | 60 WasmCompilationUnit unit(thrower, isolate, module_env, function, |
| 61 function->func_index); |
60 unit.ExecuteCompilation(); | 62 unit.ExecuteCompilation(); |
61 return unit.FinishCompilation(); | 63 return unit.FinishCompilation(); |
62 } | 64 } |
63 | 65 |
64 private: | 66 private: |
65 SourcePositionTable* BuildGraphForWasmFunction(double* decode_ms); | 67 SourcePositionTable* BuildGraphForWasmFunction(double* decode_ms); |
66 | 68 |
67 wasm::ErrorThrower* thrower_; | 69 wasm::ErrorThrower* thrower_; |
68 Isolate* isolate_; | 70 Isolate* isolate_; |
69 wasm::ModuleEnv* module_env_; | 71 wasm::ModuleEnv* module_env_; |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 } | 353 } |
352 | 354 |
353 int AddParameterNodes(Node** args, int pos, int param_count, | 355 int AddParameterNodes(Node** args, int pos, int param_count, |
354 wasm::FunctionSig* sig); | 356 wasm::FunctionSig* sig); |
355 }; | 357 }; |
356 } // namespace compiler | 358 } // namespace compiler |
357 } // namespace internal | 359 } // namespace internal |
358 } // namespace v8 | 360 } // namespace v8 |
359 | 361 |
360 #endif // V8_COMPILER_WASM_COMPILER_H_ | 362 #endif // V8_COMPILER_WASM_COMPILER_H_ |
OLD | NEW |