| 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/wasm/wasm-opcodes.h" | 10 #include "src/wasm/wasm-opcodes.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 wasm::ModuleEnv* module_env, | 37 wasm::ModuleEnv* module_env, |
| 38 const wasm::WasmFunction& function, int index); | 38 const wasm::WasmFunction& function, int index); |
| 39 | 39 |
| 40 // Wraps a JS function, producing a code object that can be called from WASM. | 40 // Wraps a JS function, producing a code object that can be called from WASM. |
| 41 Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, wasm::ModuleEnv* module, | 41 Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, wasm::ModuleEnv* module, |
| 42 Handle<JSFunction> function, | 42 Handle<JSFunction> function, |
| 43 uint32_t index); | 43 uint32_t index); |
| 44 | 44 |
| 45 // Wraps a given wasm code object, producing a JSFunction that can be called | 45 // Wraps a given wasm code object, producing a JSFunction that can be called |
| 46 // from JavaScript. | 46 // from JavaScript. |
| 47 Handle<JSFunction> CompileJSToWasmWrapper(Isolate* isolate, | 47 Handle<JSFunction> CompileJSToWasmWrapper( |
| 48 wasm::ModuleEnv* module, | 48 Isolate* isolate, wasm::ModuleEnv* module, Handle<String> name, |
| 49 Handle<String> name, | 49 Handle<Code> wasm_code, Handle<JSObject> module_object, uint32_t index); |
| 50 Handle<Code> wasm_code, | |
| 51 uint32_t index); | |
| 52 | 50 |
| 53 // Abstracts details of building TurboFan graph nodes for WASM to separate | 51 // Abstracts details of building TurboFan graph nodes for WASM to separate |
| 54 // the WASM decoder from the internal details of TurboFan. | 52 // the WASM decoder from the internal details of TurboFan. |
| 55 class WasmTrapHelper; | 53 class WasmTrapHelper; |
| 56 class WasmGraphBuilder { | 54 class WasmGraphBuilder { |
| 57 public: | 55 public: |
| 58 WasmGraphBuilder(Zone* z, JSGraph* g, wasm::FunctionSig* function_signature); | 56 WasmGraphBuilder(Zone* z, JSGraph* g, wasm::FunctionSig* function_signature); |
| 59 | 57 |
| 60 Node** Buffer(size_t count) { | 58 Node** Buffer(size_t count) { |
| 61 if (count > cur_bufsize_) { | 59 if (count > cur_bufsize_) { |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 Node** buf = Buffer(count); | 177 Node** buf = Buffer(count); |
| 180 if (buf != buffer) memcpy(buf, buffer, count * sizeof(Node*)); | 178 if (buf != buffer) memcpy(buf, buffer, count * sizeof(Node*)); |
| 181 return buf; | 179 return buf; |
| 182 } | 180 } |
| 183 }; | 181 }; |
| 184 } // namespace compiler | 182 } // namespace compiler |
| 185 } // namespace internal | 183 } // namespace internal |
| 186 } // namespace v8 | 184 } // namespace v8 |
| 187 | 185 |
| 188 #endif // V8_COMPILER_WASM_COMPILER_H_ | 186 #endif // V8_COMPILER_WASM_COMPILER_H_ |
| OLD | NEW |