fixed a minor bug causing SSA to be super slow.

This commit is contained in:
Mphatso Raymond Mataka
2025-02-22 01:58:23 -08:00
parent e1ca8ec546
commit 47ca262e27
2 changed files with 9 additions and 6 deletions
+3 -3
View File
@@ -45,9 +45,9 @@ uint64_t guest_process::jit_function(guest_process* process, uint64_t guest_func
{
case interpreted:
{
if (function_to_execute.times_executed == 10)
if (function_to_execute.times_executed == 3)
{
guest_function_store::request_retranslate_function(&process->guest_functions,guest_function_address, level_three, translator_request);
guest_function_store::request_retranslate_function(&process->guest_functions,guest_function_address, level_one, translator_request);
}
return guest_process::interperate_function(process, guest_function_address, arm_context, nullptr, true);
@@ -55,7 +55,7 @@ uint64_t guest_process::jit_function(guest_process* process, uint64_t guest_func
case level_one:
{
if (function_to_execute.times_executed == 50 && !process->debug_mode)
if (function_to_execute.times_executed == 10 && !process->debug_mode)
{
guest_function_store::request_retranslate_function(&process->guest_functions,guest_function_address, level_three, translator_request);
}
+6 -3
View File
@@ -134,7 +134,7 @@ static bool look_for_and_connect_global_usage(ssa_node* look_at_node,global_usag
return false;
}
static void find_register_in_parents(ssa_node* look_at_node, uint64_t look_for_register, global_usage_location* to_connect, std::unordered_set<ssa_node*>* visited, int stack = 0)
static void find_register_in_parents(ssa_node* look_at_node, uint64_t look_for_register, global_usage_location* to_connect, std::unordered_set<ssa_node*>* visited)
{
if (in_set(visited, look_at_node))
{
@@ -143,11 +143,14 @@ static void find_register_in_parents(ssa_node* look_at_node, uint64_t look_for_r
visited->insert(look_at_node);
look_for_and_connect_global_usage(look_at_node,to_connect, look_for_register, look_at_node->declarations_global_info.size() - 1);
if (look_for_and_connect_global_usage(look_at_node,to_connect, look_for_register, look_at_node->declarations_global_info.size() - 1))
{
return;
}
for (auto i : look_at_node->inlets)
{
find_register_in_parents(i, look_for_register, to_connect, visited, stack + 1);
find_register_in_parents(i, look_for_register, to_connect, visited);
}
}