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

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

Issue 2964943002: [wasm] Introduce instance types for WebAssembly.* objects. (Closed)
Patch Set: Address rossberg comments. Created 3 years, 5 months 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 const WasmFunction* function_; 377 const WasmFunction* function_;
378 WasmName name_; 378 WasmName name_;
379 }; 379 };
380 380
381 std::ostream& operator<<(std::ostream& os, const WasmFunctionName& name); 381 std::ostream& operator<<(std::ostream& os, const WasmFunctionName& name);
382 382
383 // Get the debug info associated with the given wasm object. 383 // Get the debug info associated with the given wasm object.
384 // If no debug info exists yet, it is created automatically. 384 // If no debug info exists yet, it is created automatically.
385 Handle<WasmDebugInfo> GetDebugInfo(Handle<JSObject> wasm); 385 Handle<WasmDebugInfo> GetDebugInfo(Handle<JSObject> wasm);
386 386
387 // Check whether the given object represents a WebAssembly.Instance instance.
388 // This checks the number and type of embedder fields, so it's not 100 percent
389 // secure. If it turns out that we need more complete checks, we could add a
390 // special marker as embedder field, which will definitely never occur anywhere
391 // else.
392 bool IsWasmInstance(Object* instance);
393
394 // Get the script of the wasm module. If the origin of the module is asm.js, the 387 // Get the script of the wasm module. If the origin of the module is asm.js, the
395 // returned Script will be a JavaScript Script of Script::TYPE_NORMAL, otherwise 388 // returned Script will be a JavaScript Script of Script::TYPE_NORMAL, otherwise
396 // it's of type TYPE_WASM. 389 // it's of type TYPE_WASM.
397 Handle<Script> GetScript(Handle<JSObject> instance); 390 Handle<Script> GetScript(Handle<JSObject> instance);
398 391
399 V8_EXPORT_PRIVATE MaybeHandle<WasmModuleObject> CreateModuleObjectFromBytes( 392 V8_EXPORT_PRIVATE MaybeHandle<WasmModuleObject> CreateModuleObjectFromBytes(
400 Isolate* isolate, const byte* start, const byte* end, ErrorThrower* thrower, 393 Isolate* isolate, const byte* start, const byte* end, ErrorThrower* thrower,
401 ModuleOrigin origin, Handle<Script> asm_js_script, 394 ModuleOrigin origin, Handle<Script> asm_js_script,
402 Vector<const byte> asm_offset_table); 395 Vector<const byte> asm_offset_table);
403 396
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 int instance_count); 518 int instance_count);
526 void ValidateModuleState(Isolate* isolate, Handle<WasmModuleObject> module_obj); 519 void ValidateModuleState(Isolate* isolate, Handle<WasmModuleObject> module_obj);
527 void ValidateOrphanedInstance(Isolate* isolate, 520 void ValidateOrphanedInstance(Isolate* isolate,
528 Handle<WasmInstanceObject> instance); 521 Handle<WasmInstanceObject> instance);
529 } // namespace testing 522 } // namespace testing
530 } // namespace wasm 523 } // namespace wasm
531 } // namespace internal 524 } // namespace internal
532 } // namespace v8 525 } // namespace v8
533 526
534 #endif // V8_WASM_MODULE_H_ 527 #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