use hashmap in constants buffer to speed up translation time with large files

This commit is contained in:
2025-06-30 17:56:32 +01:00
parent 31f38d8ba4
commit 3adecb4eba
18 changed files with 1120882 additions and 83 deletions

View File

@@ -1,6 +1,6 @@
#include "object.h"
#include "../../memory.h"
#include "../runtime.h"
#include "../../hash_data/hash_data.h"
#include <stdbool.h>
#include <string.h>
#include "type/type.h"
@@ -26,11 +26,11 @@ ArgonObject* init_argon_class(char*name) {
object->type = TYPE_OBJECT;
object->self = NULL;
object->baseObject = ARGON_TYPE;
object->fields = createHashmap();
object->fields = createHashmap_GC();
memset(&object->value, 0, sizeof(object->value));
return object;
}
void add_field(ArgonObject*target, char* name, ArgonObject *object) {
hashmap_insert(target->fields, siphash64_bytes(name, strlen(name)),name, object, 0);
hashmap_insert_GC(target->fields, siphash64_bytes(name, strlen(name), siphash_key),name, object, 0);
}