blob: ffee7824137d847b7d2d0f8bade4a372057b98b7 [file] [log] [blame]
Ben Murdochc5610432016-08-08 18:44:38 +01001// Copyright 2016 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_WASM_FUNCTION_NAME_TABLE_H_
6#define V8_WASM_FUNCTION_NAME_TABLE_H_
7
8#include "src/handles.h"
9#include "src/objects.h"
10
11namespace v8 {
12namespace internal {
13namespace wasm {
14
15// Forward declarations for some WASM data structures.
16struct WasmModule;
17
18// Encode all function names of the WasmModule into one ByteArray.
Ben Murdoch61f157c2016-09-16 13:49:30 +010019Handle<ByteArray> BuildFunctionNamesTable(Isolate* isolate,
20 const WasmModule* module);
Ben Murdochc5610432016-08-08 18:44:38 +010021
Ben Murdoch61f157c2016-09-16 13:49:30 +010022// Extract the function name for the given func_index from the function name
23// table.
24// Returns a null handle if the respective function is unnamed (not to be
25// confused with empty names) or the function name is not a valid UTF-8 string.
26MaybeHandle<String> GetWasmFunctionNameFromTable(
27 Handle<ByteArray> wasm_names_table, uint32_t func_index);
Ben Murdochc5610432016-08-08 18:44:38 +010028
29} // namespace wasm
30} // namespace internal
31} // namespace v8
32
33#endif // V8_WASM_FUNCTION_NAME_TABLE_H_