| 1 | package KiokuDB::TypeMap::Entry::Std::Intrinsic; | ||||||||||
| 2 | 24 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 24 | ▶ | no warnings 'recursion'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 24 | ▶ | use namespace::clean -except => 'meta'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 24 | requires qw(compile_collapse_body); | |||||||||
| 9 | |||||||||||
| 10 | 24 | has intrinsic => ( | |||||||||
| 11 | isa => "Bool", | ||||||||||
| 12 | is => "ro", | ||||||||||
| 13 | predicate => "has_intrinsic", | ||||||||||
| 14 | ); | ||||||||||
| 15 | |||||||||||
| 16 | sub should_compile_intrinsic { | ||||||||||
| 17 | 163 | ▶ | my ( $self, $class, @args ) = @_; | ||||||||
|
Subroutine
should_compile_intrinsic: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 18 | |||||||||||
| 19 | 163 | return $self->intrinsic; | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | sub compile_collapse { | ||||||||||
| 23 | 434 | ▶ | my ( $self, @args ) = @_; | ||||||||
|
Subroutine
compile_collapse: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 24 | |||||||||||
| 25 | 434 | ▶ | if ( $self->should_compile_intrinsic(@args) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 86 | return $self->compile_intrinsic_collapse(@args); | |||||||||
| 27 | } else { | ||||||||||
| 28 | 348 | return $self->compile_first_class_collapse(@args); | |||||||||
| 29 | } | ||||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | sub compile_intrinsic_collapse { | ||||||||||
| 33 | 86 | ▶ | my ( $self, @args ) = @_; | ||||||||
|
Subroutine
compile_intrinsic_collapse: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 34 | |||||||||||
| 35 | 86 | $self->compile_collapse_wrapper( collapse_intrinsic => @args ); | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | sub compile_first_class_collapse { | ||||||||||
| 39 | 348 | ▶ | my ( $self, @args ) = @_; | ||||||||
|
Subroutine
compile_first_class_collapse: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 40 | |||||||||||
| 41 | 348 | $self->compile_collapse_wrapper( collapse_first_class => @args ); | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | sub compile_collapse_wrapper { | ||||||||||
| 45 | 434 | ▶ | my ( $self, $method, $class, @args ) = @_; | ||||||||
|
Subroutine
compile_collapse_wrapper: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 46 | |||||||||||
| 47 | 434 | my ( $body, @extra ) = $self->compile_collapse_body($class, @args); | |||||||||
| 48 | |||||||||||
| 49 | return sub { | ||||||||||
| 50 | 3873 | ▶ | my ( $collapser, $obj, @args ) = @_; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 51 | |||||||||||
| 52 | 3873 | $collapser->$method( $body, $obj, @extra, @args ); | |||||||||
| 53 | } | ||||||||||
| 54 | 434 | } | |||||||||
| 55 | |||||||||||
| 56 | 24 | __PACKAGE__ | |||||||||
| 57 | |||||||||||
| 58 | __END__ | ||||||||||