line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Wasm::Wasmtime::Table; |
2
|
|
|
|
|
|
|
|
3
|
16
|
|
|
16
|
|
185496
|
use strict; |
|
16
|
|
|
|
|
42
|
|
|
16
|
|
|
|
|
500
|
|
4
|
16
|
|
|
16
|
|
79
|
use warnings; |
|
16
|
|
|
|
|
35
|
|
|
16
|
|
|
|
|
389
|
|
5
|
16
|
|
|
16
|
|
262
|
use 5.008004; |
|
16
|
|
|
|
|
56
|
|
6
|
16
|
|
|
16
|
|
99
|
use base qw( Wasm::Wasmtime::Extern ); |
|
16
|
|
|
|
|
29
|
|
|
16
|
|
|
|
|
2073
|
|
7
|
16
|
|
|
16
|
|
115
|
use Ref::Util qw( is_ref ); |
|
16
|
|
|
|
|
42
|
|
|
16
|
|
|
|
|
815
|
|
8
|
16
|
|
|
16
|
|
104
|
use Wasm::Wasmtime::FFI; |
|
16
|
|
|
|
|
33
|
|
|
16
|
|
|
|
|
1624
|
|
9
|
16
|
|
|
16
|
|
115
|
use Wasm::Wasmtime::Store; |
|
16
|
|
|
|
|
31
|
|
|
16
|
|
|
|
|
482
|
|
10
|
16
|
|
|
16
|
|
101
|
use Wasm::Wasmtime::TableType; |
|
16
|
|
|
|
|
56
|
|
|
16
|
|
|
|
|
571
|
|
11
|
16
|
|
|
16
|
|
120
|
use constant is_table => 1; |
|
16
|
|
|
|
|
39
|
|
|
16
|
|
|
|
|
1320
|
|
12
|
16
|
|
|
16
|
|
105
|
use constant kind => 'table'; |
|
16
|
|
|
|
|
43
|
|
|
16
|
|
|
|
|
4042
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# ABSTRACT: Wasmtime table class |
15
|
|
|
|
|
|
|
our $VERSION = '0.21'; # VERSION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
$ffi_prefix = 'wasm_table_'; |
19
|
|
|
|
|
|
|
$ffi->load_custom_type('::PtrObject' => 'wasm_table_t' => __PACKAGE__); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new |
22
|
|
|
|
|
|
|
{ |
23
|
|
|
|
|
|
|
# TODO: add wasm_table_new for standalone support |
24
|
|
|
|
|
|
|
# TODO: add wasm_table_set |
25
|
|
|
|
|
|
|
# TODO: add wasm_table_get |
26
|
|
|
|
|
|
|
# TODO: add wasm_table_grow |
27
|
0
|
|
|
0
|
0
|
|
my($class, $ptr, $owner) = @_; |
28
|
0
|
|
|
|
|
|
bless { |
29
|
|
|
|
|
|
|
ptr => $ptr, |
30
|
|
|
|
|
|
|
owner => $owner, |
31
|
|
|
|
|
|
|
}, $class; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
$ffi->attach( type => ['wasm_table_t'] => 'wasm_tabletype_t' => sub { |
36
|
|
|
|
|
|
|
my($xsub, $self) = @_; |
37
|
|
|
|
|
|
|
my $type = $xsub->($self); |
38
|
|
|
|
|
|
|
$type->{owner} = $self->{owner} || $self; |
39
|
|
|
|
|
|
|
$type; |
40
|
|
|
|
|
|
|
}); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$ffi->attach( size => ['wasm_table_t'] => 'uint32' ); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__PACKAGE__->_cast(2); |
46
|
|
|
|
|
|
|
_generate_destroy(); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |