line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Minions::Implementation; |
2
|
|
|
|
|
|
|
|
3
|
31
|
|
|
31
|
|
26031
|
use strict; |
|
31
|
|
|
|
|
55
|
|
|
31
|
|
|
|
|
811
|
|
4
|
31
|
|
|
31
|
|
1628
|
use Minions::_Guts; |
|
31
|
|
|
|
|
52
|
|
|
31
|
|
|
|
|
647
|
|
5
|
31
|
|
|
31
|
|
2499
|
use Package::Stash; |
|
31
|
|
|
|
|
28342
|
|
|
31
|
|
|
|
|
705
|
|
6
|
31
|
|
|
31
|
|
23758
|
use Readonly; |
|
31
|
|
|
|
|
95621
|
|
|
31
|
|
|
|
|
13243
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub import { |
9
|
38
|
|
|
38
|
|
1140
|
my ($class, %arg) = @_; |
10
|
|
|
|
|
|
|
|
11
|
38
|
|
|
|
|
241
|
strict->import(); |
12
|
|
|
|
|
|
|
|
13
|
38
|
|
|
|
|
174
|
$arg{-caller} = (caller)[0]; |
14
|
38
|
|
|
|
|
584
|
$class->define(%arg); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub define { |
18
|
38
|
|
|
38
|
0
|
121
|
my ($class, %arg) = @_; |
19
|
|
|
|
|
|
|
|
20
|
38
|
|
33
|
|
|
209
|
my $caller_pkg = delete $arg{-caller} || (caller)[0]; |
21
|
38
|
|
|
|
|
625
|
my $stash = Package::Stash->new($caller_pkg); |
22
|
|
|
|
|
|
|
|
23
|
38
|
|
|
|
|
151
|
$class->update_args(\%arg); |
24
|
38
|
|
|
|
|
140
|
$class->add_attribute_syms(\%arg, $stash); |
25
|
|
|
|
|
|
|
|
26
|
38
|
|
|
|
|
13537
|
$stash->add_symbol('%__meta__', \%arg); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub add_attribute_syms { |
30
|
38
|
|
|
38
|
0
|
83
|
my ($class, $arg, $stash) = @_; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
my @slots = ( |
33
|
38
|
|
|
|
|
142
|
keys %{ $arg->{has} }, |
34
|
38
|
100
|
|
|
|
59
|
@{ $arg->{requires}{attributes} || [] }, |
|
38
|
|
|
|
|
382
|
|
35
|
|
|
|
|
|
|
'', # semiprivate pkg |
36
|
|
|
|
|
|
|
); |
37
|
38
|
|
|
|
|
119
|
foreach my $slot ( @slots ) { |
38
|
79
|
|
|
|
|
234
|
$class->add_obfu_name($arg, $stash, $slot); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub add_obfu_name { |
43
|
79
|
|
|
79
|
0
|
160
|
my ($class, $arg, $stash, $slot) = @_; |
44
|
|
|
|
|
|
|
|
45
|
79
|
|
|
|
|
686
|
my $data_version = $stash->get_symbol('$DATA_VERSION'); |
46
|
79
|
|
|
|
|
400
|
Readonly my $sym_val => sprintf( |
47
|
|
|
|
|
|
|
"%s-$slot", |
48
|
|
|
|
|
|
|
Minions::_Guts::attribute_sym($data_version), |
49
|
|
|
|
|
|
|
); |
50
|
79
|
|
|
|
|
7827
|
$Minions::_Guts::obfu_name{$slot} = $sym_val; |
51
|
|
|
|
|
|
|
|
52
|
79
|
|
|
|
|
529
|
my $prefix = ''; |
53
|
79
|
100
|
100
|
|
|
445
|
if($slot eq '' || ! $arg->{attr_style}) { |
|
|
50
|
|
|
|
|
|
54
|
78
|
|
|
|
|
137
|
$prefix = '__'; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
elsif($arg->{attr_style} eq 'uc') { |
57
|
1
|
|
|
|
|
4
|
$slot = uc $slot; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
$stash->add_symbol( |
60
|
79
|
|
|
|
|
981
|
sprintf('$%s%s', $prefix, $slot), |
61
|
|
|
|
|
|
|
\ $sym_val |
62
|
|
|
|
|
|
|
); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
26
|
0
|
|
sub update_args {} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
__END__ |