OLD | NEW |
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 "src/api.h" | 8 #include "src/api.h" |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 #include "src/wasm/wasm-opcodes.h" | 10 #include "src/wasm/wasm-opcodes.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 Handle<Object> GetWasmFunctionNameOrNull(Isolate* isolate, Handle<Object> wasm, | 333 Handle<Object> GetWasmFunctionNameOrNull(Isolate* isolate, Handle<Object> wasm, |
334 uint32_t func_index); | 334 uint32_t func_index); |
335 | 335 |
336 // Return the binary source bytes of a wasm module. | 336 // Return the binary source bytes of a wasm module. |
337 SeqOneByteString* GetWasmBytes(JSObject* wasm); | 337 SeqOneByteString* GetWasmBytes(JSObject* wasm); |
338 | 338 |
339 // Get the debug info associated with the given wasm object. | 339 // Get the debug info associated with the given wasm object. |
340 // If no debug info exists yet, it is created automatically. | 340 // If no debug info exists yet, it is created automatically. |
341 WasmDebugInfo* GetDebugInfo(JSObject* wasm); | 341 WasmDebugInfo* GetDebugInfo(JSObject* wasm); |
342 | 342 |
| 343 // Return the number of functions in the given wasm object. |
| 344 int GetNumberOfFunctions(JSObject* wasm); |
| 345 |
343 // Check whether the given object is a wasm object. | 346 // Check whether the given object is a wasm object. |
344 // This checks the number and type of internal fields, so it's not 100 percent | 347 // This checks the number and type of internal fields, so it's not 100 percent |
345 // secure. If it turns out that we need more complete checks, we could add a | 348 // secure. If it turns out that we need more complete checks, we could add a |
346 // special marker as internal field, which will definitely never occur anywhere | 349 // special marker as internal field, which will definitely never occur anywhere |
347 // else. | 350 // else. |
348 bool IsWasmObject(Object* object); | 351 bool IsWasmObject(Object* object); |
349 | 352 |
350 } // namespace wasm | 353 } // namespace wasm |
351 } // namespace internal | 354 } // namespace internal |
352 } // namespace v8 | 355 } // namespace v8 |
353 | 356 |
354 #endif // V8_WASM_MODULE_H_ | 357 #endif // V8_WASM_MODULE_H_ |
OLD | NEW |