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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 ModuleOrigin origin); | 505 ModuleOrigin origin); |
506 | 506 |
507 // Get the number of imported functions for a WASM instance. | 507 // Get the number of imported functions for a WASM instance. |
508 uint32_t GetNumImportedFunctions(Handle<JSObject> wasm_object); | 508 uint32_t GetNumImportedFunctions(Handle<JSObject> wasm_object); |
509 | 509 |
510 // Assumed to be called with a code object associated to a wasm module instance. | 510 // Assumed to be called with a code object associated to a wasm module instance. |
511 // Intended to be called from runtime functions. | 511 // Intended to be called from runtime functions. |
512 // Returns nullptr on failing to get owning instance. | 512 // Returns nullptr on failing to get owning instance. |
513 Object* GetOwningWasmInstance(Code* code); | 513 Object* GetOwningWasmInstance(Code* code); |
514 | 514 |
515 MaybeHandle<JSArrayBuffer> GetInstanceMemory(Isolate* isolate, | 515 int32_t GrowInstanceMemory(Isolate* isolate, Handle<JSObject> instance, |
516 Handle<JSObject> instance); | 516 uint32_t pages); |
517 void SetInstanceMemory(Handle<JSObject> instance, JSArrayBuffer* buffer); | |
518 | 517 |
519 namespace testing { | 518 namespace testing { |
520 | 519 |
521 void ValidateInstancesChain(Isolate* isolate, Handle<JSObject> module_obj, | 520 void ValidateInstancesChain(Isolate* isolate, Handle<JSObject> module_obj, |
522 int instance_count); | 521 int instance_count); |
523 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj); | 522 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj); |
524 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); | 523 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); |
525 | 524 |
526 } // namespace testing | 525 } // namespace testing |
527 } // namespace wasm | 526 } // namespace wasm |
528 } // namespace internal | 527 } // namespace internal |
529 } // namespace v8 | 528 } // namespace v8 |
530 | 529 |
531 #endif // V8_WASM_MODULE_H_ | 530 #endif // V8_WASM_MODULE_H_ |
OLD | NEW |