line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
// Copyright (c) 2023 Yuki Kimoto |
2
|
|
|
|
|
|
|
// MIT License |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
#include |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
#include "spvm_native.h" |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#include "spvm_api_class_var.h" |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#include "spvm_allocator.h" |
11
|
|
|
|
|
|
|
#include "spvm_runtime_class_var.h" |
12
|
|
|
|
|
|
|
|
13
|
119195
|
|
|
|
|
|
SPVM_API_CLASS_VAR* SPVM_API_CLASS_VAR_new_api() { |
14
|
|
|
|
|
|
|
|
15
|
119195
|
|
|
|
|
|
void* native_apis_init[] = { |
16
|
|
|
|
|
|
|
SPVM_API_CLASS_VAR_get_name, |
17
|
|
|
|
|
|
|
SPVM_API_CLASS_VAR_get_index, |
18
|
|
|
|
|
|
|
SPVM_API_CLASS_VAR_get_basic_type, |
19
|
|
|
|
|
|
|
SPVM_API_CLASS_VAR_get_type_dimension, |
20
|
|
|
|
|
|
|
SPVM_API_CLASS_VAR_get_type_flag, |
21
|
|
|
|
|
|
|
SPVM_API_CLASS_VAR_get_current_basic_type, |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
|
24
|
119195
|
|
|
|
|
|
SPVM_API_CLASS_VAR* native_apis = calloc(1, sizeof(native_apis_init)); |
25
|
|
|
|
|
|
|
|
26
|
119195
|
|
|
|
|
|
memcpy(native_apis, native_apis_init, sizeof(native_apis_init)); |
27
|
|
|
|
|
|
|
|
28
|
119195
|
|
|
|
|
|
return native_apis; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
119195
|
|
|
|
|
|
void SPVM_API_CLASS_VAR_free_api(SPVM_API_CLASS_VAR* api) { |
32
|
|
|
|
|
|
|
|
33
|
119195
|
|
|
|
|
|
free(api); |
34
|
119195
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
const char* SPVM_API_CLASS_VAR_get_name(SPVM_RUNTIME* runtime, SPVM_RUNTIME_CLASS_VAR* class_var) { |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return class_var->name; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
int32_t SPVM_API_CLASS_VAR_get_index(SPVM_RUNTIME* runtime, SPVM_RUNTIME_CLASS_VAR* class_var) { |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
return class_var->index; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
SPVM_RUNTIME_BASIC_TYPE* SPVM_API_CLASS_VAR_get_basic_type(SPVM_RUNTIME* runtime, SPVM_RUNTIME_CLASS_VAR* class_var) { |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
return class_var->basic_type; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
int32_t SPVM_API_CLASS_VAR_get_type_dimension(SPVM_RUNTIME* runtime, SPVM_RUNTIME_CLASS_VAR* class_var) { |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
return class_var->type_dimension; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
int32_t SPVM_API_CLASS_VAR_get_type_flag(SPVM_RUNTIME* runtime, SPVM_RUNTIME_CLASS_VAR* class_var) { |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
return class_var->type_flag; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
SPVM_RUNTIME_BASIC_TYPE* SPVM_API_CLASS_VAR_get_current_basic_type(SPVM_RUNTIME* runtime, SPVM_RUNTIME_CLASS_VAR* class_var) { |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
return class_var->current_basic_type; |
64
|
|
|
|
|
|
|
} |