| 1 | package SPVM::Builder::Native::BasicType; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 341 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 341 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | |||||||||||||||
| 6 | 0 | ▶ | sub pointer { | ||||||||||||
|
Subroutine
pointer: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||
| 7 | 0 | ▶ | my $self = shift; | ||||||||||||
|
Subroutine
pointer: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||
| 8 | 0 | ▶ | if (@_) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 9 | 0 | $self->{pointer} = $_[0]; | |||||||||||||
| 10 | 0 | return $self; | |||||||||||||
| 11 | } | ||||||||||||||
| 12 | else { | ||||||||||||||
| 13 | 0 | return $self->{pointer}; | |||||||||||||
| 14 | } | ||||||||||||||
| 15 | } | ||||||||||||||
| 16 | |||||||||||||||
| 17 | 0 | ▶ | sub runtime { | ||||||||||||
|
Subroutine
runtime: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||
| 18 | 0 | ▶ | my $self = shift; | ||||||||||||
|
Subroutine
runtime: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||
| 19 | 0 | ▶ | if (@_) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 20 | 0 | $self->{runtime} = $_[0]; | |||||||||||||
| 21 | 0 | return $self; | |||||||||||||
| 22 | } | ||||||||||||||
| 23 | else { | ||||||||||||||
| 24 | 0 | return $self->{runtime}; | |||||||||||||
| 25 | } | ||||||||||||||
| 26 | } | ||||||||||||||
| 27 | |||||||||||||||
| 28 | # Private Instance Methods - Only used in core. | ||||||||||||||
| 29 | 3458 | ▶ | sub get_native_method_names { | ||||||||||||
|
Subroutine
get_native_method_names: called CC=3 SCAR=15.5
Pod
undocumented
| |||||||||||||||
| 30 | 0 | ▶ | my ($self) = @_; | ||||||||||||
|
Subroutine
get_native_method_names: not called CC=3 SCAR=15.5
Pod
undocumented
| |||||||||||||||
| 31 | |||||||||||||||
| 32 | 0 | my $methods_length = $self->get_methods_length; | |||||||||||||
| 33 | |||||||||||||||
| 34 | 0 | my $native_method_names = []; | |||||||||||||
| 35 | |||||||||||||||
| 36 | 0 | ▶ | for (my $method_index = 0; $method_index < $methods_length; $method_index++) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 37 | 0 | my $method = $self->get_method_by_index($method_index); | |||||||||||||
| 38 | 0 | my $method_name = $method->get_name; | |||||||||||||
| 39 | 0 | ▶ | if ($method->is_native) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 40 | 0 | push @$native_method_names, $method_name; | |||||||||||||
| 41 | } | ||||||||||||||
| 42 | } | ||||||||||||||
| 43 | |||||||||||||||
| 44 | 0 | return $native_method_names; | |||||||||||||
| 45 | } | ||||||||||||||
| 46 | |||||||||||||||
| 47 | 3881 | ▶ | sub get_precompile_method_names { | ||||||||||||
|
Subroutine
get_precompile_method_names: called CC=3 SCAR=14.8
Pod
undocumented
| |||||||||||||||
| 48 | 0 | ▶ | my ($self) = @_; | ||||||||||||
|
Subroutine
get_precompile_method_names: not called CC=3 SCAR=14.8
Pod
undocumented
| |||||||||||||||
| 49 | |||||||||||||||
| 50 | 0 | my $methods_length = $self->get_methods_length; | |||||||||||||
| 51 | |||||||||||||||
| 52 | 0 | my $precompile_method_names = []; | |||||||||||||
| 53 | |||||||||||||||
| 54 | 0 | ▶ | for (my $method_index = 0; $method_index < $methods_length; $method_index++) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 55 | 0 | my $method = $self->get_method_by_index($method_index); | |||||||||||||
| 56 | 0 | my $method_name = $method->get_name; | |||||||||||||
| 57 | 0 | ▶ | if ($method->is_precompile) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 58 | 0 | push @$precompile_method_names, $method_name; | |||||||||||||
| 59 | } | ||||||||||||||
| 60 | } | ||||||||||||||
| 61 | |||||||||||||||
| 62 | 3458 | return $precompile_method_names; | |||||||||||||
| 63 | } | ||||||||||||||
| 64 | |||||||||||||||
| 65 | 2977 | ▶ | sub get_class_file { | ||||||||||||
|
Subroutine
get_class_file: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||
| 66 | 2554 | ▶ | my ($self) = @_; | ||||||||||||
|
Subroutine
get_class_file: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||
| 67 | |||||||||||||||
| 68 | 2554 | my $class_dir = $self->get_class_dir; | |||||||||||||
| 69 | |||||||||||||||
| 70 | 2554 | my $class_dir_sep; | |||||||||||||
| 71 | 2554 | ▶ | if (defined $class_dir) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 72 | 0 | $class_dir_sep = "/"; | |||||||||||||
| 73 | } | ||||||||||||||
| 74 | else { | ||||||||||||||
| 75 | 0 | $class_dir_sep = ""; | |||||||||||||
| 76 | 2040 | $class_dir = ""; | |||||||||||||
| 77 | } | ||||||||||||||
| 78 | |||||||||||||||
| 79 | 2977 | my $class_rel_file = $self->get_class_rel_file; | |||||||||||||
| 80 | |||||||||||||||
| 81 | 2977 | my $class_file = "$class_dir/$class_rel_file"; | |||||||||||||
| 82 | |||||||||||||||
| 83 | 2977 | return $class_file; | |||||||||||||
| 84 | } | ||||||||||||||
| 85 | |||||||||||||||
| 86 | 341 | 1; | |||||||||||||
| 87 | |||||||||||||||
| 88 | =head1 Name | ||||||||||||||
| 89 | |||||||||||||||
| 90 | SPVM::Builder::Native::BasicType - Basic Type Native APIs | ||||||||||||||
| 91 | |||||||||||||||
| 92 | =head1 Copyright & License | ||||||||||||||
| 93 | |||||||||||||||
| 94 | Copyright (c) 2023 Yuki Kimoto | ||||||||||||||
| 95 | |||||||||||||||
| 96 | MIT License | ||||||||||||||