line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::Perl::VM::Scope; |
2
|
22
|
|
|
22
|
|
137
|
use Mouse; |
|
22
|
|
|
|
|
41
|
|
|
22
|
|
|
|
|
1241
|
|
3
|
|
|
|
|
|
|
|
4
|
22
|
|
|
22
|
|
8826
|
use Acme::Perl::VM qw(APVM_DEBUG $PL_op); |
|
22
|
|
|
|
|
46
|
|
|
22
|
|
|
|
|
9064
|
|
5
|
22
|
|
|
22
|
|
134
|
use Acme::Perl::VM::B (); |
|
22
|
|
|
|
|
219
|
|
|
22
|
|
|
|
|
528
|
|
6
|
22
|
|
|
22
|
|
114
|
use Scalar::Util (); |
|
22
|
|
|
|
|
43
|
|
|
22
|
|
|
|
|
6259
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
if(APVM_DEBUG){ |
9
|
|
|
|
|
|
|
has saved_state => ( |
10
|
|
|
|
|
|
|
is => 'ro', |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
builder => '_save', |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub type{ |
17
|
0
|
|
|
0
|
0
|
0
|
my($self) = @_; |
18
|
0
|
|
|
|
|
0
|
my $class = ref $self; |
19
|
0
|
|
|
|
|
0
|
$class =~ s/^Acme::Perl::VM::Scope:://; |
20
|
0
|
|
|
|
|
0
|
return $class; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _save{ |
24
|
0
|
|
|
0
|
|
0
|
my(undef, $file, $line) = caller(2); |
25
|
0
|
|
|
|
|
0
|
$file =~ s{\A .* Acme/Perl .* /}{}xmsi; |
26
|
0
|
0
|
|
|
|
0
|
my $proc = $PL_op ? ('in '.$PL_op->name.' ') : ''; |
27
|
0
|
|
|
|
|
0
|
return sprintf q{saved %s}.q{at %s line %d}, $proc, $file, $line; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
22
|
|
|
22
|
|
132
|
no Mouse; |
|
22
|
|
|
|
|
44
|
|
|
22
|
|
|
|
|
119
|
|
31
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
package Acme::Perl::VM::Scope::Value; |
34
|
22
|
|
|
22
|
|
3015
|
use Mouse; |
|
22
|
|
|
|
|
46
|
|
|
22
|
|
|
|
|
97
|
|
35
|
|
|
|
|
|
|
extends 'Acme::Perl::VM::Scope'; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
has value => ( |
38
|
|
|
|
|
|
|
is => 'ro', |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
required => 1, |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
has value_ref => ( |
44
|
|
|
|
|
|
|
is => 'ro', |
45
|
|
|
|
|
|
|
isa => 'Ref', |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
required => 1, |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub leave{ |
51
|
231
|
|
|
231
|
|
314
|
my($self) = @_; |
52
|
|
|
|
|
|
|
|
53
|
231
|
|
|
|
|
606
|
${ $self->value_ref } = $self->value; |
|
231
|
|
|
|
|
609
|
|
54
|
231
|
|
|
|
|
1471
|
return; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
22
|
|
|
22
|
|
9346
|
no Mouse; |
|
22
|
|
|
|
|
65
|
|
|
22
|
|
|
|
|
119
|
|
58
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
package Acme::Perl::VM::Scope::Tmps; |
61
|
22
|
|
|
22
|
|
2991
|
use Mouse; |
|
22
|
|
|
|
|
48
|
|
|
22
|
|
|
|
|
88
|
|
62
|
|
|
|
|
|
|
extends 'Acme::Perl::VM::Scope::Value'; |
63
|
|
|
|
|
|
|
|
64
|
22
|
|
|
22
|
|
6387
|
no Mouse; |
|
22
|
|
|
|
|
43
|
|
|
22
|
|
|
|
|
106
|
|
65
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
package Acme::Perl::VM::Scope::Comppad; |
68
|
22
|
|
|
22
|
|
2748
|
use Mouse; |
|
22
|
|
|
|
|
57
|
|
|
22
|
|
|
|
|
90
|
|
69
|
|
|
|
|
|
|
extends 'Acme::Perl::VM::Scope'; |
70
|
|
|
|
|
|
|
|
71
|
22
|
|
|
22
|
|
8855
|
use Acme::Perl::VM qw($PL_comppad $PL_comppad_name @PL_curpad); |
|
22
|
|
|
|
|
147
|
|
|
22
|
|
|
|
|
6533
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
has comppad => ( |
74
|
|
|
|
|
|
|
is => 'ro', |
75
|
|
|
|
|
|
|
isa => 'Maybe[B::AV]', |
76
|
|
|
|
|
|
|
); |
77
|
|
|
|
|
|
|
has comppad_name => ( |
78
|
|
|
|
|
|
|
is => 'ro', |
79
|
|
|
|
|
|
|
isa => 'Maybe[B::AV]', |
80
|
|
|
|
|
|
|
); |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub leave{ |
83
|
117
|
|
|
117
|
|
167
|
my($self) = @_; |
84
|
|
|
|
|
|
|
|
85
|
117
|
|
|
|
|
310
|
my $comppad = $self->comppad; |
86
|
117
|
|
|
|
|
165
|
$PL_comppad = $comppad; |
87
|
117
|
100
|
|
|
|
506
|
@PL_curpad = $comppad ? ($comppad->ARRAY) : (); |
88
|
|
|
|
|
|
|
|
89
|
117
|
|
|
|
|
327
|
$PL_comppad_name = $self->comppad_name; |
90
|
117
|
|
|
|
|
833
|
return; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
22
|
|
|
22
|
|
151
|
no Mouse; |
|
22
|
|
|
|
|
55
|
|
|
22
|
|
|
|
|
118
|
|
94
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
package Acme::Perl::VM::Scope::Clearsv; |
97
|
22
|
|
|
22
|
|
5677
|
use Mouse; |
|
22
|
|
|
|
|
51
|
|
|
22
|
|
|
|
|
114
|
|
98
|
|
|
|
|
|
|
extends 'Acme::Perl::VM::Scope'; |
99
|
|
|
|
|
|
|
|
100
|
22
|
|
|
22
|
|
7001
|
use Acme::Perl::VM qw(APVM_SCOPE deb @PL_cxstack $PL_comppad_name $PL_op PAD_SV); |
|
22
|
|
|
|
|
42
|
|
|
22
|
|
|
|
|
9064
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
has sv => ( |
103
|
|
|
|
|
|
|
is => 'ro', |
104
|
|
|
|
|
|
|
isa => 'B::SV', |
105
|
|
|
|
|
|
|
); |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub _save{ |
109
|
0
|
|
|
0
|
|
0
|
my($self) = @_; |
110
|
0
|
|
|
|
|
0
|
my $off = $PL_op->targ; |
111
|
0
|
|
|
|
|
0
|
my $name; |
112
|
|
|
|
|
|
|
|
113
|
0
|
0
|
0
|
|
|
0
|
if(PAD_SV($off) && ${PAD_SV($off)} == ${$self->sv}){ |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
114
|
0
|
|
|
|
|
0
|
$name = $PL_comppad_name->ARRAYelt($off)->PVX; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
else{ |
117
|
0
|
|
|
|
|
0
|
$name = sprintf '%s(0x%x)', $self->sv->class, ${ $self->sv }; |
|
0
|
|
|
|
|
0
|
|
118
|
|
|
|
|
|
|
} |
119
|
0
|
|
|
|
|
0
|
return $name . ' ' . $self->next::method(); |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub leave{ |
123
|
21
|
|
|
21
|
|
31
|
my($self) = @_; |
124
|
|
|
|
|
|
|
|
125
|
21
|
|
|
|
|
81
|
my $sv = $self->sv; |
126
|
21
|
50
|
33
|
|
|
266
|
return if $sv->REFCNT > 1 || $sv->STASH; |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
|
129
|
21
|
|
|
|
|
100
|
$sv->clear(); |
130
|
21
|
|
|
|
|
168
|
return; |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
22
|
|
|
22
|
|
129
|
no Mouse; |
|
22
|
|
|
|
|
37
|
|
|
22
|
|
|
|
|
201
|
|
134
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
package Acme::Perl::VM::Scope::Padsv; |
137
|
22
|
|
|
22
|
|
15367
|
use Mouse; |
|
22
|
|
|
|
|
67
|
|
|
22
|
|
|
|
|
112
|
|
138
|
|
|
|
|
|
|
extends 'Acme::Perl::VM::Scope'; |
139
|
|
|
|
|
|
|
|
140
|
22
|
|
|
22
|
|
7141
|
use Acme::Perl::VM qw(APVM_SCOPE deb @PL_cxstack ddx); |
|
22
|
|
|
|
|
50
|
|
|
22
|
|
|
|
|
8157
|
|
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
has value => ( |
143
|
|
|
|
|
|
|
is => 'ro', |
144
|
|
|
|
|
|
|
); |
145
|
|
|
|
|
|
|
has comppad => ( |
146
|
|
|
|
|
|
|
is => 'ro', |
147
|
|
|
|
|
|
|
isa => 'B::AV', |
148
|
|
|
|
|
|
|
); |
149
|
|
|
|
|
|
|
has off => ( |
150
|
|
|
|
|
|
|
is => 'ro', |
151
|
|
|
|
|
|
|
isa => 'Int', |
152
|
|
|
|
|
|
|
); |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
sub leave{ |
155
|
0
|
|
|
0
|
|
0
|
my($self) = @_; |
156
|
|
|
|
|
|
|
|
157
|
0
|
|
|
|
|
0
|
my $comppad_ref = $self->comppad->object_2svref; |
158
|
|
|
|
|
|
|
|
159
|
0
|
|
|
|
|
0
|
if(APVM_SCOPE){ |
160
|
|
|
|
|
|
|
my $old = ddx([${ $self->comppad->ARRAYelt($self->off)->object_2svref }]); |
161
|
|
|
|
|
|
|
my $new = ddx([$self->value]); |
162
|
|
|
|
|
|
|
$old->Indent(0); |
163
|
|
|
|
|
|
|
$new->Indent(0); |
164
|
|
|
|
|
|
|
deb "%s" . "padsv (%s -> %s) saved at %s\n", (q{>} x (@PL_cxstack+1)), |
165
|
|
|
|
|
|
|
$old->Dump, $new->Dump, $self->saved_at; |
166
|
|
|
|
|
|
|
} |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
#delete $comppad_ref->[$self->off]; |
169
|
0
|
|
|
|
|
0
|
$comppad_ref->[$self->off] = $self->value; |
170
|
|
|
|
|
|
|
|
171
|
0
|
|
|
|
|
0
|
return; |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
22
|
|
|
22
|
|
136
|
no Mouse; |
|
22
|
|
|
|
|
37
|
|
|
22
|
|
|
|
|
109
|
|
175
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
package Acme::Perl::VM::Scope::Localizer; # ABSTRACT |
178
|
22
|
|
|
22
|
|
2754
|
use Mouse; |
|
22
|
|
|
|
|
38
|
|
|
22
|
|
|
|
|
92
|
|
179
|
|
|
|
|
|
|
extends 'Acme::Perl::VM::Scope'; |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
has gv => ( |
182
|
|
|
|
|
|
|
is => 'ro', |
183
|
|
|
|
|
|
|
isa => 'B::GV', |
184
|
|
|
|
|
|
|
); |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
has old_ref => ( |
187
|
|
|
|
|
|
|
is => 'rw', |
188
|
|
|
|
|
|
|
isa => 'Ref', |
189
|
|
|
|
|
|
|
); |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
sub save_type; |
192
|
|
|
|
|
|
|
sub create_ref; |
193
|
|
|
|
|
|
|
sub sv; |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
sub BUILD{ |
196
|
5
|
|
|
5
|
|
247
|
my($self) = @_; |
197
|
|
|
|
|
|
|
|
198
|
5
|
|
|
|
|
26
|
my $glob_ref = $self->gv->object_2svref; |
199
|
|
|
|
|
|
|
|
200
|
5
|
|
|
|
|
6
|
$self->old_ref( *{$glob_ref}{ $self->save_type } ); |
|
5
|
|
|
|
|
35
|
|
201
|
5
|
|
|
|
|
13
|
*{$glob_ref} = $self->create_ref(); |
|
5
|
|
|
|
|
9
|
|
202
|
|
|
|
|
|
|
|
203
|
5
|
|
|
|
|
16
|
return; |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
sub leave{ |
207
|
5
|
|
|
5
|
|
7
|
my($self) = @_; |
208
|
|
|
|
|
|
|
|
209
|
5
|
|
|
|
|
9
|
*{$self->gv->object_2svref} = $self->old_ref; |
|
5
|
|
|
|
|
19
|
|
210
|
5
|
|
|
|
|
24
|
return; |
211
|
|
|
|
|
|
|
} |
212
|
|
|
|
|
|
|
|
213
|
22
|
|
|
22
|
|
12063
|
no Mouse; |
|
22
|
|
|
|
|
40
|
|
|
22
|
|
|
|
|
354
|
|
214
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
package Acme::Perl::VM::Scope::Scalar; |
217
|
22
|
|
|
22
|
|
2957
|
use Mouse; |
|
22
|
|
|
|
|
38
|
|
|
22
|
|
|
|
|
97
|
|
218
|
|
|
|
|
|
|
extends 'Acme::Perl::VM::Scope::Localizer'; |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
sub _save{ |
221
|
0
|
|
|
0
|
|
0
|
my($self) = @_; |
222
|
0
|
|
|
|
|
0
|
return Acme::Perl::VM::gv_fullname($self->gv, '$'); |
223
|
|
|
|
|
|
|
} |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
sub save_type(){ 'SCALAR' } |
226
|
|
|
|
|
|
|
sub create_ref{ |
227
|
3
|
|
|
3
|
|
5
|
my($self) = @_; |
228
|
|
|
|
|
|
|
|
229
|
3
|
100
|
|
|
|
32
|
if($self->gv->SV->MAGICAL){ |
230
|
2
|
|
|
|
|
7
|
bless $self, 'Acme::Perl::VM::Scope::Scalar::Magical'; |
231
|
2
|
|
|
|
|
2
|
$self->old_value(${$self->old_ref}); |
|
2
|
|
|
|
|
12
|
|
232
|
2
|
|
|
|
|
3
|
return \local(${*{ $self->gv->object_2svref }}); # to copy MAGIC |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
14
|
|
233
|
|
|
|
|
|
|
} |
234
|
|
|
|
|
|
|
else{ |
235
|
1
|
|
|
|
|
3
|
return \my $scalar; |
236
|
|
|
|
|
|
|
} |
237
|
|
|
|
|
|
|
} |
238
|
|
|
|
|
|
|
sub sv{ |
239
|
3
|
|
|
3
|
|
10
|
my($self) = @_; |
240
|
3
|
|
|
|
|
19
|
return $self->gv->SV; |
241
|
|
|
|
|
|
|
} |
242
|
|
|
|
|
|
|
|
243
|
22
|
|
|
22
|
|
11622
|
no Mouse; |
|
22
|
|
|
|
|
50
|
|
|
22
|
|
|
|
|
118
|
|
244
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
package Acme::Perl::VM::Scope::Scalar::Magical; |
247
|
22
|
|
|
22
|
|
2909
|
use Mouse; |
|
22
|
|
|
|
|
39
|
|
|
22
|
|
|
|
|
101
|
|
248
|
|
|
|
|
|
|
extends 'Acme::Perl::VM::Scope::Scalar'; |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
has old_value => ( |
251
|
|
|
|
|
|
|
is => 'rw', |
252
|
|
|
|
|
|
|
); |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
sub leave{ |
255
|
2
|
|
|
2
|
|
4
|
my($self) = @_; |
256
|
2
|
|
|
|
|
10
|
$self->SUPER::leave(); |
257
|
|
|
|
|
|
|
|
258
|
2
|
|
|
|
|
4
|
${$self->old_ref} = $self->old_value; |
|
2
|
|
|
|
|
5
|
|
259
|
2
|
|
|
|
|
38
|
return; |
260
|
|
|
|
|
|
|
} |
261
|
|
|
|
|
|
|
|
262
|
22
|
|
|
22
|
|
10042
|
no Mouse; |
|
22
|
|
|
|
|
53
|
|
|
22
|
|
|
|
|
108
|
|
263
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
package Acme::Perl::VM::Scope::Array; |
266
|
22
|
|
|
22
|
|
2614
|
use Mouse; |
|
22
|
|
|
|
|
43
|
|
|
22
|
|
|
|
|
84
|
|
267
|
|
|
|
|
|
|
extends 'Acme::Perl::VM::Scope::Localizer'; |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
sub _save{ |
270
|
0
|
|
|
0
|
|
0
|
my($self) = @_; |
271
|
0
|
|
|
|
|
0
|
return Acme::Perl::VM::gv_fullname($self->gv, '@'); |
272
|
|
|
|
|
|
|
} |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
sub save_type(){ 'ARRAY' } |
275
|
|
|
|
|
|
|
sub create_ref{ |
276
|
1
|
|
|
1
|
|
2
|
my($self) = @_; |
277
|
1
|
|
|
|
|
1
|
return \local @{*{ $self->gv->object_2svref }}; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
sub sv{ |
280
|
1
|
|
|
1
|
|
2
|
my($self) = @_; |
281
|
1
|
|
|
|
|
8
|
return $self->gv->AV; |
282
|
|
|
|
|
|
|
} |
283
|
|
|
|
|
|
|
|
284
|
22
|
|
|
22
|
|
12898
|
no Mouse; |
|
22
|
|
|
|
|
51
|
|
|
22
|
|
|
|
|
177
|
|
285
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
package Acme::Perl::VM::Scope::Hash; |
288
|
22
|
|
|
22
|
|
2781
|
use Mouse; |
|
22
|
|
|
|
|
45
|
|
|
22
|
|
|
|
|
89
|
|
289
|
|
|
|
|
|
|
extends 'Acme::Perl::VM::Scope::Localizer'; |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
sub _save{ |
292
|
0
|
|
|
0
|
|
0
|
my($self) = @_; |
293
|
0
|
|
|
|
|
0
|
return Acme::Perl::VM::gv_fullname($self->gv, '%'); |
294
|
|
|
|
|
|
|
} |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
sub save_type(){ 'HASH' } |
297
|
|
|
|
|
|
|
sub create_ref{ |
298
|
1
|
|
|
1
|
|
3
|
my($self) = @_; |
299
|
1
|
|
|
|
|
2
|
return \local %{*{ $self->gv->object_2svref }}; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
300
|
|
|
|
|
|
|
} |
301
|
|
|
|
|
|
|
sub sv{ |
302
|
1
|
|
|
1
|
|
2
|
my($self) = @_; |
303
|
1
|
|
|
|
|
11
|
return $self->gv->HV; |
304
|
|
|
|
|
|
|
} |
305
|
|
|
|
|
|
|
|
306
|
22
|
|
|
22
|
|
12040
|
no Mouse; |
|
22
|
|
|
|
|
53
|
|
|
22
|
|
|
|
|
100
|
|
307
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
__END__ |