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/wasm/wasm-opcodes.h" | 8 #include "src/wasm/wasm-opcodes.h" |
9 #include "src/wasm/wasm-result.h" | 9 #include "src/wasm/wasm-result.h" |
10 | 10 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 // For testing. Decode, verify, and run the last exported function in the | 313 // For testing. Decode, verify, and run the last exported function in the |
314 // given decoded module. | 314 // given decoded module. |
315 int32_t CompileAndRunWasmModule(Isolate* isolate, const WasmModule* module); | 315 int32_t CompileAndRunWasmModule(Isolate* isolate, const WasmModule* module); |
316 | 316 |
317 // Extract a function name from the given wasm object. | 317 // Extract a function name from the given wasm object. |
318 // Returns a null handle if the function is unnamed or the name is not a valid | 318 // Returns a null handle if the function is unnamed or the name is not a valid |
319 // UTF-8 string. | 319 // UTF-8 string. |
320 MaybeHandle<String> GetWasmFunctionName(Handle<JSObject> wasm, | 320 MaybeHandle<String> GetWasmFunctionName(Handle<JSObject> wasm, |
321 uint32_t func_index); | 321 uint32_t func_index); |
322 | 322 |
| 323 // Check whether the given object is a wasm object. |
| 324 // This checks the number and type of internal fields, so it's not 100 percent |
| 325 // secure. If it turns out that we need more complete checks, we could add a |
| 326 // special marker as internal field, which will definitely never occur anywhere |
| 327 // else. |
| 328 bool IsWasmObject(Handle<JSObject> object); |
| 329 |
323 } // namespace wasm | 330 } // namespace wasm |
324 } // namespace internal | 331 } // namespace internal |
325 } // namespace v8 | 332 } // namespace v8 |
326 | 333 |
327 #endif // V8_WASM_MODULE_H_ | 334 #endif // V8_WASM_MODULE_H_ |
OLD | NEW |