repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
Tareq-Kellyeh/H5MR
h5mr/h5mr-serializer.h
#ifndef H5MR_SERIALIZER_H #define H5MR_SERIALIZER_H #include <mpi.h> /* * Manage auxilliary data like global variables with a similar approach to MPI * Read scans for the key and returns the data according to the datatype and count */ void h5mr_record_data(const char * unique_key, MPI_Datatype datatype, int count,...
Tareq-Kellyeh/H5MR
h5mr/datatype.h
#ifndef DATATYPE_H #define DATATYPE_H #include <mpi.h> #include <stdio.h> #include <assert.h> #include <string.h> #ifdef DEBUG #define debug(...) printf("[DT] "__VA_ARGS__); #else #define debug(...) #endif #define printType(...) NULL; #define CHECK_RET(ret) if(ret != MPI_SUCCESS){ printf("Critical error decodin...
Tareq-Kellyeh/H5MR
h5mr/hdf5-builder.h
#ifndef HDF5_BUILDER_H #define HDF5_BUILDER_H #include <stdlib.h> #include <mpi.h> #include <glib.h> #include <string.h> #include <assert.h> #include "hdf5.h" #include "hdf5_hl.h" /* hashtable: string => int ex: "contingiuous(.....)" => 1 ex: "vector(.....)" => 2 */ GHashTable* datatype_htbl; /* hashtabl...
Tareq-Kellyeh/H5MR
h5mr/hdf5-mpi-wrapper.h
#ifndef HDF5_WRAPPER_H #define HDF5_MPI_WRAPPER_H #include "h5mr.h" //int MPI_Init(int * argc, char *** args); //int MPI_Finalize(); //int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); #endif
Tareq-Kellyeh/H5MR
mpi-h5mr/hdf5-reader.c
<reponame>Tareq-Kellyeh/H5MR<filename>mpi-h5mr/hdf5-reader.c #include "../h5mr/structures.h" #include "../h5mr/datatype.h" #include "../h5mr/datatype-table.h" #include "hdf5-reader.h" communicator_ds_t * communicator_ds = NULL; description_ds_t * description_ds = NULL; recv_ds_t * recv_ds = NULL; ...
Tareq-Kellyeh/H5MR
h5mr/hdf5-builder.c
<gh_stars>0 #include "structures.h" #include "datatype.h" #include "datatype-table.h" #include "hdf5-builder.h" int is_data_structures_initialized = 0; int last_comm_id = 0; GHashTable* datatype_htbl = NULL; GHashTable* mpi_datatype_ds_htbl = NULL; GHashTable* i_recv_request_htbl ...
Tareq-Kellyeh/H5MR
h5mr/datatype-table.h
<filename>h5mr/datatype-table.h #ifndef DATATYPE_TABLE_H #define DATATYPE_TABLE_H #include <hdf5.h> #include <mpi.h> #include <stdio.h> #include <assert.h> #include <string.h> #include <stdlib.h> #ifdef DEBUG #define debug(...) printf("[DT] "__VA_ARGS__); #else #define debug(...) #endif #define CHECK_RET(ret) i...
Tareq-Kellyeh/H5MR
test/07-waitall.c
<reponame>Tareq-Kellyeh/H5MR<filename>test/07-waitall.c #include "mpi.h" #include <stdio.h> int main(int argc, char *argv[]) { int rank, size; int i; int buffer[400]; MPI_Request request[4]; MPI_Status status[4]; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); if (size !=...
Tareq-Kellyeh/H5MR
h5mr/structures.h
#ifndef STRUCTURES_H #define STRUCTURES_H #include <glib.h> #include "hdf5.h" #include "hdf5_hl.h" #include <string.h> #include <assert.h> /* hashtable: MEMORY location => int ex: "MPI_COMM_SELF" => 0 ex: "MPI_COMM_World" => 1 */ GHashTable* comm_htbl; // has to be inserted in HDF5_Table at the end? GHashTable* du...
Tareq-Kellyeh/H5MR
test/01-contingiuous_of_vectors.c
#include <stdio.h> #include <mpi.h> /* Run with four processes */ int main(int argc, char *argv[]) { int rank; int i; MPI_Status status; MPI_Init(&argc,&argv); MPI_Comm_rank(MPI_COMM_WORLD,&rank); const int count = 2; const int blocklength = 3; const int stride = 4; ...
Tareq-Kellyeh/H5MR
h5mr/h5mr.c
<reponame>Tareq-Kellyeh/H5MR #include "h5mr.h" /* * 1 => capture completely * 0 => capture partialy */ static int h5mr_full_capture = 0; int h5mr_trace_enabled = 0; int h5mr_init(int full_capture){ if (full_capture){ h5mr_full_capture = 1; h5mr_trace_enabled = 0; } return 0; } int h5mr_s...
Tareq-Kellyeh/H5MR
h5mr/h5mr.h
#ifndef H5MR_H #define H5MR_H /* * @brief This function configures the default / automatic recording. * @param manual_control if set to 1, then the library will not automatically capture anything, but one has to use h5mr_start_recording() * @return 0 if successfull, otherwise an error happened. */ int h5mr_init...
Tareq-Kellyeh/H5MR
h5mr/datatype.c
<gh_stars>0 #include "datatype.h" char datatype_desc[1000] = ""; char temp[100]; static void mpix_decode_primitive(MPI_Datatype typ){ printType("NAMED("); strcat(datatype_desc, "NAMED("); int size; MPI_Type_size( typ, &size ); printType("size=%d,", size); if(typ == MPI_BYTE){ p...
Tareq-Kellyeh/H5MR
mpi-h5mr/hdf5-reader.h
#ifndef HDF5_READER_H #define HDF5_READER_H #include <stdlib.h> #include <glib.h> #include <mpi.h> #include "hdf5.h" #include "hdf5_hl.h" //#include "../mh5r/hdf5_builder.h" //#define free_resources() free_resources() //void free_resources(); GHashTable* datatype_ds_htbl; typedef struct { int ...
Tareq-Kellyeh/H5MR
test/06-simple_isend_irecv.c
<reponame>Tareq-Kellyeh/H5MR #include "mpi.h" #include <stdio.h> int main(int argc, char *argv[]) { int myid, numprocs, left, right; int buffer[10], buffer2[10]; MPI_Request request, request2; MPI_Status status; MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD, &numprocs); MPI_Comm_rank(...
Tareq-Kellyeh/H5MR
h5mr/structures.c
<reponame>Tareq-Kellyeh/H5MR #include "structures.h" GHashTable* comm_htbl = NULL; GHashTable* dummy_comm_htbl = NULL; GHashTable* persistent_comm_htbl = NULL; void h5mr_intitial_dummy_data_structures() { if ( comm_htbl == NULL) { comm_htbl = g_hash_table_new(g_str_hash, g_str_equ...
Tareq-Kellyeh/H5MR
h5mr/datatype-table.c
<reponame>Tareq-Kellyeh/H5MR #include "datatype-table.h" static void _mpi_hdf5_mapper(MPI_Datatype typ, int* type_serial_no, hid_t *memtype, size_t *offset, hid_t *filetype) { hid_t hdf5_datatype; size_t hdf5_datatype_size; int mpi_datatype_size; MPI_Type_size(typ, &mpi_datatype_size); ...
Tareq-Kellyeh/H5MR
mpi-h5mr/mpi.c
//#include <mpi.h> #include "../h5mr/structures.h" #include "hdf5-reader.h" int MPI_Init(int * argc, char *** argv) { // the last parameter of the program is expected to be the trace file if (*argc > 1){ (*argc)--; h5mr_initilize_param((*argv)[*argc]); printf("MPI-MH5R: Replaying the...
motxx/SPVM
lib/SPVM/Builder/src/spvm_my.c
#include "spvm_my.h" #include "spvm_compiler_allocator.h" #include "spvm_compiler.h" SPVM_MY* SPVM_MY_new(SPVM_COMPILER* compiler) { SPVM_MY* my = SPVM_COMPILER_ALLOCATOR_safe_malloc_zero(compiler, sizeof(SPVM_MY)); my->index = -1; my->var_id = -1; return my; }
motxx/SPVM
lib/SPVM/Builder/include/spvm_list.h
#ifndef SPVM_LIST_H #define SPVM_LIST_H #include "spvm_base.h" struct SPVM_list { void** values; int32_t length; int32_t capacity; }; SPVM_LIST* SPVM_LIST_new(int32_t capacity); void SPVM_LIST_free(SPVM_LIST* array); void SPVM_LIST_maybe_extend(SPVM_LIST* array); void SPVM_LIST_push(SPVM_LIST* array, void* va...
motxx/SPVM
lib/SPVM/Builder/include/spvm_constant_pool.h
<reponame>motxx/SPVM #ifndef SPVM_CONSTANT_POOL_H #define SPVM_CONSTANT_POOL_H #include "spvm_base.h" // Array struct SPVM_constant_pool { int32_t* values; int32_t length; int32_t capacity; }; // Array function SPVM_CONSTANT_POOL* SPVM_CONSTANT_POOL_new(int32_t capacity); void SPVM_CONSTANT_POOL_extend(SPVM_CO...
motxx/SPVM
lib/SPVM/Builder/include/spvm_runtime_api.h
<filename>lib/SPVM/Builder/include/spvm_runtime_api.h<gh_stars>0 #ifndef SPVM_RUNTIME_API_H #define SPVM_RUNTIME_API_H #include "spvm_base.h" #include "spvm_native.h" /* "& ~(intptr_t)1" means dropping weaken flag */ #define SPVM_RUNTIME_API_GET_OBJECT_NO_WEAKEN_ADDRESS(object) ((void*)((intptr_t)object & ~(intptr...
motxx/SPVM
lib/SPVM/Builder/include/spvm_block.h
<reponame>motxx/SPVM #ifndef SPVM_BLOCK_H #define SPVM_BLOCK_H #include "spvm_base.h" enum { // Block flag SPVM_BLOCK_C_ID_NORMAL, SPVM_BLOCK_C_ID_IF, SPVM_BLOCK_C_ID_ELSE, SPVM_BLOCK_C_ID_LOOP_STATEMENTS, SPVM_BLOCK_C_ID_SWITCH, SPVM_BLOCK_C_ID_SUB, SPVM_BLOCK_C_ID_EVAL, SPVM_BLOCK_C_ID_LOOP_INIT, ...
motxx/SPVM
lib/SPVM/Builder/include/spvm_sub.h
<gh_stars>0 #ifndef SPVM_SUB_H #define SPVM_SUB_H #include "spvm_base.h" enum { SPVM_SUB_C_CALL_TYPE_ID_CLASS_METHOD, SPVM_SUB_C_CALL_TYPE_ID_METHOD, }; enum { SPVM_SUB_C_FLAG_NATIVE = 1, SPVM_SUB_C_FLAG_PRECOMPILE = 2, SPVM_SUB_C_FLAG_ENUM = 4, SPVM_SUB_C_FLAG_DESTRUCTOR = 8, SPVM_SUB_C_FLAG_OBJECT_TY...
motxx/SPVM
lib/SPVM/Builder/include/spvm_case_info.h
#ifndef SPVM_CASE_INFO_H #define SPVM_CASE_INFO_H #include "spvm_base.h" struct SPVM_case_info { SPVM_OP* op_case_info; SPVM_CONSTANT* constant; int32_t opcode_rel_index; int32_t index; }; SPVM_CASE_INFO* SPVM_CASE_INFO_new(); #endif
motxx/SPVM
lib/SPVM/Builder/src/spvm_portable.c
#include <stdlib.h> #include <string.h> #include <assert.h> #include "spvm_portable.h" #include "spvm_compiler.h" #include "spvm_type.h" #include "spvm_package.h" #include "spvm_type.h" #include "spvm_op.h" #include "spvm_hash.h" #include "spvm_list.h" #include "spvm_util_allocator.h" #include "spvm_compiler_allocato...
motxx/SPVM
lib/SPVM/Builder/include/spvm_package_var_access.h
<filename>lib/SPVM/Builder/include/spvm_package_var_access.h #ifndef SPVM_PACKAGE_VAR_ACCESS_H #define SPVM_PACKAGE_VAR_ACCESS_H #include "spvm_base.h" struct SPVM_package_var_access { SPVM_OP* op_name; SPVM_PACKAGE_VAR* package_var; int32_t constant_pool_id; int32_t inline_expansion; }; SPVM_PACKAGE_VAR_ACC...
motxx/SPVM
lib/SPVM/Builder/src/spvm_unicode.c
#include "spvm_unicode.h" /* SPVM_UNICODE is originally copied from utf8proc utf8proc license https://github.com/JuliaStrings/utf8proc Copyright © 2014-2018 by <NAME>, <NAME>, <NAME>, <NAME>, and other contributors listed in the git history. Permission is hereby granted, free of charge, to any person obtaining a c...
motxx/SPVM
lib/SPVM/Builder/src/spvm_sub.c
#include <stdlib.h> #include "spvm_sub.h" #include "spvm_compiler_allocator.h" #include "spvm_compiler.h" #include "spvm_my.h" #include "spvm_list.h" #include "spvm_op.h" #include "spvm_type.h" #include "spvm_basic_type.h" SPVM_SUB* SPVM_SUB_new(SPVM_COMPILER* compiler) { SPVM_SUB* sub = SPVM_COMPILER_ALLOCATOR_sa...
motxx/SPVM
lib/SPVM/Builder/include/spvm_string_buffer.h
<gh_stars>0 #ifndef SPVM_STRING_BUFFER_H #define SPVM_STRING_BUFFER_H #include "spvm_base.h" struct SPVM_string_buffer { char* buffer; int32_t capacity; int32_t length; }; SPVM_STRING_BUFFER* SPVM_STRING_BUFFER_new(int32_t capacity); char* SPVM_STRING_BUFFER_get_buffer(SPVM_STRING_BUFFER* string_buffer); void ...
motxx/SPVM
lib/SPVM/Builder/src/spvm_csource_builder_exe.c
#include <stdlib.h> #include <string.h> #include <assert.h> #include "spvm_csource_builder_exe.h" #include "spvm_compiler.h" #include "spvm_type.h" #include "spvm_package.h" #include "spvm_type.h" #include "spvm_op.h" #include "spvm_hash.h" #include "spvm_list.h" #include "spvm_util_allocator.h" #include "spvm_compil...
motxx/SPVM
lib/SPVM/Builder/include/spvm_basic_type.h
#ifndef SPVM_BASIC_TYPE_H #define SPVM_BASIC_TYPE_H #include "spvm_base.h" enum { SPVM_BASIC_TYPE_C_ID_UNKNOWN, SPVM_BASIC_TYPE_C_ID_UNDEF, SPVM_BASIC_TYPE_C_ID_VOID, SPVM_BASIC_TYPE_C_ID_BYTE, SPVM_BASIC_TYPE_C_ID_SHORT, SPVM_BASIC_TYPE_C_ID_INT, SPVM_BASIC_TYPE_C_ID_LONG, SPVM_BASIC_TYPE_C_ID_FLO...
motxx/SPVM
lib/SPVM/Builder/src/spvm_var.c
<reponame>motxx/SPVM #include "spvm_var.h" #include "spvm_compiler_allocator.h" #include "spvm_compiler.h" SPVM_VAR* SPVM_VAR_new(SPVM_COMPILER* compiler) { return SPVM_COMPILER_ALLOCATOR_safe_malloc_zero(compiler, sizeof(SPVM_VAR)); }
motxx/SPVM
lib/SPVM/CORE.c
#include "spvm_native.h" #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <inttypes.h> #include <float.h> #include <math.h> #include <time.h> #include <complex.h> #include <memory.h> #include <fcntl.h> int32_t SPVM_NATIVE_SPVM__CORE__ref_count(SPVM_ENV* env, SPVM_VALUE* stack) { void* obj = stack...
motxx/SPVM
lib/SPVM/Builder/include/spvm_csource_builder_exe.h
<filename>lib/SPVM/Builder/include/spvm_csource_builder_exe.h #ifndef SPVM_CSOURCE_BUILDER_EXE_H #define SPVM_CSOURCE_BUILDER_EXE_H #include <stdio.h> #include "spvm_base.h" #include "spvm_native.h" void SPVM_CSOURCE_BUILDER_EXE_build_exe_csource(SPVM_ENV* env, SPVM_STRING_BUFFER* string_buffer, SPVM_PORTABLE* porta...
motxx/SPVM
lib/SPVM/Builder/include/spvm_native.h
#ifndef SPVM_NATIVE_H #define SPVM_NATIVE_H #include <stdint.h> struct SPVM_env; typedef struct SPVM_env SPVM_ENV; typedef union SPVM_value SPVM_VALUE; union SPVM_value { int8_t bval; int16_t sval; int32_t ival; int64_t lval; float fval; double dval; void* oval; int8_t* bref; int16_t* sref; int3...
motxx/SPVM
lib/SPVM/Builder/src/spvm_array_field_access.c
#include "spvm_array_field_access.h" #include "spvm_compiler_allocator.h" #include "spvm_compiler.h" SPVM_ARRAY_FIELD_ACCESS* SPVM_ARRAY_FIELD_ACCESS_new(SPVM_COMPILER* compiler) { return SPVM_COMPILER_ALLOCATOR_safe_malloc_zero(compiler, sizeof(SPVM_ARRAY_FIELD_ACCESS)); }
motxx/SPVM
lib/SPVM/Builder/include/spvm_runtime_package.h
#ifndef SPVM_RUNTIME_PACKAGE_H #define SPVM_RUNTIME_PACKAGE_H #include "spvm_base.h" // Field information struct SPVM_runtime_package { int32_t id; int32_t name_id; int32_t destructor_sub_id; int32_t category; int32_t flag; int32_t constant_pool_base; int32_t fields_base; int32_t subs_base; int32_t ...
motxx/SPVM
lib/SPVM/Builder/include/spvm_opcode_builder.h
#ifndef SPVM_BYTECODE_BUILDER_H #define SPVM_BYTECODE_BUILDER_H #include "spvm_base.h" void SPVM_BYTECODE_BUILDER_build_bytecode_array(SPVM_COMPILER* compiler); void SPVM_OPCODE_BUILDER_build_opcode_array(SPVM_COMPILER* compiler); #endif
motxx/SPVM
lib/SPVM/Builder/src/spvm_op.c
<reponame>motxx/SPVM<filename>lib/SPVM/Builder/src/spvm_op.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> #include <assert.h> #include <inttypes.h> #include <ctype.h> #include "spvm_compiler.h" #include "spvm_list.h" #include "spvm_hash.h" #include "spvm_op.h" #include "spvm_sub.h" #in...
motxx/SPVM
lib/SPVM/Builder/include/spvm_my.h
#ifndef SPVM_MY_H #define SPVM_MY_H #include "spvm_base.h" struct SPVM_my { SPVM_OP* op_my; SPVM_TYPE* type; SPVM_OP* op_name; int32_t index; int32_t var_id; int32_t runtime_type; int32_t type_width; int8_t is_tmp; }; SPVM_MY* SPVM_MY_new(); #endif
motxx/SPVM
lib/SPVM/Builder/src/spvm_descriptor.c
#include "spvm_descriptor.h" #include "spvm_compiler_allocator.h" #include "spvm_compiler.h" const char* const SPVM_DESCRIPTOR_C_ID_NAMES[] = { "interface_t", "value_t", "pointer_t", "native", "precompile", "public", "private", "rw", "ro", "wo", }; SPVM_DESCRIPTOR* SPVM_DESCRIPTOR_new(SPVM_COMPIL...
motxx/SPVM
lib/SPVM/Builder/include/spvm_compiler_allocator.h
#ifndef SPVM_COMPILER_ALLOCATOR_H #define SPVM_COMPILER_ALLOCATOR_H #include "spvm_base.h" // Parser information struct SPVM_compiler_allocator { // Blocks SPVM_LIST* blocks; // Lists SPVM_LIST* lists; // Hashes SPVM_LIST* hashes; // Constant pools SPVM_LIST* constant_pools; void** memory_...
motxx/SPVM
t/default/lib/TestCase/Extension.c
<reponame>motxx/SPVM #include <stdlib.h> #include <string.h> #include <float.h> #include <assert.h> #include <spvm_native.h> int32_t SPVM_NATIVE_TestCase__Extension__bpkgvar_test(SPVM_ENV* env, SPVM_VALUE* stack) { (void)env; (void)stack; int32_t pkgvar_id = env->pkgvar_id(env, "TestCase::Extension", "$BYTE_VA...
motxx/SPVM
lib/SPVM/Builder/include/spvm_runtime_sub.h
<reponame>motxx/SPVM<filename>lib/SPVM/Builder/include/spvm_runtime_sub.h #ifndef SPVM_RUNTIME_SUB_H #define SPVM_RUNTIME_SUB_H #include "spvm_base.h" // Field information struct SPVM_runtime_sub { int32_t id; int32_t name_id; int32_t signature_id; int32_t package_id; int32_t file_id; int32_t line; int3...
motxx/SPVM
lib/SPVM/Builder/src/spvm_basic_type.c
#include <stdlib.h> #include <string.h> #include <assert.h> #include "spvm_compiler.h" #include "spvm_basic_type.h" #include "spvm_compiler_allocator.h" const char* const SPVM_BASIC_TYPE_C_ID_NAMES[] = { "unknown", "undef", "void", "byte", "short", "int", "long", "float", "double", "string", "ob...
motxx/SPVM
lib/SPVM/Builder/src/spvm_constant.c
#include <string.h> #include "spvm_compiler.h" #include "spvm_constant.h" #include "spvm_compiler_allocator.h" #include "spvm_hash.h" #include "spvm_type.h" SPVM_CONSTANT* SPVM_CONSTANT_new(SPVM_COMPILER* compiler) { SPVM_CONSTANT* constant = SPVM_COMPILER_ALLOCATOR_safe_malloc_zero(compiler, sizeof(SPVM_CONSTANT)...
motxx/SPVM
lib/SPVM/Builder/include/spvm_call_sub.h
#ifndef SPVM_CALL_SUB_H #define SPVM_CALL_SUB_H #include "spvm_base.h" struct SPVM_call_sub { SPVM_OP* op_invocant; SPVM_OP* op_name; SPVM_SUB* sub; int32_t call_type_id; int32_t constant_pool_id; }; SPVM_CALL_SUB* SPVM_CALL_SUB_new(SPVM_COMPILER* compiler); #endif
motxx/SPVM
lib/SPVM/Builder/src/spvm_op_checker.c
<reponame>motxx/SPVM<gh_stars>0 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> #include <assert.h> #include <ctype.h> #include "spvm_compiler.h" #include "spvm_list.h" #include "spvm_hash.h" #include "spvm_compiler_allocator.h" #include "spvm_op.h" #include "spvm_op_checker.h" #include...
motxx/SPVM
lib/SPVM/Builder/include/spvm_var.h
#ifndef SPVM_VAR_H #define SPVM_VAR_H #include "spvm_base.h" struct SPVM_var { SPVM_OP* op_name; SPVM_MY* my; int8_t is_declaration; int8_t is_outer; }; SPVM_VAR* SPVM_VAR_new(SPVM_COMPILER* compiler); #endif
motxx/SPVM
lib/SPVM/Builder/src/spvm_switch_info.c
#include "spvm_switch_info.h" #include "spvm_compiler_allocator.h" #include "spvm_compiler.h" #include "spvm_list.h" SPVM_SWITCH_INFO* SPVM_SWITCH_INFO_new(SPVM_COMPILER* compiler) { SPVM_SWITCH_INFO* switch_info = SPVM_COMPILER_ALLOCATOR_safe_malloc_zero(compiler, sizeof(SPVM_SWITCH_INFO)); switch_info->case_...
motxx/SPVM
lib/SPVM/Builder/src/spvm_list.c
<reponame>motxx/SPVM<gh_stars>0 #include <string.h> #include <stdlib.h> #include <assert.h> #include "spvm_list.h" #include "spvm_util_allocator.h" SPVM_LIST* SPVM_LIST_new(int32_t capacity) { assert(capacity >= 0); SPVM_LIST* array = SPVM_UTIL_ALLOCATOR_safe_malloc_zero(sizeof(SPVM_LIST)); array->length ...
motxx/SPVM
lib/SPVM/Builder/include/spvm_portable.h
#ifndef SPVM_PORTABLE_H #define SPVM_PORTABLE_H #include "spvm_base.h" struct SPVM_portable { char* memory_pool; SPVM_OPCODE* opcodes; int32_t opcodes_length; SPVM_RUNTIME_BASIC_TYPE* basic_types; int32_t basic_types_length; SPVM_RUNTIME_PACKAGE* packages; int32_t packages_length; SPVM_RUNTIME_P...
motxx/SPVM
lib/SPVM/Builder/include/spvm_dumper.h
#ifndef SPVM_DUMPER_H #define SPVM_DUMPER_H #include "spvm_base.h" void SPVM_DUMPER_dump_constants(SPVM_COMPILER* compiler, SPVM_LIST* constants); void SPVM_DUMPER_dump_constant(SPVM_COMPILER* compiler, SPVM_CONSTANT* constant); void SPVM_DUMPER_dump_field(SPVM_COMPILER* compiler, SPVM_FIELD* field); void SPVM_DUMPER...
motxx/SPVM
lib/SPVM/Builder/src/spvm_block.c
#include "spvm_block.h" #include "spvm_list.h" #include "spvm_compiler_allocator.h" #include "spvm_compiler.h" SPVM_BLOCK* SPVM_BLOCK_new(SPVM_COMPILER* compiler) { SPVM_BLOCK* block = SPVM_COMPILER_ALLOCATOR_safe_malloc_zero(compiler, sizeof(SPVM_BLOCK)); return block; }
motxx/SPVM
lib/SPVM/Builder/include/spvm_runtime_package_var.h
#ifndef SPVM_RUNTIME_PACKAGE_VAR_H #define SPVM_RUNTIME_PACKAGE_VAR_H #include "spvm_base.h" // Field information struct SPVM_runtime_package_var { int32_t id; int32_t name_id; int32_t signature_id; int32_t basic_type_id; int32_t type_dimension; int32_t type_flag; int32_t package_id; }; SPVM_RUNTIME_PA...
motxx/SPVM
lib/SPVM/Builder/src/spvm_runtime_api.c
<gh_stars>0 #include <stdint.h> #include <assert.h> #include <string.h> #include <math.h> #include <stdlib.h> #include <stdio.h> #include <stddef.h> #include <inttypes.h> #include "spvm_runtime.h" #include "spvm_runtime_api.h" #include "spvm_object.h" #include "spvm_native.h" #include "spvm_list.h" #include "spvm_has...
motxx/SPVM
lib/SPVM/Builder/src/spvm_string_buffer.c
<filename>lib/SPVM/Builder/src/spvm_string_buffer.c<gh_stars>0 #include <stdlib.h> #include <math.h> #include <assert.h> #include <stdio.h> #include <string.h> #include <inttypes.h> #include "spvm_string_buffer.h" #include "spvm_util_allocator.h" SPVM_STRING_BUFFER* SPVM_STRING_BUFFER_new(int32_t capacity) { ...
motxx/SPVM
lib/SPVM/Builder/include/spvm_field_access.h
<reponame>motxx/SPVM #ifndef SPVM_FIELD_ACCESS_H #define SPVM_FIELD_ACCESS_H #include "spvm_base.h" struct SPVM_field_access { SPVM_OP* op_term; SPVM_OP* op_name; SPVM_FIELD* field; int32_t constant_pool_id; int32_t inline_expansion; }; SPVM_FIELD_ACCESS* SPVM_FIELD_ACCESS_new(SPVM_COMPILER* compiler); #e...
motxx/SPVM
lib/SPVM/Builder/include/spvm_array_field_access.h
#ifndef SPVM_ARRAY_FIELD_ACCESS_H #define SPVM_ARRAY_FIELD_ACCESS_H #include "spvm_base.h" struct SPVM_array_field_access { SPVM_FIELD* field; }; SPVM_ARRAY_FIELD_ACCESS* SPVM_ARRAY_FIELD_ACCESS_new(SPVM_COMPILER* compiler); #endif
motxx/SPVM
lib/SPVM/Builder/include/spvm_check_ast_info.h
#ifndef SPVM_CHECK_AST_INFO_H #define SPVM_CHECK_AST_INFO_H #include "spvm_base.h" struct SPVM_check_ast_info { // Package SPVM_PACKAGE* package; // Subroutine SPVM_SUB* sub; // My stack SPVM_LIST* my_stack; // Block my base stack SPVM_LIST* block_my_base_stack; // Switch stack SPVM_LI...
motxx/SPVM
lib/SPVM/Builder/src/spvm_package_var.c
<reponame>motxx/SPVM<filename>lib/SPVM/Builder/src/spvm_package_var.c #include <assert.h> #include <string.h> #include "spvm_package_var.h" #include "spvm_compiler.h" #include "spvm_compiler_allocator.h" SPVM_PACKAGE_VAR* SPVM_PACKAGE_VAR_new(SPVM_COMPILER* compiler) { (void)compiler; return SPVM_COMPILER_ALLO...
motxx/SPVM
lib/SPVM/Builder/src/spvm_use.c
#include "spvm_use.h" #include "spvm_list.h" #include "spvm_compiler_allocator.h" #include "spvm_compiler.h" SPVM_USE* SPVM_USE_new(SPVM_COMPILER* compiler) { SPVM_USE* use = SPVM_COMPILER_ALLOCATOR_safe_malloc_zero(compiler, sizeof(SPVM_USE)); return use; }
motxx/SPVM
lib/SPVM/Builder/src/spvm_csource_builder_precompile.c
<reponame>motxx/SPVM #include <string.h> #include <stdint.h> #include <stdlib.h> #include <stdio.h> #include <assert.h> #include <stddef.h> #include "spvm_native.h" #include "spvm_list.h" #include "spvm_hash.h" #include "spvm_csource_builder_precompile.h" #include "spvm_string_buffer.h" #include "spvm_runtime.h" #i...
motxx/SPVM
lib/SPVM/Builder/include/spvm_op.h
#ifndef SPVM_OP_H #define SPVM_OP_H #include "spvm_base.h" /* Operation id */ enum { SPVM_OP_C_ID_IF, SPVM_OP_C_ID_UNLESS, SPVM_OP_C_ID_ELSIF, SPVM_OP_C_ID_ELSE, SPVM_OP_C_ID_FOR, SPVM_OP_C_ID_WHILE, SPVM_OP_C_ID_NULL, SPVM_OP_C_ID_LIST, SPVM_OP_C_ID_PUSHMAR...
motxx/SPVM
lib/SPVM/FileHandle.c
#include "spvm_native.h" #include <stdio.h> int32_t SPVM_NATIVE_SPVM__FileHandle__DESTROY(SPVM_ENV* env, SPVM_VALUE* stack) { // File handle void* ofh = stack[0].oval; if (ofh != NULL) { FILE* fh = (FILE*)env->pointer(env, ofh); if (fh) { int32_t ret = fclose(fh); env->set_pointer(env, ofh, ...
motxx/SPVM
lib/SPVM/Builder/include/spvm_hash_func.h
#ifndef SPVM_HASH_FUNC_H #define SPVM_HASH_FUNC_H #include "spvm_base.h" // Hash function int32_t SPVM_HASH_FUNC_calc_hash_for_index(const char* str, int32_t len); #endif
motxx/SPVM
lib/SPVM/Builder/src/spvm_hash_func.c
#include <string.h> #include <stdlib.h> #include <assert.h> #include "spvm_hash_func.h" int32_t SPVM_HASH_FUNC_calc_hash_for_index(const char* str, int32_t len) { assert(len >= 0); const char* str_tmp = str; int32_t hash = 5381; while (len--) { hash = ((hash << 5) + hash) + (uint8_t) *str_tmp++; }...
motxx/SPVM
lib/SPVM/Builder/src/spvm_package_var_access.c
<gh_stars>0 #include "spvm_package_var_access.h" #include "spvm_compiler_allocator.h" #include "spvm_compiler.h" SPVM_PACKAGE_VAR_ACCESS* SPVM_PACKAGE_VAR_ACCESS_new(SPVM_COMPILER* compiler) { return SPVM_COMPILER_ALLOCATOR_safe_malloc_zero(compiler, sizeof(SPVM_PACKAGE_VAR_ACCESS)); }
motxx/SPVM
lib/SPVM/Builder/src/spvm_opcode_builder.c
<filename>lib/SPVM/Builder/src/spvm_opcode_builder.c #include <string.h> #include <stdint.h> #include <stdlib.h> #include <stdio.h> #include <assert.h> #include "spvm_compiler.h" #include "spvm_opcode_builder.h" #include "spvm_opcode.h" #include "spvm_opcode_array.h" #include "spvm_constant.h" #include "spvm_op.h" #i...
motxx/SPVM
lib/SPVM/Builder/src/spvm_util_allocator.c
<filename>lib/SPVM/Builder/src/spvm_util_allocator.c #include <stdlib.h> #include <stdio.h> #include <stdint.h> #include <assert.h> #include <string.h> #include "spvm_util_allocator.h" void* SPVM_UTIL_ALLOCATOR_safe_malloc(size_t byte_size) { if (byte_size < 1) { fprintf(stderr, "Failed to allocate memory. S...
motxx/SPVM
lib/SPVM/Builder/include/spvm_enumeration.h
#ifndef SPVM_ENUMERATION_H #define SPVM_ENUMERATION_H #include "spvm_base.h" struct SPVM_enumeration { SPVM_LIST* enumeration_values; }; SPVM_ENUMERATION* SPVM_ENUMERATION_new(SPVM_COMPILER* compiler); #endif
motxx/SPVM
lib/SPVM/Builder/include/spvm_use.h
#ifndef SPVM_USE_H #define SPVM_USE_H #include "spvm_base.h" struct SPVM_use { SPVM_OP* op_type; SPVM_LIST* sub_names; int32_t is_require; int32_t load_fail; }; SPVM_USE* SPVM_USE_new(SPVM_COMPILER* compiler); #endif
motxx/SPVM
lib/SPVM/Builder/include/spvm_descriptor.h
#ifndef SPVM_DESCRIPTOR_H #define SPVM_DESCRIPTOR_H #include "spvm_base.h" enum { SPVM_DESCRIPTOR_C_ID_INTERFACE_T, SPVM_DESCRIPTOR_C_ID_VALUE_T, SPVM_DESCRIPTOR_C_ID_POINTER_T, SPVM_DESCRIPTOR_C_ID_NATIVE, SPVM_DESCRIPTOR_C_ID_PRECOMPILE, SPVM_DESCRIPTOR_C_ID_PUBLIC, SPVM_DESCRIPTOR_C_ID_PRIVATE, SPV...
motxx/SPVM
lib/SPVM/Builder/src/spvm_case_info.c
<reponame>motxx/SPVM #include "spvm_case_info.h" #include "spvm_compiler_allocator.h" #include "spvm_compiler.h" SPVM_CASE_INFO* SPVM_CASE_INFO_new(SPVM_COMPILER* compiler) { SPVM_CASE_INFO* case_info = SPVM_COMPILER_ALLOCATOR_safe_malloc_zero(compiler, sizeof(SPVM_CASE_INFO)); return case_info; }
motxx/SPVM
lib/SPVM/Builder/include/spvm_limit.h
#ifndef SPVM_LIMIT_H #define SPVM_LIMIT_H #include "spvm_base.h" enum { // OP code operand max value SPVM_LIMIT_C_OPCODE_OPERAND_VALUE_MAX = UINT16_MAX, // valut_t field count max SPVM_LIMIT_C_VALUE_T_FIELDS_LENGTH_MAX = 16, // valut_t field count max SPVM_LIMIT_C_STACK_MAX = UINT8_MAX, }; #endif
motxx/SPVM
lib/SPVM/Builder/src/spvm_opcode_array.c
<filename>lib/SPVM/Builder/src/spvm_opcode_array.c #include <string.h> #include <stdlib.h> #include <assert.h> #include "spvm_opcode_array.h" #include "spvm_util_allocator.h" #include "spvm_compiler.h" #include "spvm_opcode.h" SPVM_OPCODE_ARRAY* SPVM_OPCODE_ARRAY_new(SPVM_COMPILER* compiler) { (void)compiler; ...
motxx/SPVM
lib/SPVM/Builder/include/spvm_utf8proc.h
/* * Copyright (c) 2018 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, and other contributors. * Copyright (c) 2009 Public Software Group e. V., Berlin, Germany * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to de...
motxx/SPVM
lib/SPVM/Builder/src/spvm_constant_pool.c
<gh_stars>0 #include <string.h> #include <stdlib.h> #include <assert.h> #include "spvm_constant_pool.h" #include "spvm_util_allocator.h" #include "spvm_list.h" #include "spvm_op.h" #include "spvm_hash.h" #include "spvm_native.h" SPVM_CONSTANT_POOL* SPVM_CONSTANT_POOL_new(int32_t capacity) { SPVM_CONSTANT_POOL* c...
motxx/SPVM
solo/t/spvm_t_list.c
#include <stdio.h> #include "../../spvm_list.h" #define OK(condition) \ if (condition) {\ printf("OK\n");\ }\ else {\ printf("Not OK at line %d\n", __LINE__);\ } int main() { // Array - new and free { SPVM_LIST* list = SPVM_LIST_new(10); // capacity OK(list->capacity == 10); ...
motxx/SPVM
lib/SPVM/Builder/include/spvm_yacc_util.h
#ifndef SPVM_YACC_UTIL_H #define SPVM_YACC_UTIL_H #include "spvm_base.h" union SPVM_yystype { SPVM_OP* opval; }; #define YYSTYPE SPVM_YYSTYPE #define YYPRINT(file, type, value) SPVM_yyprint(file, type, value) extern int SPVM_yydebug; int SPVM_yyparse(SPVM_COMPILER* compiler); void SPVM_yyerror(SPVM_COMPILER* com...
motxx/SPVM
lib/SPVM/Builder/include/spvm_op_checker.h
#ifndef SPVM_OP_CHECKER_H #define SPVM_OP_CHECKER_H #include "spvm_base.h" void SPVM_OP_CHECKER_check(SPVM_COMPILER* compiler); void SPVM_OP_CHECKER_resolve_types(SPVM_COMPILER* compiler); void SPVM_OP_CHECKER_resolve_call_sub(SPVM_COMPILER* compiler, SPVM_OP* op_call_sub, SPVM_OP* op_package_current); void SPVM_OP_...
motxx/SPVM
lib/SPVM/Builder/include/spvm_base.h
#ifndef SPVM_BASE_H #define SPVM_BASE_H #include <stdint.h> #include <stdlib.h> // spvm_runtime_weaken_backref.h struct SPVM_runtime_weaken_backref; typedef struct SPVM_runtime_weaken_backref SPVM_RUNTIME_WEAKEN_BACKREF; // spvm_constant_pool.h struct SPVM_constant_pool; typedef struct SPVM_constant_pool SPVM_CONSTA...
motxx/SPVM
lib/SPVM/Builder/src/spvm_enumeration.c
#include "spvm_enumeration.h" #include "spvm_compiler_allocator.h" #include "spvm_compiler.h" SPVM_ENUMERATION* SPVM_ENUMERATION_new(SPVM_COMPILER* compiler) { return SPVM_COMPILER_ALLOCATOR_safe_malloc_zero(compiler, sizeof(SPVM_ENUMERATION)); }
motxx/SPVM
solo/main.c
<gh_stars>0 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <inttypes.h> #include <assert.h> #include "spvm_compiler.h" #include "spvm_hash.h" #include "spvm_list.h" #include "spvm_runtime.h" #include "spvm_op.h" #include "spvm_sub.h" #include "spvm_util_allocator.h" #include "spvm_runtime_sub.h" #...
motxx/SPVM
lib/SPVM/Builder/include/spvm_switch_info.h
#ifndef SPVM_SWITCH_INFO_H #define SPVM_SWITCH_INFO_H #include "spvm_base.h" enum { SPVM_SWITCH_INFO_C_ID_TABLE_SWITCH, SPVM_SWITCH_INFO_C_ID_LOOKUP_SWITCH, }; // Parser information struct SPVM_switch_info { SPVM_LIST* case_infos; SPVM_OP* op_default; int32_t id; int32_t default_opcode_rel_index; int32...
motxx/SPVM
lib/SPVM/Builder/src/spvm_opcode.c
<reponame>motxx/SPVM<gh_stars>0 #include "spvm_opcode.h" #include "spvm_compiler.h" #include "spvm_compiler_allocator.h" const char* const SPVM_OPCODE_C_ID_NAMES[] = { "WIDE", "VALUE_ARRAY_FIELD_FETCH_BYTE", "VALUE_ARRA...
motxx/SPVM
lib/SPVM/Builder/src/spvm_yacc_util.c
<reponame>motxx/SPVM #include <stdlib.h> #include <string.h> #include <inttypes.h> #include <assert.h> #include "spvm_compiler.h" #include "spvm_yacc_util.h" #include "spvm_compiler_allocator.h" #include "spvm_util_allocator.h" #include "spvm_yacc.h" #include "spvm_constant.h" #include "spvm_var.h" #include "spvm_op....
motxx/SPVM
solo/t/spvm_t_hash.c
#include <stdio.h> #include <stdint.h> #include <string.h> #include <stdlib.h> #include "../../spvm_hash.h" #include "../../spvm_hash_entry.h" #include "../../spvm_hash_func.h" #define OK(condition) \ if (condition) {\ printf("OK\n");\ }\ else {\ printf("Not OK at line %d\n", __LINE__);\ } int main()...
motxx/SPVM
lib/SPVM/Builder/src/spvm_field_access.c
#include "spvm_field_access.h" #include "spvm_compiler_allocator.h" #include "spvm_compiler.h" SPVM_FIELD_ACCESS* SPVM_FIELD_ACCESS_new(SPVM_COMPILER* compiler) { return SPVM_COMPILER_ALLOCATOR_safe_malloc_zero(compiler, sizeof(SPVM_FIELD_ACCESS)); }
motxx/SPVM
lib/SPVM/Builder/include/spvm_package.h
#ifndef SPVM_PACKAGE_H #define SPVM_PACKAGE_H #include "spvm_base.h" enum { SPVM_PACKAGE_C_CATEGORY_CLASS, SPVM_PACKAGE_C_CATEGORY_INTERFACE, SPVM_PACKAGE_C_CATEGORY_VALUE, }; enum { SPVM_PACKAGE_C_FLAG_POINTER = 1, SPVM_PACKAGE_C_FLAG_ANON_SUB_PACKAGE = 2, SPVM_PACKAGE_C_FLAG_PRIVATE = 4, SPVM_PACKAGE...
motxx/SPVM
lib/SPVM/Builder/include/spvm_hash_entry.h
#ifndef SPVM_HASH_ENTRY_H #define SPVM_HASH_ENTRY_H #include "spvm_base.h" // Hash entry struct SPVM_hash_entry { void* value; int32_t next_index; int32_t key_index; }; #endif
motxx/SPVM
lib/SPVM/Builder/include/spvm_yacc.h
/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU...
motxx/SPVM
lib/SPVM/Builder/include/spvm_hash.h
<reponame>motxx/SPVM #ifndef SPVM_HASH_H #define SPVM_HASH_H #include "spvm_base.h" // Hash table struct SPVM_hash { int32_t* table; char* key_buffer; SPVM_HASH_ENTRY* entries; int32_t table_capacity; int32_t entries_capacity; int32_t entries_length; int32_t key_buffer_capacity; int32_t key_buffer_len...
motxx/SPVM
t/default/lib/TestCase/Extension2.c
<gh_stars>0 #include <spvm_native.h> int32_t SPVM_NATIVE_TestCase__Extension2__mul(SPVM_ENV* env, SPVM_VALUE* args) { (void)env; (void)args; int32_t total = args[0].ival * args[1].ival; args[0].ival = total; return 0; }
motxx/SPVM
lib/SPVM/Builder/src/spvm_call_sub.c
#include "spvm_call_sub.h" #include "spvm_compiler_allocator.h" #include "spvm_compiler.h" SPVM_CALL_SUB* SPVM_CALL_SUB_new(SPVM_COMPILER* compiler) { return SPVM_COMPILER_ALLOCATOR_safe_malloc_zero(compiler, sizeof(SPVM_CALL_SUB)); }
motxx/SPVM
lib/SPVM/Builder/include/spvm_unicode.h
#ifndef SPVM_UNICODE_H #define SPVM_UNICODE_H #include "spvm_base.h" /** Memory could not be allocated. */ #define SPVM_UNICODE_ERROR_NOMEM -1 /** The given string is too long to be processed. */ #define SPVM_UNICODE_ERROR_OVERFLOW -2 /** The given string is not a legal UTF-8 string. */ #define SPVM_UNICODE_ERROR_INV...
motxx/SPVM
lib/SPVM/Builder/src/spvm_type.c
#include <stdlib.h> #include <string.h> #include <assert.h> #include "spvm_compiler.h" #include "spvm_type.h" #include "spvm_list.h" #include "spvm_op.h" #include "spvm_compiler_allocator.h" #include "spvm_hash.h" #include "spvm_yacc_util.h" #include "spvm_package.h" #include "spvm_field.h" #include "spvm_limit.h" #in...
motxx/SPVM
lib/SPVM/Builder/include/spvm_constant.h
#ifndef SPVM_CONSTANT_H #define SPVM_CONSTANT_H #include "spvm_base.h" #include "spvm_native.h" struct SPVM_constant { SPVM_OP* op_constant; SPVM_TYPE* type; SPVM_VALUE value; int32_t string_length; int32_t constant_pool_id; }; SPVM_CONSTANT* SPVM_CONSTANT_new(SPVM_COMPILER* compiler); SPVM_CONSTANT* SPVM_...
motxx/SPVM
lib/SPVM/Builder/src/spvm_toke.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <errno.h> #include <assert.h> #include <inttypes.h> #include "spvm_compiler.h" #include "spvm_toke.h" #include "spvm_yacc_util.h" #include "spvm_yacc.h" #include "spvm_op.h" #include "spvm_compiler_allocator.h" #include "spvm_util_...