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_WASM_MODULE_H_ | 5 #ifndef V8_WASM_MODULE_H_ |
6 #define V8_WASM_MODULE_H_ | 6 #define V8_WASM_MODULE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/api.h" | 10 #include "src/api.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 } | 227 } |
228 | 228 |
229 // Checks the given offset range is contained within the module bytes. | 229 // Checks the given offset range is contained within the module bytes. |
230 bool BoundsCheck(uint32_t start, uint32_t end) const { | 230 bool BoundsCheck(uint32_t start, uint32_t end) const { |
231 size_t size = module_end - module_start; | 231 size_t size = module_end - module_start; |
232 return start <= size && end <= size; | 232 return start <= size && end <= size; |
233 } | 233 } |
234 | 234 |
235 // Creates a new instantiation of the module in the given isolate. | 235 // Creates a new instantiation of the module in the given isolate. |
236 static MaybeHandle<JSObject> Instantiate(Isolate* isolate, | 236 static MaybeHandle<JSObject> Instantiate(Isolate* isolate, |
237 Handle<FixedArray> compiled_module, | 237 Handle<JSObject> module_object, |
238 Handle<JSReceiver> ffi, | 238 Handle<JSReceiver> ffi, |
239 Handle<JSArrayBuffer> memory); | 239 Handle<JSArrayBuffer> memory); |
240 | 240 |
241 MaybeHandle<FixedArray> CompileFunctions(Isolate* isolate, | 241 MaybeHandle<FixedArray> CompileFunctions(Isolate* isolate, |
242 ErrorThrower* thrower) const; | 242 ErrorThrower* thrower) const; |
243 | 243 |
244 private: | 244 private: |
245 DISALLOW_COPY_AND_ASSIGN(WasmModule); | 245 DISALLOW_COPY_AND_ASSIGN(WasmModule); |
246 }; | 246 }; |
247 | 247 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 // Intended to be called from runtime functions. | 412 // Intended to be called from runtime functions. |
413 // Returns undefined if the runtime support was not setup, nullptr if the | 413 // Returns undefined if the runtime support was not setup, nullptr if the |
414 // instance | 414 // instance |
415 // was collected, or the instance object owning the Code object | 415 // was collected, or the instance object owning the Code object |
416 Object* GetOwningWasmInstance(Object* undefined, Code* code); | 416 Object* GetOwningWasmInstance(Object* undefined, Code* code); |
417 } // namespace wasm | 417 } // namespace wasm |
418 } // namespace internal | 418 } // namespace internal |
419 } // namespace v8 | 419 } // namespace v8 |
420 | 420 |
421 #endif // V8_WASM_MODULE_H_ | 421 #endif // V8_WASM_MODULE_H_ |
OLD | NEW |