<commit_before>#include "Linker.h"
#include "StdLib.h"
#include "BinaryCache.h"
#include"InstructionTreeRegVmLowerGraph.h"

#ifdef NULLC_AUTOBINDING
	#if defined(__linux)
		#include <dlfcn.h>
	#else
		#define WIN32_LEAN_AND_MEAN
		#include <windows.h>
	#endif
#endif

namespace NULLC
{
	extern bool enableLogFiles;
}

Linker::Linker(): exTypes(128), exTypeExtra(256), exVariables(128), exFunctions(256), exLocals(1024), exSymbols(8192), vmJumpTargets(1024), regVmJumpTargets(1024)
{
	globalVarSize = 0;

	vmOffsetToGlobalCode = 0;

	typeMap.init();
	funcMap.init();

	fptrUpdater = NULL;

	debugOutputIndent = 0;

	NULLC::SetLinker(this);
}

Linker::~Linker()
{
	CleanCode();
}

void Linker::CleanCode()
{
	exTypes.clear();
	exTypeExtra.clear();
	exVariables.clear();
	exFunctions.clear();
	exFunctionExplicitTypeArrayOffsets.clear();
	exFunctionExplicitTypes.clear();
	exSymbols.clear();
	exLocals.clear();
	exModules.clear();
	exSource.clear();
	exDependencies.clear();

	exVmCode.clear();
	exVmSourceInfo.clear();

	exRegVmCode.clear();
	exRegVmSourceInfo.clear();
	exRegVmExecCount.clear();
	memset(exRegVmInstructionExecCount.data, 0, sizeof(exRegVmInstructionExecCount));

#ifdef NULLC_LLVM_SUPPORT
	llvmModuleSizes.clear();
	llvmModuleCodes.clear();

	llvmTypeRemapSizes.clear();
	llvmTypeRemapOffsets.clear();
	llvmTypeRemapValues.clear();

	llvmFuncRemapSizes.clear();
	llvmFuncRemapOffsets.clear();
	llvmFuncRemapValues.clear();
#endif

	vmJumpTargets.clear();

	vmOffsetToGlobalCode = 0;

	regVmJumpTargets.clear();<commit_msg>Register VM: clear constant list<commit_after>#include "Linker.h"
#include "StdLib.h"
#include "BinaryCache.h"
#include"InstructionTreeRegVmLowerGraph.h"

#ifdef NULLC_AUTOBINDING
	#if defined(__linux)
		#include <dlfcn.h>
	#else
		#define WIN32_LEAN_AND_MEAN
		#include <windows.h>
	#endif
#endif

namespace NULLC
{
	extern bool enableLogFiles;
}

Linker::Linker(): exTypes(128), exTypeExtra(256), exVariables(128), exFunctions(256), exLocals(1024), exSymbols(8192), vmJumpTargets(1024), regVmJumpTargets(1024)
{
	globalVarSize = 0;

	vmOffsetToGlobalCode = 0;

	typeMap.init();
	funcMap.init();

	fptrUpdater = NULL;

	debugOutputIndent = 0;

	NULLC::SetLinker(this);
}

Linker::~Linker()
{
	CleanCode();
}

void Linker::CleanCode()
{
	exTypes.clear();
	exTypeExtra.clear();
	exVariables.clear();
	exFunctions.clear();
	exFunctionExplicitTypeArrayOffsets.clear();
	exFunctionExplicitTypes.clear();
	exSymbols.clear();
	exLocals.clear();
	exModules.clear();
	exSource.clear();
	exDependencies.clear();

	exVmCode.clear();
	exVmSourceInfo.clear();

	exRegVmCode.clear();
	exRegVmSourceInfo.clear();
	exRegVmExecCount.clear();
	exRegVmConstants.clear();
	memset(exRegVmInstructionExecCount.data, 0, sizeof(exRegVmInstructionExecCount));

#ifdef NULLC_LLVM_SUPPORT
	llvmModuleSizes.clear();
	llvmModuleCodes.clear();

	llvmTypeRemapSizes.clear();
	llvmTypeRemapOffsets.clear();
	llvmTypeRemapValues.clear();

	llvmFuncRemapSizes.clear();
	llvmFuncRemapOffsets.clear();
	llvmFuncRemapValues.clear();
#endif

	vmJumpTargets.clear();

	vmOffsetToGlobalCode = 0;

	regVmJumpTargets.clear();
{'fraction_non_alphanumeric': 0.14253683536194747, 'fraction_numerical': 0.02242152466367713, 'mean_word_length': 6.926395939086294, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6152088', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1181, 'n_words': 170}