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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 ModuleOrigin origin); | 545 ModuleOrigin origin); |
546 | 546 |
547 // Get the number of imported functions for a WASM instance. | 547 // Get the number of imported functions for a WASM instance. |
548 int GetNumImportedFunctions(Handle<JSObject> wasm_object); | 548 int GetNumImportedFunctions(Handle<JSObject> wasm_object); |
549 | 549 |
550 // Assumed to be called with a code object associated to a wasm module instance. | 550 // Assumed to be called with a code object associated to a wasm module instance. |
551 // Intended to be called from runtime functions. | 551 // Intended to be called from runtime functions. |
552 // Returns nullptr on failing to get owning instance. | 552 // Returns nullptr on failing to get owning instance. |
553 Object* GetOwningWasmInstance(Code* code); | 553 Object* GetOwningWasmInstance(Code* code); |
554 | 554 |
| 555 MaybeHandle<JSArrayBuffer> GetInstanceMemory(Isolate* isolate, |
| 556 Handle<JSObject> instance); |
| 557 |
555 int32_t GetInstanceMemorySize(Isolate* isolate, Handle<JSObject> instance); | 558 int32_t GetInstanceMemorySize(Isolate* isolate, Handle<JSObject> instance); |
556 | 559 |
557 int32_t GrowInstanceMemory(Isolate* isolate, Handle<JSObject> instance, | 560 int32_t GrowInstanceMemory(Isolate* isolate, Handle<JSObject> instance, |
558 uint32_t pages); | 561 uint32_t pages); |
559 | 562 |
560 namespace testing { | 563 namespace testing { |
561 | 564 |
562 void ValidateInstancesChain(Isolate* isolate, Handle<JSObject> module_obj, | 565 void ValidateInstancesChain(Isolate* isolate, Handle<JSObject> module_obj, |
563 int instance_count); | 566 int instance_count); |
564 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj); | 567 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj); |
565 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); | 568 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); |
566 | 569 |
567 } // namespace testing | 570 } // namespace testing |
568 } // namespace wasm | 571 } // namespace wasm |
569 } // namespace internal | 572 } // namespace internal |
570 } // namespace v8 | 573 } // namespace v8 |
571 | 574 |
572 #endif // V8_WASM_MODULE_H_ | 575 #endif // V8_WASM_MODULE_H_ |
OLD | NEW |