diff options
author | Mike Pall <mike> | 2009-12-08 20:35:29 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2009-12-08 20:35:29 +0100 |
commit | 3f1f9e11f4f699ae94182d4cba158092f434a7f6 (patch) | |
tree | 88fbb674a21a1d554d4b1ee9d4ef2c5fed6a1d88 /src/lj_opt_mem.c | |
parent | 5287b9326479ea2b7dddd6f642673e58e5a7f354 (diff) | |
download | luajit2-3f1f9e11f4f699ae94182d4cba158092f434a7f6.tar.gz |
Fast forward to sync public repo.
Compile math.sinh(), math.cosh(), math.tanh() and math.random().
Compile various io.*() functions.
Drive the GC forward on string allocations in the parser.
Improve KNUM fuse vs. load heuristics.
Add abstract C call handling to IR.
Diffstat (limited to 'src/lj_opt_mem.c')
-rw-r--r-- | src/lj_opt_mem.c | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/src/lj_opt_mem.c b/src/lj_opt_mem.c index 94fc4ad8..882ba6c5 100644 --- a/src/lj_opt_mem.c +++ b/src/lj_opt_mem.c @@ -307,14 +307,7 @@ TRef LJ_FASTCALL lj_opt_fwd_uload(jit_State *J) conflict: /* Try to find a matching load. Below the conflicting store, if any. */ - ref = J->chain[IR_ULOAD]; - while (ref > lim) { - IRIns *load = IR(ref); - if (load->op1 == uref) - return ref; /* Load forwarding. */ - ref = load->prev; - } - return EMITFOLD; /* Conflict or no match. */ + return lj_opt_cselim(J, lim); } /* USTORE elimination. */ @@ -405,14 +398,7 @@ TRef LJ_FASTCALL lj_opt_fwd_fload(jit_State *J) conflict: /* Try to find a matching load. Below the conflicting store, if any. */ - ref = J->chain[IR_FLOAD]; - while (ref > lim) { - IRIns *load = IR(ref); - if (load->op1 == oref && load->op2 == fid) - return ref; /* Load forwarding. */ - ref = load->prev; - } - return EMITFOLD; /* Otherwise we have a conflict or simply no match. */ + return lj_opt_cselim(J, lim); } /* FSTORE elimination. */ @@ -458,10 +444,10 @@ doemit: return EMITFOLD; /* Otherwise we have a conflict or simply no match. */ } -/* -- TLEN forwarding ----------------------------------------------------- */ +/* -- Forwarding of lj_tab_len -------------------------------------------- */ /* This is rather simplistic right now, but better than nothing. */ -TRef LJ_FASTCALL lj_opt_fwd_tlen(jit_State *J) +TRef LJ_FASTCALL lj_opt_fwd_tab_len(jit_State *J) { IRRef tab = fins->op1; /* Table reference. */ IRRef lim = tab; /* Search limit. */ @@ -484,14 +470,7 @@ TRef LJ_FASTCALL lj_opt_fwd_tlen(jit_State *J) } /* Try to find a matching load. Below the conflicting store, if any. */ - ref = J->chain[IR_TLEN]; - while (ref > lim) { - IRIns *tlen = IR(ref); - if (tlen->op1 == tab) - return ref; /* Load forwarding. */ - ref = tlen->prev; - } - return EMITFOLD; /* Otherwise we have a conflict or simply no match. */ + return lj_opt_cselim(J, lim); } /* -- ASTORE/HSTORE previous type analysis -------------------------------- */ |