line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Minions::Implementation; |
2
|
|
|
|
|
|
|
|
3
|
31
|
|
|
31
|
|
28066
|
use strict; |
|
31
|
|
|
|
|
62
|
|
|
31
|
|
|
|
|
900
|
|
4
|
31
|
|
|
31
|
|
1827
|
use Minions::_Guts; |
|
31
|
|
|
|
|
59
|
|
|
31
|
|
|
|
|
676
|
|
5
|
31
|
|
|
31
|
|
2480
|
use Package::Stash; |
|
31
|
|
|
|
|
29157
|
|
|
31
|
|
|
|
|
719
|
|
6
|
31
|
|
|
31
|
|
24500
|
use Readonly; |
|
31
|
|
|
|
|
100583
|
|
|
31
|
|
|
|
|
13439
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub import { |
9
|
38
|
|
|
38
|
|
1169
|
my ($class, %arg) = @_; |
10
|
|
|
|
|
|
|
|
11
|
38
|
|
|
|
|
247
|
strict->import(); |
12
|
|
|
|
|
|
|
|
13
|
38
|
|
|
|
|
189
|
$arg{-caller} = (caller)[0]; |
14
|
38
|
|
|
|
|
564
|
$class->define(%arg); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub define { |
18
|
38
|
|
|
38
|
0
|
133
|
my ($class, %arg) = @_; |
19
|
|
|
|
|
|
|
|
20
|
38
|
|
33
|
|
|
216
|
my $caller_pkg = delete $arg{-caller} || (caller)[0]; |
21
|
38
|
|
|
|
|
642
|
my $stash = Package::Stash->new($caller_pkg); |
22
|
|
|
|
|
|
|
|
23
|
38
|
|
|
|
|
151
|
$class->update_args(\%arg); |
24
|
38
|
|
|
|
|
151
|
$class->add_attribute_syms(\%arg, $stash); |
25
|
|
|
|
|
|
|
|
26
|
38
|
|
|
|
|
14129
|
$stash->add_symbol('%__meta__', \%arg); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub add_attribute_syms { |
30
|
38
|
|
|
38
|
0
|
110
|
my ($class, $arg, $stash) = @_; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
my @slots = ( |
33
|
38
|
|
|
|
|
148
|
keys %{ $arg->{has} }, |
34
|
38
|
100
|
|
|
|
63
|
@{ $arg->{requires}{attributes} || [] }, |
|
38
|
|
|
|
|
405
|
|
35
|
|
|
|
|
|
|
'', # semiprivate pkg |
36
|
|
|
|
|
|
|
); |
37
|
38
|
|
|
|
|
111
|
foreach my $slot ( @slots ) { |
38
|
79
|
|
|
|
|
238
|
$class->add_obfu_name($arg, $stash, $slot); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub add_obfu_name { |
43
|
79
|
|
|
79
|
0
|
166
|
my ($class, $arg, $stash, $slot) = @_; |
44
|
|
|
|
|
|
|
|
45
|
79
|
|
|
|
|
672
|
my $data_version = $stash->get_symbol('$DATA_VERSION'); |
46
|
79
|
|
|
|
|
355
|
Readonly my $sym_val => sprintf( |
47
|
|
|
|
|
|
|
"%s-$slot", |
48
|
|
|
|
|
|
|
Minions::_Guts::attribute_sym($data_version), |
49
|
|
|
|
|
|
|
); |
50
|
79
|
|
|
|
|
8005
|
$Minions::_Guts::obfu_name{$slot} = $sym_val; |
51
|
|
|
|
|
|
|
|
52
|
79
|
|
|
|
|
571
|
my $prefix = ''; |
53
|
79
|
100
|
100
|
|
|
423
|
if($slot eq '' || ! $arg->{attr_style}) { |
|
|
50
|
|
|
|
|
|
54
|
78
|
|
|
|
|
128
|
$prefix = '__'; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
elsif($arg->{attr_style} eq 'uc') { |
57
|
1
|
|
|
|
|
3
|
$slot = uc $slot; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
$stash->add_symbol( |
60
|
79
|
|
|
|
|
986
|
sprintf('$%s%s', $prefix, $slot), |
61
|
|
|
|
|
|
|
\ $sym_val |
62
|
|
|
|
|
|
|
); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
26
|
0
|
|
sub update_args {} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
__END__ |