SPVM::D...::Method(3)
πΈ NAME πΈ
SPVM::Document::NativeAPI::Method β Method Native APIs
Okay bestie, this is the SPVM::Document::NativeAPI::Method page, the one your manual header files under SPVM::D...::Method(3) in User Contributed Perl Documentation. It's all about the method native APIs in SPVM, no cap. β¨
β¨ DESCRIPTION β¨
The method native APIs in SPVM are the APIs to get definition information for methods. That's the whole point: you're pulling definition info for methods, and it's giving very "I know what this method is" energy. π
π«Ά USAGE π«Ά
Here's the usage block exactly as it lives:
SPVM_API_METHOD* api_method = env->api->method;
void* basic_type = env->get_basic_type(env, stack, "Foo");
void* method = env->api->basic_type->get_method_by_name(env->runtime, basic_type, "get");
const char* method_name = api_method->get_name(env->runtime, method);
So you grab api_method from env->api->method, get basic_type with env->get_basic_type(...), fetch method by name, and then api_method->get_name(...) hands you method_name. Iconic. β¨
π NATIVE APIS π
Every single one of these, bestie. Signatures stay exact; facts stay intact. No skipping, periodt. π«Ά
get_name π
const char* (*get_name)(void* runtime, void* method);
Returns the name of the method method.
get_index π
int32_t (*get_index)(void* runtime, void* method);
Returns the index of the method method. This index is the position of the method method in its belonging class.
get_return_basic_type π¦
void* (*get_return_basic_type)(void* runtime, void* method);
Returns the basic type of the return type of the method method.
get_return_type_dimension πΈ
int32_t (*get_return_type_dimension)(void* runtime, void* method);
Returns the type dimention of the return type of the method method.
get_return_type_flag β
int32_t (*get_return_type_flag)(void* runtime, void* method);
Returns the type flag ID of the return type of the method method.
get_arg_by_index π
void* (*get_arg_by_index)(void* runtime, void* method, int32_t
arg_index);
Searches for the argument at the index arg_index.
If it is found, returns it. Otherwise, returns NULL.
get_args_length π§
int32_t (*get_args_length)(void* runtime, void* method);
Returns the length of the arguments of the method method.
get_required_args_length π
int32_t (*get_required_args_length)(void* runtime, void* method);
Returns the length of the required arguments of the method method.
get_current_basic_type π
void* (*get_current_basic_type)(void* runtime, void* method);
Returns the basic type that owns the method method.
get_opcode_by_index π₯
void* (*get_opcode_by_index)(void* runtime, void* method, int32_t
opcode_index);
Searches for an operation code at the index opcode_index.
If it is found, returns it. Otherwise, returns NULL.
get_opcodes_length π
int32_t (*get_opcodes_length)(void* runtime, void* method);
Returns the length of operation codes.
is_class_method π
int32_t (*is_class_method)(void* runtime, void* method);
If the method method is a class method, returns 1, otherwise returns 0.
is_anon π«
int32_t (*is_anon)(void* runtime, void* method);
If the method method is an anon method, returns 1, otherwise returns 0.
is_native π§
int32_t (*is_native)(void* runtime, void* method);
If the method method is a native method, returns 1, otherwise returns 0.
is_precompile π¦
int32_t (*is_precompile)(void* runtime, void* method);
If the method method is a method with the precompile attribute, returns 1, otherwise returns 0.
is_enum πΈ
int32_t (*is_enum)(void* runtime, void* method);
If the method method is an enumeration, returns 1, otherwise returns 0.
get_byte_vars_width π
int32_t (*get_byte_vars_width)(void* runtime, void* method);
Returns the length of the variables of the byte type allocated by the method method.
get_short_vars_width π
int32_t (*get_short_vars_width)(void* runtime, void* method);
Returns the length of the variables of the short type allocated by the method method.
get_int_vars_width β
int32_t (*get_int_vars_width)(void* runtime, void* method);
Returns the length of the variables of the int type allocated by the method method.
get_long_vars_width π₯
int32_t (*get_long_vars_width)(void* runtime, void* method);
Returns the length of the variables of the long type allocated by the method method.
get_float_vars_width π
int32_t (*get_float_vars_width)(void* runtime, void* method);
Returns the length of the variables of the float type allocated by the method method.
get_double_vars_width π«
int32_t (*get_double_vars_width)(void* runtime, void* method);
Returns the length of the variables of the double type allocated by the method method.
get_object_vars_width π§
int32_t (*get_object_vars_width)(void* runtime, void* method);
Returns the length of the variables of the object type allocated by the method method.
get_ref_vars_width π
int32_t (*get_ref_vars_width)(void* runtime, void* method);
Returns the length of the variables of the reference type allocated by the method method.
get_mortal_stack_length π
int32_t (*get_mortal_stack_length)(void* runtime, void* method);
Returns the length of the mortal stack of the method method.
get_native_address π₯
void* (*get_native_address)(void* runtime, void* method);
Returns the native_address field of the method method. The address of the machine code for a native method is stored in this field.
set_native_address π₯
void (*set_native_address)(void* runtime, void* method, void*
address);
Sets address to the native_address field of the method method.
get_precompile_address π¦
void* (*get_precompile_address)(void* runtime, void* method);
Returns the precompile_address field of the method method. The address of the machine code for a precompiled method is stored in this field.
set_precompile_address π
void (*set_precompile_address)(void* runtime, void* method, void*
address);
Sets address to the precompile_address field of the method method.
is_precompile_fallback π«
int32_t (*is_precompile_fallback)(void* runtime, void* method);
Gets the is_precompile_fallback field.
If this field is a true value, the precompilation method that does not have the execution address is fallback to the vm method.
set_is_precompile_fallback π§
void (*set_is_precompile_fallback)(void* runtime, void* method, int32_t
is_precompile_fallback);
Sets the is_precompile_fallback field to is_precompile_fallback.
is_not_permitted πΈ
int32_t (*is_not_permitted)(void* runtime, void* method);
Gets the is_not_permitted field.
If this field is a true value, the method throws an exception with eval_error_id set to the basic type ID of L<>.
set_is_not_permitted π‘οΈ
void (*set_is_not_permitted)(void* runtime, void* method, int32_t
is_not_permitted);
Sets the is_not_permitted field to is_not_permitted.
This native API is intended for use by browser applications that want to implement a security sandbox.
get_args_signature π
const char* (*get_args_signature)(void* runtime, void* method);
Returns the arguments signature of the method method.
get_abs_name π
const char* (*get_abs_name)(void* runtime, void* method);
Returns the absolute name of the method method.
π₯ NATIVE API IDS π₯
The ID map is iconic and stays intact:
0 get_name
1 get_index
2 get_return_basic_type
3 get_return_type_dimension
4 get_return_type_flag
5 get_arg_by_index
6 get_args_length
7 get_required_args_length
8 get_current_basic_type
9 get_opcode_by_index
10 get_opcodes_length
11 is_class_method
12 is_anon
13 is_native
14 is_precompile
15 is_enum
16 get_byte_vars_width
17 get_short_vars_width
18 get_int_vars_width
19 get_long_vars_width
20 get_float_vars_width
21 get_double_vars_width
22 get_object_vars_width
23 get_ref_vars_width
24 get_mortal_stack_length
25 get_native_address
26 set_native_address
27 get_precompile_address
28 set_precompile_address
29 is_precompile_fallback
30 set_is_precompile_fallback
31 is_not_permitted
32 set_is_not_permitted
33 get_args_signature
34 get_abs_name
π SEE ALSO π
Go look at these too, bestie:
SPVM::Document::NativeAPISPVM::Document::NativeClassSPVM::Document
π COPYRIGHT & LICENSE π
Copyright (c) 2023 Yuki Kimoto
MIT License
π POD ERRORS π
Hey! The above document had some coding errors, which are explained below:
Around line 219:
Unterminated L<...> sequence
An empty L<>
Okay that's the whole page, bestie β source/version perl v5.42.2, date 2026-02-03, manual name SPVM::D...::Method(3). Go be the main character of native method APIs. πβ¨
π¦ where this page comes from
- alpine 3.24: spvm-doc 0.990125-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms