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. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 wasm::WasmCodePosition position); | 163 wasm::WasmCodePosition position); |
164 Node* CallIndirect(uint32_t index, Node** args, Node*** rets, | 164 Node* CallIndirect(uint32_t index, Node** args, Node*** rets, |
165 wasm::WasmCodePosition position); | 165 wasm::WasmCodePosition position); |
166 | 166 |
167 void BuildJSToWasmWrapper(Handle<Code> wasm_code, wasm::FunctionSig* sig); | 167 void BuildJSToWasmWrapper(Handle<Code> wasm_code, wasm::FunctionSig* sig); |
168 void BuildWasmToJSWrapper(Handle<JSReceiver> target, wasm::FunctionSig* sig); | 168 void BuildWasmToJSWrapper(Handle<JSReceiver> target, wasm::FunctionSig* sig); |
169 | 169 |
170 Node* ToJS(Node* node, wasm::LocalType type); | 170 Node* ToJS(Node* node, wasm::LocalType type); |
171 Node* FromJS(Node* node, Node* context, wasm::LocalType type); | 171 Node* FromJS(Node* node, Node* context, wasm::LocalType type); |
172 Node* Invert(Node* node); | 172 Node* Invert(Node* node); |
173 Node* FunctionTable(uint32_t index); | 173 void EnsureFunctionTableNodes(); |
174 | 174 |
175 //----------------------------------------------------------------------- | 175 //----------------------------------------------------------------------- |
176 // Operations that concern the linear memory. | 176 // Operations that concern the linear memory. |
177 //----------------------------------------------------------------------- | 177 //----------------------------------------------------------------------- |
178 Node* CurrentMemoryPages(); | 178 Node* CurrentMemoryPages(); |
179 Node* GetGlobal(uint32_t index); | 179 Node* GetGlobal(uint32_t index); |
180 Node* SetGlobal(uint32_t index, Node* val); | 180 Node* SetGlobal(uint32_t index, Node* val); |
181 Node* LoadMem(wasm::LocalType type, MachineType memtype, Node* index, | 181 Node* LoadMem(wasm::LocalType type, MachineType memtype, Node* index, |
182 uint32_t offset, uint32_t alignment, | 182 uint32_t offset, uint32_t alignment, |
183 wasm::WasmCodePosition position); | 183 wasm::WasmCodePosition position); |
(...skipping 28 matching lines...) Expand all Loading... |
212 private: | 212 private: |
213 static const int kDefaultBufferSize = 16; | 213 static const int kDefaultBufferSize = 16; |
214 friend class WasmTrapHelper; | 214 friend class WasmTrapHelper; |
215 | 215 |
216 Zone* zone_; | 216 Zone* zone_; |
217 JSGraph* jsgraph_; | 217 JSGraph* jsgraph_; |
218 wasm::ModuleEnv* module_; | 218 wasm::ModuleEnv* module_; |
219 Node* mem_buffer_; | 219 Node* mem_buffer_; |
220 Node* mem_size_; | 220 Node* mem_size_; |
221 NodeVector function_tables_; | 221 NodeVector function_tables_; |
| 222 NodeVector function_table_sizes_; |
222 Node** control_; | 223 Node** control_; |
223 Node** effect_; | 224 Node** effect_; |
224 Node** cur_buffer_; | 225 Node** cur_buffer_; |
225 size_t cur_bufsize_; | 226 size_t cur_bufsize_; |
226 Node* def_buffer_[kDefaultBufferSize]; | 227 Node* def_buffer_[kDefaultBufferSize]; |
227 | 228 |
228 WasmTrapHelper* trap_; | 229 WasmTrapHelper* trap_; |
229 wasm::FunctionSig* function_signature_; | 230 wasm::FunctionSig* function_signature_; |
230 SetOncePointer<const Operator> allocate_heap_number_operator_; | 231 SetOncePointer<const Operator> allocate_heap_number_operator_; |
231 | 232 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 } | 351 } |
351 | 352 |
352 int AddParameterNodes(Node** args, int pos, int param_count, | 353 int AddParameterNodes(Node** args, int pos, int param_count, |
353 wasm::FunctionSig* sig); | 354 wasm::FunctionSig* sig); |
354 }; | 355 }; |
355 } // namespace compiler | 356 } // namespace compiler |
356 } // namespace internal | 357 } // namespace internal |
357 } // namespace v8 | 358 } // namespace v8 |
358 | 359 |
359 #endif // V8_COMPILER_WASM_COMPILER_H_ | 360 #endif // V8_COMPILER_WASM_COMPILER_H_ |
OLD | NEW |