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