From: uis Date: Mon, 13 May 2024 15:10:42 +0000 (+0300) Subject: Combine IF and GOTO handlers X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c5073cb2c5352c1d2c15d2a551b602b442d05ebf;p=xonotic%2Fdarkplaces.git Combine IF and GOTO handlers --- diff --git a/prvm_execprogram.h b/prvm_execprogram.h index f60f74cc..dedde967 100644 --- a/prvm_execprogram.h +++ b/prvm_execprogram.h @@ -362,6 +362,7 @@ // although mostly unneeded, thanks to the only float being false being 0x0 and 0x80000000 (negative zero) // and entity, string, field values can never have that value { + HANDLE_OPCODE(INS_GOTO): ADVANCE_PROFILE_BEFORE_JUMP(); st = cached_statements + st->jumpabsolute - 1; // offset the st++ startst = st; @@ -375,19 +376,6 @@ } DISPATCH_OPCODE(); - HANDLE_OPCODE(INS_GOTO): - ADVANCE_PROFILE_BEFORE_JUMP(); - st = cached_statements + st->jumpabsolute - 1; // offset the st++ - startst = st; - // no bounds check needed, it is done when loading progs - if (++jumpcount == 10000000 && prvm_runawaycheck) - { - prog->xstatement = st - cached_statements; - PRVM_Profile(prog, 1<<30, 0.01, 0); - prog->error_cmd("%s runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", prog->name, jumpcount); - } - DISPATCH_OPCODE(); - HANDLE_OPCODE(INS_CALL): #ifdef PRVMTIMEPROFILING tm = Sys_DirtyTime();