improve performance massively from 0.9 seconds to 0.38 seconds :)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user