summaryrefslogtreecommitdiff
path: root/src/lib_jit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib_jit.c')
-rw-r--r--src/lib_jit.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/lib_jit.c b/src/lib_jit.c
index 4da079c8..0728fc3a 100644
--- a/src/lib_jit.c
+++ b/src/lib_jit.c
@@ -437,9 +437,6 @@ static int jitopt_flag(jit_State *J, const char *str)
437 return 0; /* No match. */ 437 return 0; /* No match. */
438} 438}
439 439
440/* Forward declaration. */
441static void jit_init_hotcount(jit_State *J);
442
443/* Parse optimization parameter. */ 440/* Parse optimization parameter. */
444static int jitopt_param(jit_State *J, const char *str) 441static int jitopt_param(jit_State *J, const char *str)
445{ 442{
@@ -453,7 +450,7 @@ static int jitopt_param(jit_State *J, const char *str)
453 lj_str_numconv(&str[len+1], &tv)) { 450 lj_str_numconv(&str[len+1], &tv)) {
454 J->param[i] = lj_num2int(tv.n); 451 J->param[i] = lj_num2int(tv.n);
455 if (i == JIT_P_hotloop) 452 if (i == JIT_P_hotloop)
456 jit_init_hotcount(J); 453 lj_dispatch_init_hotcount(J2G(J));
457 return 1; /* Ok. */ 454 return 1; /* Ok. */
458 } 455 }
459 lst += 1+len; 456 lst += 1+len;
@@ -498,16 +495,6 @@ JIT_PARAMDEF(JIT_PARAMINIT)
498#undef JIT_PARAMINIT 495#undef JIT_PARAMINIT
499 0 496 0
500}; 497};
501
502/* Initialize hotcount table. */
503static void jit_init_hotcount(jit_State *J)
504{
505 HotCount start = (HotCount)J->param[JIT_P_hotloop];
506 HotCount *hotcount = J2GG(J)->hotcount;
507 uint32_t i;
508 for (i = 0; i < HOTCOUNT_SIZE; i++)
509 hotcount[i] = start;
510}
511#endif 498#endif
512 499
513/* Arch-dependent CPU detection. */ 500/* Arch-dependent CPU detection. */
@@ -570,7 +557,6 @@ static void jit_init(lua_State *L)
570 jit_State *J = L2J(L); 557 jit_State *J = L2J(L);
571 J->flags = flags | JIT_F_ON | JIT_F_OPT_DEFAULT; 558 J->flags = flags | JIT_F_ON | JIT_F_OPT_DEFAULT;
572 memcpy(J->param, jit_param_default, sizeof(J->param)); 559 memcpy(J->param, jit_param_default, sizeof(J->param));
573 jit_init_hotcount(J);
574 lj_dispatch_update(G(L)); 560 lj_dispatch_update(G(L));
575#else 561#else
576 UNUSED(flags); 562 UNUSED(flags);