Commit Graph

13 Commits

Author SHA1 Message Date
Edwin Smith
d7a89e77b5 Add LIR_jtbl instruction, and patch up lirasm to remove LIR_ji (bug 465582 r=nnethercote+, rreitmai+)
new opcode: LIR_jtbl.  jtbl takes a uint32_t index and a table of label
references (LIns**), representing a jump to one of the labels.

the index must be in range (range checking is not included in the opcode).

the table is allocated in memory at least as long lived as the LIR; this is
accomplished by doing the allocation from the same Allocator used by LirBuffer.

In the x86 backend, this is implemented with a simple jmp [R*4+ADDR] where ADDR
is the address of the table.  I added a new dataAllocator (Allocator&)
parameter to Assembler, which is used for allocating data along with code (data
& code have same lifetime).  The x86 backend allocates the final table of
addresses from this allocator and embeds the pointer to the table in code.

In other backends more than one instruction must be used due to limited range
of the constant part of the addressing mode (ppc, arm), or non-support for
full-range pc-relative indexing (x64, ppc64).

Anyone generating LIR code for use with LIR_jtbl must also generate a
LIR_regfence instruction after each label reachable by a forwards edge
from LIR_jtbl.  This is to workaround the register allocator's inability
to merge register states between 2 or more pre-existing targets.  LIR_regfence
is not required for backwards edges.

--HG--
extra : convert_revision : ee709eaaa30f720f77ab863ba4c9e6d10d69982b
2009-11-11 14:38:12 -05:00
Graydon Hoare
53519f8859 Bug 527178 - Improve valid-displacement checks, r=edwsmith, r=dvander.
--HG--
extra : rebase_source : b95743173b293bd4a2a54b37124d4e85cb16d425
extra : convert_revision : eadf0b1a3fd0bd28303b12b905eb94a09a2ade1b
2009-11-10 14:55:35 -08:00
Graydon Hoare
d88df29f9d Bug 522316 - more miscellaneous drift from tamarin, r=dvander.
--HG--
extra : rebase_source : 7b92362823d4ef60ebced322c1588b6cd9f445e4
2009-10-14 13:48:00 -07:00
Graydon Hoare
c421bb6e66 Bug 517530 - NJ merge: whitespace, equivalent code, PPC churn, r=dvander. 2009-09-18 13:31:09 -07:00
Nicholas Nethercote
65a88a5c2c Bug 514625 - nanojit: kill AR::highwatermark. r=edwsmith. 2009-09-08 09:11:53 +10:00
Andreas Gal
292f7e316d Don't restore FP twice when exiting a fragment (513787, r=rreitmai). 2009-08-31 16:35:50 -07:00
Nicholas Nethercote
e7fbdc867c Bug 512398 - nanojit: kill RegAlloc::used. r=edwsmith. 2009-08-31 15:02:08 +10:00
Andreas Gal
84094cb9d0 Remove remainder of now unused LIR_loop support code (513535, r=dvander). 2009-08-29 23:26:54 -07:00
David Anderson
83d28f8a00 Merged LIR_alloc changes from tamarin-redux (bug 513069, r=gal). 2009-08-27 13:22:30 -07:00
Nicholas Nethercote
c414a79e4f Bug 501232 - nanojit: remove LIR_2 (3rd attempt!). r=edwsmith,gal. 2009-07-22 10:28:25 +10:00
Nicholas Nethercote
acc2840ef2 Bug 504213: nanojit: rename LIR_alloc, LIR_addp, LIR_param to match tamarin-redux. r=graydon. 2009-07-15 10:00:43 +10:00
Graydon Hoare
e404f743cd Bug 503593 - NJ: whitespace and modeline cleanup, r=gal.
--HG--
extra : rebase_source : c7fcc1acaadb2264796a3ee7a20866eecc4dc484
2009-07-10 12:58:34 -07:00
Graydon Hoare
203d645160 Bug 503437 - NJ: Commit missing CodeAlloc and NativePPC files from Adobe, r=gal.
--HG--
extra : rebase_source : 51a1d5fdc3c8ce0492f5986612a06858f2c4a5da
2009-07-10 11:21:53 -07:00