| 1 | package SPVM::Builder::Native::Runtime; | ||||||||||||||||||||||
| 2 | |||||||||||||||||||||||
| 3 | 293 | ▶ | use strict; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 4 | 293 | ▶ | use warnings; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 5 | |||||||||||||||||||||||
| 6 | # Fields | ||||||||||||||||||||||
| 7 | 0 | ▶ | sub pointer { | ||||||||||||||||||||
|
Subroutine
pointer: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||
| 8 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||
|
Subroutine
pointer: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||
| 9 | 0 | ▶ | if (@_) { | ||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||
| 10 | 0 | $self->{pointer} = $_[0]; | |||||||||||||||||||||
| 11 | 0 | return $self; | |||||||||||||||||||||
| 12 | } | ||||||||||||||||||||||
| 13 | else { | ||||||||||||||||||||||
| 14 | 0 | return $self->{pointer}; | |||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||
| 17 | |||||||||||||||||||||||
| 18 | 0 | ▶ | sub compiler { | ||||||||||||||||||||
|
Subroutine
compiler: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||
| 19 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||
|
Subroutine
compiler: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||
| 20 | 0 | ▶ | if (@_) { | ||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||
| 21 | 0 | $self->{compiler} = $_[0]; | |||||||||||||||||||||
| 22 | 0 | return $self; | |||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||
| 24 | else { | ||||||||||||||||||||||
| 25 | 0 | return $self->{compiler}; | |||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||
| 28 | |||||||||||||||||||||||
| 29 | 483 | ▶ | sub env { | ||||||||||||||||||||
|
Subroutine
env: called CC=2 SCAR=16.5
Pod
undocumented
| |||||||||||||||||||||||
| 30 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||
|
Subroutine
env: not called CC=2 SCAR=16.5
Pod
undocumented
| |||||||||||||||||||||||
| 31 | 0 | ▶ | if (@_) { | ||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||
| 32 | 0 | $self->{env} = $_[0]; | |||||||||||||||||||||
| 33 | 0 | return $self; | |||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||
| 35 | else { | ||||||||||||||||||||||
| 36 | 0 | return $self->{env}; | |||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||
| 39 | |||||||||||||||||||||||
| 40 | 935 | ▶ | sub get_basic_types { | ||||||||||||||||||||
|
Subroutine
get_basic_types: called CC=9 SCAR=23.0
Pod
undocumented
| |||||||||||||||||||||||
| 41 | 452 | ▶ | my ($self, $options) = @_; | ||||||||||||||||||||
|
Subroutine
get_basic_types: called CC=9 SCAR=23.0
Pod
undocumented
| |||||||||||||||||||||||
| 42 | |||||||||||||||||||||||
| 43 | 452 | ▶ | $options ||= {}; | ||||||||||||||||||||
|
Condition50%2/4
$options ||= {}
$options ||= {}
MC/DC0%0/1
$options ||= {}
$options
MC/DC0%0/1
$options ||= {}
$options
Truth table50%1/2
A
A= $options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||||
| 44 | |||||||||||||||||||||||
| 45 | 452 | my $basic_types_length = $self->get_basic_types_length; | |||||||||||||||||||||
| 46 | |||||||||||||||||||||||
| 47 | 452 | my $basic_types = []; | |||||||||||||||||||||
| 48 | |||||||||||||||||||||||
| 49 | 452 | my $match = 1; | |||||||||||||||||||||
| 50 | |||||||||||||||||||||||
| 51 | 452 | ▶ | for (my $id = 0; $id < $basic_types_length; $id++) { | ||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||
| 52 | 15150 | my $basic_type = $self->get_basic_type_by_id($id); | |||||||||||||||||||||
| 53 | |||||||||||||||||||||||
| 54 | 15150 | ▶ | if (exists $options->{category}) { | ||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||
| 55 | 15150 | my $categories = $options->{category}; | |||||||||||||||||||||
| 56 | |||||||||||||||||||||||
| 57 | 15150 | my $category_match = 0; | |||||||||||||||||||||
| 58 | 15150 | for my $category (@$categories) { | |||||||||||||||||||||
| 59 | 36778 | ▶ | if ($basic_type->get_category == $category) { | ||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||
| 60 | 10178 | $category_match = 1; | |||||||||||||||||||||
| 61 | 10178 | last; | |||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||
| 64 | |||||||||||||||||||||||
| 65 | 15150 | ▶ | unless ($category_match) { | ||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||
| 66 | 4972 | next; | |||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||
| 69 | |||||||||||||||||||||||
| 70 | 0 | ▶ | if (exists $options->{is_anon}) { | ||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||
| 71 | 0 | my $is_anon = $options->{is_anon}; | |||||||||||||||||||||
| 72 | |||||||||||||||||||||||
| 73 | 0 | my $basic_type_name = $basic_type->get_name; | |||||||||||||||||||||
| 74 | 0 | my $basic_type_is_anon = $basic_type->is_anon; | |||||||||||||||||||||
| 75 | |||||||||||||||||||||||
| 76 | 0 | my $is_anon_match = !!$basic_type->is_anon == !!$is_anon; | |||||||||||||||||||||
| 77 | |||||||||||||||||||||||
| 78 | 0 | ▶ | unless ($is_anon_match) { | ||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||
| 79 | 483 | next; | |||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||
| 82 | |||||||||||||||||||||||
| 83 | 10661 | push @$basic_types, $basic_type; | |||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||
| 85 | |||||||||||||||||||||||
| 86 | 935 | return $basic_types; | |||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||
| 88 | |||||||||||||||||||||||
| 89 | 293 | 1; | |||||||||||||||||||||
| 90 | |||||||||||||||||||||||
| 91 | =head1 Name | ||||||||||||||||||||||
| 92 | |||||||||||||||||||||||
| 93 | SPVM::Builder::Native::Runtime - Runtime | ||||||||||||||||||||||
| 94 | |||||||||||||||||||||||
| 95 | =head1 Copyright & License | ||||||||||||||||||||||
| 96 | |||||||||||||||||||||||
| 97 | Copyright (c) 2023 Yuki Kimoto | ||||||||||||||||||||||
| 98 | |||||||||||||||||||||||
| 99 | MIT License | ||||||||||||||||||||||