Index: src/wasm/wasm-objects.cc |
diff --git a/src/wasm/wasm-objects.cc b/src/wasm/wasm-objects.cc |
index 19d48aa04b3b2eec7cfc9df9e10c30f4f0b08ffe..9a6f1b01da7ea68191dd16c0eba08e3145032080 100644 |
--- a/src/wasm/wasm-objects.cc |
+++ b/src/wasm/wasm-objects.cc |
@@ -312,7 +312,7 @@ Handle<WasmCompiledModule> WasmCompiledModule::New( |
} |
wasm::WasmModule* WasmCompiledModule::module() const { |
- return reinterpret_cast<WasmModuleWrapper*>(*module_wrapper())->get(); |
+ return reinterpret_cast<WasmModuleWrapper*>(ptr_to_module_wrapper())->get(); |
} |
void WasmCompiledModule::InitId() { |
@@ -365,3 +365,15 @@ uint32_t WasmCompiledModule::mem_size() const { |
uint32_t WasmCompiledModule::default_mem_size() const { |
return min_mem_pages() * WasmModule::kPageSize; |
} |
+ |
+Vector<const uint8_t> WasmCompiledModule::GetRawFunctionName( |
+ uint32_t func_index) { |
+ DCHECK_GT(module()->functions.size(), func_index); |
+ WasmFunction& function = module()->functions[func_index]; |
+ SeqOneByteString* bytes = ptr_to_module_bytes(); |
+ DCHECK_GE(static_cast<size_t>(bytes->length()), function.name_offset); |
+ DCHECK_GE(static_cast<size_t>(bytes->length() - function.name_offset), |
+ function.name_length); |
+ return Vector<const uint8_t>(bytes->GetCharsAddress() + function.name_offset, |
+ function.name_length); |
+} |