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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 ModuleOrigin origin); | 527 ModuleOrigin origin); |
528 | 528 |
529 // Get the number of imported functions for a WASM instance. | 529 // Get the number of imported functions for a WASM instance. |
530 uint32_t GetNumImportedFunctions(Handle<JSObject> wasm_object); | 530 uint32_t GetNumImportedFunctions(Handle<JSObject> wasm_object); |
531 | 531 |
532 // Assumed to be called with a code object associated to a wasm module instance. | 532 // Assumed to be called with a code object associated to a wasm module instance. |
533 // Intended to be called from runtime functions. | 533 // Intended to be called from runtime functions. |
534 // Returns nullptr on failing to get owning instance. | 534 // Returns nullptr on failing to get owning instance. |
535 Object* GetOwningWasmInstance(Code* code); | 535 Object* GetOwningWasmInstance(Code* code); |
536 | 536 |
| 537 int32_t GetInstanceMemorySize(Isolate* isolate, Handle<JSObject> instance); |
| 538 |
537 int32_t GrowInstanceMemory(Isolate* isolate, Handle<JSObject> instance, | 539 int32_t GrowInstanceMemory(Isolate* isolate, Handle<JSObject> instance, |
538 uint32_t pages); | 540 uint32_t pages); |
539 | 541 |
540 namespace testing { | 542 namespace testing { |
541 | 543 |
542 void ValidateInstancesChain(Isolate* isolate, Handle<JSObject> module_obj, | 544 void ValidateInstancesChain(Isolate* isolate, Handle<JSObject> module_obj, |
543 int instance_count); | 545 int instance_count); |
544 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj); | 546 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj); |
545 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); | 547 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); |
546 | 548 |
547 } // namespace testing | 549 } // namespace testing |
548 } // namespace wasm | 550 } // namespace wasm |
549 } // namespace internal | 551 } // namespace internal |
550 } // namespace v8 | 552 } // namespace v8 |
551 | 553 |
552 #endif // V8_WASM_MODULE_H_ | 554 #endif // V8_WASM_MODULE_H_ |
OLD | NEW |