Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: src/wasm/wasm-module.h

Issue 2512323004: Revert of [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/wasm/wasm-js.cc ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 // Translate from byte offset in the module to function number and byte offset 415 // Translate from byte offset in the module to function number and byte offset
416 // within that function, encoded as line and column in the position info. 416 // within that function, encoded as line and column in the position info.
417 bool GetPositionInfo(Handle<WasmCompiledModule> compiled_module, 417 bool GetPositionInfo(Handle<WasmCompiledModule> compiled_module,
418 uint32_t position, Script::PositionInfo* info); 418 uint32_t position, Script::PositionInfo* info);
419 419
420 // Assumed to be called with a code object associated to a wasm module instance. 420 // Assumed to be called with a code object associated to a wasm module instance.
421 // Intended to be called from runtime functions. 421 // Intended to be called from runtime functions.
422 // Returns nullptr on failing to get owning instance. 422 // Returns nullptr on failing to get owning instance.
423 WasmInstanceObject* GetOwningWasmInstance(Code* code); 423 WasmInstanceObject* GetOwningWasmInstance(Code* code);
424 424
425 MaybeHandle<JSArrayBuffer> GetInstanceMemory(Isolate* isolate, 425 MaybeHandle<JSArrayBuffer> GetInstanceMemory(
426 Handle<JSObject> instance); 426 Isolate* isolate, Handle<WasmInstanceObject> instance);
427 427
428 int32_t GetInstanceMemorySize(Isolate* isolate, 428 int32_t GetInstanceMemorySize(Isolate* isolate,
429 Handle<WasmInstanceObject> instance); 429 Handle<WasmInstanceObject> instance);
430 430
431 int32_t GrowInstanceMemory(Isolate* isolate, 431 int32_t GrowInstanceMemory(Isolate* isolate,
432 Handle<WasmInstanceObject> instance, uint32_t pages); 432 Handle<WasmInstanceObject> instance, uint32_t pages);
433 433
434 Handle<JSArrayBuffer> NewArrayBuffer(Isolate* isolate, size_t size, 434 Handle<JSArrayBuffer> NewArrayBuffer(Isolate* isolate, size_t size,
435 bool enable_guard_regions); 435 bool enable_guard_regions);
436 436
437 int32_t GetInstanceMemorySize(Isolate* isolate, Handle<JSObject> instance);
438
439 int32_t GrowWebAssemblyMemory(Isolate* isolate, Handle<Object> receiver,
440 uint32_t pages);
441
442 int32_t GrowMemory(Isolate* isolate, Handle<WasmInstanceObject> instance,
443 uint32_t pages);
444
445 void UpdateDispatchTables(Isolate* isolate, Handle<FixedArray> dispatch_tables, 437 void UpdateDispatchTables(Isolate* isolate, Handle<FixedArray> dispatch_tables,
446 int index, Handle<JSFunction> js_function); 438 int index, Handle<JSFunction> js_function);
447 439
448 namespace testing { 440 namespace testing {
449 441
450 void ValidateInstancesChain(Isolate* isolate, 442 void ValidateInstancesChain(Isolate* isolate,
451 Handle<WasmModuleObject> module_obj, 443 Handle<WasmModuleObject> module_obj,
452 int instance_count); 444 int instance_count);
453 void ValidateModuleState(Isolate* isolate, Handle<WasmModuleObject> module_obj); 445 void ValidateModuleState(Isolate* isolate, Handle<WasmModuleObject> module_obj);
454 void ValidateOrphanedInstance(Isolate* isolate, 446 void ValidateOrphanedInstance(Isolate* isolate,
455 Handle<WasmInstanceObject> instance); 447 Handle<WasmInstanceObject> instance);
456 448
457 } // namespace testing 449 } // namespace testing
458 } // namespace wasm 450 } // namespace wasm
459 } // namespace internal 451 } // namespace internal
460 } // namespace v8 452 } // namespace v8
461 453
462 #endif // V8_WASM_MODULE_H_ 454 #endif // V8_WASM_MODULE_H_
OLDNEW
« no previous file with comments | « src/wasm/wasm-js.cc ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698