]> Nishi Git Mirror - gwion.git/commitdiff
:art: global Call optimization
authorfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 20 Jan 2019 20:20:16 +0000 (21:20 +0100)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 20 Jan 2019 20:20:16 +0000 (21:20 +0100)
src/emit/emit.c

index d9b357c56beb4185bedd61fd67d31527fe667f2d..67b1648b9635668e29af34328b464c7042ffc132 100644 (file)
@@ -649,6 +649,12 @@ ANN static m_bool emit_exp_dur(const Emitter emit, const Exp_Dur* dur) { GWDEBUG
 }
 
 static inline m_bool push_func_code(const Emitter emit, const Func f) {
+  const Instr back = (Instr)vector_back(&emit->code->instr);
+  if(back->execute == RegPushBase) {
+    back->execute = RegPushImm0;
+    back->m_val = (m_uint)f->code;
+    return GW_OK;
+  }
   const Instr instr = emit_add_instr(emit, RegPushPtr);
   return !!(instr->m_val = (m_uint)f->code);
 }