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

Unified Diff: src/wasm/wasm-objects.h

Issue 2551053002: [wasm] Always provide a wasm instance object at runtime (Closed)
Patch Set: Rebase Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | src/wasm/wasm-objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-objects.h
diff --git a/src/wasm/wasm-objects.h b/src/wasm/wasm-objects.h
index 28d5eb79fece093411f679271b88e7ce4300aedb..c0c5bed0fc7e7efb73c9af54a0b2ad3a6074b927 100644
--- a/src/wasm/wasm-objects.h
+++ b/src/wasm/wasm-objects.h
@@ -254,6 +254,9 @@ class WasmCompiledModule : public FixedArray {
static bool IsWasmCompiledModule(Object* obj);
+ // Check whether this module wasm generated from asm.js source.
+ bool is_asm_js() const { return has_asm_js_offset_table(); }
+
void PrintInstancesChain();
static void RecreateModuleWrapper(Isolate* isolate,
@@ -262,8 +265,16 @@ class WasmCompiledModule : public FixedArray {
// Get the function name of the function identified by the given index.
// Returns a null handle if the function is unnamed or the name is not a valid
// UTF-8 string.
- static MaybeHandle<String> GetFunctionName(
- Handle<WasmCompiledModule> compiled_module, uint32_t func_index);
+ static MaybeHandle<String> GetFunctionNameOrNull(
+ Isolate* isolate, Handle<WasmCompiledModule> compiled_module,
+ uint32_t func_index);
+
+ // Get the function name of the function identified by the given index.
+ // Returns "<WASM UNNAMED>" if the function is unnamed or the name is not a
+ // valid UTF-8 string.
+ static Handle<String> GetFunctionName(
+ Isolate* isolate, Handle<WasmCompiledModule> compiled_module,
+ uint32_t func_index);
// Get the raw bytes of the function name of the function identified by the
// given index.
@@ -299,6 +310,13 @@ class WasmCompiledModule : public FixedArray {
// Returns an empty string and empty vector if the function index is invalid.
debug::WasmDisassembly DisassembleFunction(int func_index);
+ // Extract a portion of the wire bytes as UTF-8 string.
+ // Returns a null handle if the respective bytes do not form a valid UTF-8
+ // string.
+ static MaybeHandle<String> ExtractUtf8StringFromModuleBytes(
+ Isolate* isolate, Handle<WasmCompiledModule> compiled_module,
+ uint32_t offset, uint32_t size);
+
private:
void InitId();
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | src/wasm/wasm-objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698