improve performance massively from 0.9 seconds to 0.38 seconds :)

This commit is contained in:
William Bell
2025-09-01 20:25:47 +01:00
parent 4f91bf48f3
commit 19268f3070
24 changed files with 479 additions and 369 deletions

View File

@@ -9,27 +9,59 @@
#include "../internals/hashmap/hashmap.h"
#include "../runtime.h"
#include <stdbool.h>
#include <string.h>
typedef enum {
__base__,
__class__,
__name__,
__add__,
__string__,
__subtract__,
__multiply__,
__division__,
__new__,
__init__,
__boolean__,
__get_attr__,
__binding__,
__function__,
field__address,
__call__,
__number__,
field_log,
BUILT_IN_FIELDS_COUNT
} built_in_fields;
void init_built_in_field_hashes();
extern ArgonObject *BASE_CLASS;
typedef struct ArgonObject ArgonObject;
ArgonObject *new_object();
void add_field(ArgonObject *target, char *name, ArgonObject *object);
void add_builtin_field(ArgonObject *target, built_in_fields field,
ArgonObject *object);
void add_field(ArgonObject *target, char *name, uint64_t hash,
ArgonObject *object);
ArgonObject *bind_object_to_function(ArgonObject *object,
ArgonObject *function);
ArgonObject *get_field_for_class_l(ArgonObject *target, char *name,
size_t length, ArgonObject *binding_object);
uint64_t hash, size_t length,
ArgonObject *binding_object);
ArgonObject *get_field_l(ArgonObject *target, char *name, size_t length,
bool recursive, bool disable_method_wrapper);
ArgonObject *get_field_l(ArgonObject *target, char *name, uint64_t hash,
size_t length, bool recursive,
bool disable_method_wrapper);
ArgonObject *get_field_for_class(ArgonObject *target, char *name,
ArgonObject *binding_object);
ArgonObject *get_builtin_field_for_class(ArgonObject *target,
built_in_fields field,
ArgonObject *binding_object);
ArgonObject *get_field(ArgonObject *target, char *name, bool recursive,
bool disable_method_wrapper);
ArgonObject *get_builtin_field(ArgonObject *target, built_in_fields field,
bool recursive, bool disable_method_wrapper);
#endif // OBJECT_H