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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 ErrorThrower* thrower, | 408 ErrorThrower* thrower, |
409 ModuleOrigin origin); | 409 ModuleOrigin origin); |
410 | 410 |
411 // Assumed to be called with a code object associated to a wasm module instance. | 411 // Assumed to be called with a code object associated to a wasm module instance. |
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 | 417 |
| 418 MaybeHandle<JSArrayBuffer> GetInstanceMemory(Isolate* isolate, |
| 419 Handle<JSObject> instance); |
| 420 void SetInstanceMemory(Handle<JSObject> instance, JSArrayBuffer* buffer); |
| 421 |
418 namespace testing { | 422 namespace testing { |
419 | 423 |
420 // Decode, verify, and run the function labeled "main" in the | 424 // Decode, verify, and run the function labeled "main" in the |
421 // given encoded module. The module should have no imports. | 425 // given encoded module. The module should have no imports. |
422 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, | 426 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, |
423 const byte* module_end, bool asm_js = false); | 427 const byte* module_end, bool asm_js = false); |
424 | 428 |
425 int32_t CallFunction(Isolate* isolate, Handle<JSObject> instance, | 429 int32_t CallFunction(Isolate* isolate, Handle<JSObject> instance, |
426 ErrorThrower* thrower, const char* name, int argc, | 430 ErrorThrower* thrower, const char* name, int argc, |
427 Handle<Object> argv[], bool asm_js = false); | 431 Handle<Object> argv[], bool asm_js = false); |
| 432 |
| 433 void ValidateInstancesChain(Isolate* isolate, Handle<JSObject> module_obj, |
| 434 int instance_count); |
| 435 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj); |
| 436 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); |
| 437 |
428 } // namespace testing | 438 } // namespace testing |
429 } // namespace wasm | 439 } // namespace wasm |
430 } // namespace internal | 440 } // namespace internal |
431 } // namespace v8 | 441 } // namespace v8 |
432 | 442 |
433 #endif // V8_WASM_MODULE_H_ | 443 #endif // V8_WASM_MODULE_H_ |
OLD | NEW |