Commit Graph

260 Commits

Author SHA1 Message Date
Nicholas Nethercote
fb330f1df7 Bug 617244 - nanojit: remove AvmCore (NJ-specific part). r=edwsmith.
--HG--
extra : convert_revision : 6a1b21753af64c966f56dc0fad14d8a9d17d674e
2011-03-02 19:39:08 -08:00
Edwin Smith
5aeab46e08 Bug 620133 - Replace SeqReader with LIR_skip [r=nnethercote]
This patch adds LirWriter.insSkip(), LIns.overwriteWithSkip(),
and LirReader.peek()

I extracted the insSkip() changes from bug 545406 so I could use insSkip() and
overwriteWithSkip().  LirReader.read() uses its own size array because of
the special case for LIR_start, but other cases use a shared insSizes[]
array.

I added LirReader.peek() so that when erasing an instruction during a LirReader
iteration, I can find the skipTo instruction to use.  It is the next one that
will be read.

--HG--
extra : convert_revision : 3c560f9f45413de8c5ed10cab4584a8c1b1e4e3f
2011-03-01 15:34:11 -05:00
Nicholas Nethercote
51800259db Bug 623428 - TM: avoid bloat caused by multiple mReserve arrays in VMAllocator (NJ-specific part). r=edwsmith.
--HG--
extra : convert_revision : f6016c7c7cd415a26dad9cf39d34141b8b482d43
2011-01-18 14:58:34 -08:00
Nicholas Nethercote
3b27a0ff0e Make accNames[] public; needed for TM. No bug, r=me.
--HG--
extra : convert_revision : 4ca71b4e30e696851c0a7a934a0e73426cf8c2c7
2011-01-17 18:30:36 -08:00
Edwin Smith
0486e22f7d Bug 620406 - Constant folding branch condition leads to assert in Assembler.cpp (r=nnethercote+)
--HG--
extra : convert_revision : 5797090820d1645fad3c0ee05865cecf8b6b190c
2010-12-21 20:30:32 -05:00
Bill McCloskey
238069d8ff Bug 623050 - Move tracerState to compartment (r=gal) 2011-01-12 16:56:23 -08:00
Nicholas Nethercote
9cf6db33a1 Bug 609121 - nanojit: handle small immediates specially in CseFilter. r=wmaddox.
--HG--
extra : convert_revision : 04d7771f3f85877cf12395ffecfc4f2f6d4a0b50
2010-11-10 14:40:07 -08:00
Werner Sharp (wsharp@adobe.com)
49253f7a60 bug 607630. SoftFloatFilter needs to support LIR_d2i (sr+ nnethercote)
--HG--
extra : convert_revision : f43789d6bdbd848b943f3aac937b545e0872beb9
2010-10-28 12:47:12 -04:00
Nicholas Nethercote
d224dbf553 Bug 607555 - TM: fix interleaving of bytecode and LIR with TMFLAGS=recorder. r=edwsmith.
--HG--
extra : convert_revision : 53c69eca7d94694ff55d59d39c0d8a26f8d8c111
2010-10-27 15:49:04 -07:00
Nicholas Nethercote
1c2d701a4f Bug 607244 - nanojit: add LIR_comment. r=edwsmith.
--HG--
extra : convert_revision : 50bb48a9d8ce1c6bca6163d73abcddea8f6c5afc
2010-10-26 16:45:19 -07:00
Nicholas Nethercote
8d7461d9c7 Bug 600127 - nanojit: do implicit constant propagation after guards (2nd attempt). r=edwsmith.
--HG--
extra : convert_revision : 7ed1632ff30779fbdffe24c34e7fe4003ac9fd99
2010-10-20 22:16:03 -07:00
Nicholas Nethercote
0ee247937a Bug 602788 - nanojit: more constant folding of quads in ExprFilter, please. r=stejohns.
--HG--
extra : convert_revision : 8409c49a72dc223ca0622bc18b396e81f8d45608
2010-10-18 23:20:16 -07:00
Nicholas Nethercote
2f1f5115bb Bug 599251 - nanojit: make Register a non-numeric type. r=edwsmith.
--HG--
extra : convert_revision : c7275693cde4c740f1a53ab73b9ec1963f6fe0cc
2010-10-06 15:30:56 -07:00
Nicholas Nethercote
a029d9af78 Fix non-Linux compile bustage for bug 601539. r=me.
--HG--
extra : convert_revision : 12776aa248b916be646dd7b9c760be1b3fa7ba8a
2010-10-05 09:52:40 +11:00
Nicholas Nethercote
d03914abb0 Bug 601539 - nanojit: fix bogus generation of suffix names in LIR dumps. r=rreitmai.
--HG--
extra : convert_revision : 2c66185d4d358f589fc1fe44f48e4c7eafe1a0c1
2010-10-04 15:40:32 -07:00
Nicholas Nethercote
4119caf76d Backed out changeset 2e21c25656ee due to tinderbox oranges.
--HG--
extra : convert_revision : ce381ce50f62501ae385870d1328df73e68d7a27
2010-09-28 22:36:32 -07:00
Nicholas Nethercote
f2133a680f Bug 600127 - nanojit: do implicit constant propagation after guards. r=edwsmith.
--HG--
extra : convert_revision : 2e21c25656ee7367520468cf37ccb23d989ee7f7
2010-09-28 21:07:43 -07:00
Edwin Smith
52ea68fee4 Bug 572798 - add LIR_callv (r=nnethercote)
Adds LIR_callv for calls to helper functions that return void.

Added a ValidateWriter check that LIR_callv to be paired with ARGTYPE_V,
plus checks for the other obvious pairings, plus a check that callv must
not call a _pure=1 function.

getCallOpcode() returns LIR_callv for ARGTYPE_V, as expected.  This means that
some calls will return LTy_V from LIns::retType(), as expected, but unlike
before.  This in turn can cause a ValidateWriter error if an instruction uses
the result of a void call.  (after all, that's the point).

Each backend was modified to not assign a register or save the result of a void
call.

--HG--
extra : convert_revision : f1076b3fa633922ce95c24ac622934be4815376d
2010-09-23 15:08:15 -04:00
William Maddox
9ab7c2a331 Bug 542905 - cse chains should be cleared more selectively in case of labels. r=nnethercote.
--HG--
extra : convert_revision : 3cdd8540979dda01630e0676b273250311e26284
2010-09-22 19:04:48 -07:00
William Maddox
842155af2a Whitespace cleanup, nanojit subdir only (r=me)
--HG--
extra : convert_revision : a623aab958efda06d12eca456304fc674c92a589
2010-09-21 15:20:20 -07:00
Nicholas Nethercote
ef16f085cd Bug 575529 - TM: use interval analysis to remove more overflow checks. r=edwsmith,jseward.
--HG--
extra : convert_revision : 8f99b0ecb75811b021be0e91e20fd97c87c290ba
2010-09-20 20:33:29 -07:00
Edwin Smith
8a316147b9 Bug 584935 - Speed up register iteration loops by using BSF instruction (r=nnethercote+)
Changed all the register iteration loops to use lsbSet/msbSet functions
that use fast find-first-bit intrinsics when available.  Typical loops of
the form:

  for (Register r = FirstReg; r <= LastReg; r = nextReg(r))
    if (predicate(r))
	  /* use r */

were transformed by replacing the per-iteration predicate with a single
mask calculation, then iterating through only the 1 bits in the mask:

  RegisterMask set = /* calculate predicate with bitmask ops */;
  for (Register r = lsReg(set); set; r = lsNextReg(set))
    /* use r */

Iteration can be low-to-hi with lsReg/lsNextReg, or hi-to-low with msReg/msNextReg.
Primitives are provided for 32 and 64-bit masks.  PPC and MIPS need a 64-bit
mask, for example, even on 32-bit systems.

Refactoring details:

I renamed msbSet() to msbSet32() as part of adding [msb|lsb]Set[32|64], which
affected the AccSet code trivially.

I used if (sizeof(RegisterMask) == 4) to choose between 32 and 64bit
implementations, counting on a sane compiler to strip out the provably dead
path. An alternative would be to move the definitions of lsReg() and msReg() to
NativeXXX.h, after the RegisterMask typedef, allowing backends to hardcode the
choice.  Given we have six backends and one more on the way, it seemed better
to centralize the code and also avoid more ifdefs.

I moved the definitions of msbSet/lsbSet to nanojit.h, where other such helpers
already live.  It didn't seem appropriate to keep adding to LIR.h since the
helpers will now be used in several places in nanojit.

RegAlloc::managed is now set in Assembler.cpp instead of each backend; six
lines of code replaced by one.

prevreg() was dead after these changes.  Additionally, I hand-inlined nextreg()
in the other backends, because the usage was highly specialized -- those call
sites depended on nextreg being reg+1, (or reg+2) not some generic iteration.

I removed RegAlloc::countActive() since the only case was testing countActive()
== 0, which is equivalent to activeMask() == 0.

--HG--
extra : convert_revision : c7009f5cd83ea028b98f59e1f8830a76ba27c1dd
2010-08-19 16:04:19 -04:00
Ginn Chen
2f1a5f7820 Bug 584219 should use "signed bit" for signed bit-field r=nnethercote
--HG--
extra : convert_revision : 2f6b1e2a50de2df8f78b98b4c725d5a9897e9c4b
2010-08-19 16:08:53 +08:00
Nicholas Nethercote
3b63712fcf Bug 584275 - nanojit: preparation for adding many more access regions. r=edwsmith.
--HG--
extra : convert_revision : 64ae262a02031c276f58c3a4c71cfd92828f883f
2010-08-05 17:37:42 -07:00
Andreas Gal
00c966f8e3 Bug 580534 - implement LIR_cmovd. r=nnethercote.
--HG--
extra : convert_revision : 186f3f376d662375ff9182cf0b470468335ef442
2010-08-03 20:39:21 -07:00
Nicholas Nethercote
bdd9c63662 Bug 582191 - nanojit: fix formatImm[IQ] bogons. r=edwsmith.
--HG--
extra : convert_revision : ce704edcab9d092627ad29e60efc0991ee2682e0
2010-07-28 17:06:14 -07:00
Nicholas Nethercote
c591888546 Bug 552812 - nanojit: factor out AccSet differences into TM and TR (take 3). r=edwsmith.
--HG--
extra : convert_revision : 962916dc590fe3f55d15f00ac91b13e4ec4409a2
2010-07-27 21:28:02 -07:00
Nicholas Nethercote
da850ce005 Backout the last four patches for bug 552812 due to downstream Windows assertion failures on TM. Argh.
--HG--
extra : convert_revision : eb7dfecbdf2fd32d78673e10eb2289129966f6ce
2010-07-25 23:42:51 -07:00
Nicholas Nethercote
21a5ae4df8 Try to force MSVC to pack bit-fields properly, argh.
--HG--
extra : convert_revision : 09d69292e4ade9c77ce88f32e1840bd06071e2d6
2010-07-25 19:49:58 -07:00
Nicholas Nethercote
e82972a6ac Bug 552812 - nanojit: factor out AccSet differences into TM and TR (take 2). r=edwsmith.
--HG--
extra : convert_revision : 7e11df137a4d30bd8411cf3b35cb26a003188f86
2010-07-25 19:17:39 -07:00
Nicholas Nethercote
5272ac360b Backout last three patches for bug 552812 due to further Windows breakage, sigh.
--HG--
extra : convert_revision : 1909331461436f43dad16a22e502f332e7ad3488
2010-07-25 18:39:41 -07:00
Nicholas Nethercote
3013ab8162 Groan, fix syntax error.
--HG--
extra : convert_revision : 8dd52f216fd251c7ae0d250f64afdfade4892fbc
2010-07-25 18:32:15 -07:00
Nicholas Nethercote
c179be068c Fix Windows bustage from bug 552812.
--HG--
extra : convert_revision : bd1e180e8836da69c228bac3bb8e268020ccaba4
2010-07-25 18:27:49 -07:00
Nicholas Nethercote
208a727c1b Bug 552812 - nanojit: factor out AccSet differences into TM and TR. r=edwsmith.
--HG--
extra : convert_revision : 2d211c925ffabfc0a5dcc6ba9a6eaf02a32b47d4
2010-07-25 18:20:42 -07:00
Nicholas Nethercote
a901c621f3 Bug 553962 - nanojit: finish adding get/set methods for CallInfo::_typesig. r=edwsmith.
--HG--
extra : convert_revision : cfbed237877f0939423d9c1ac591c0a7edb5b0c0
2010-07-04 19:39:09 -07:00
Eli Friedman
c7b36cb9f6 Bug 576363 - Qualify accesses to dependent base in js. r=nnethercote.
--HG--
extra : convert_revision : 5c5cacef53d6a42f6226636c0fa71c13e428b52f
2010-07-04 19:12:15 -07:00
Nicholas Nethercote
dac3291064 Bug 513514 - nanojit: make hint() faster. r=edwsmith.
--HG--
extra : convert_revision : f95a1857f8fec03f4fa24c84cbb6222c4820c5a7
2010-06-30 18:32:06 -07:00
William Maddox
fc75018411 Bug 571430 - Allow for NumSavedRegs == 0 on SPARC (r=rreitmai+)
--HG--
extra : convert_revision : fb015a561f6b65104930a723e800c21a2d66e1bd
2010-06-16 14:29:43 -07:00
Edwin Smith
b919fbbe12 Bug 562152 - Remove typedef LInsp (r=nnethercote+)
--HG--
extra : convert_revision : 63a0a36e4637218160b42646feb9a18b408d8671
2010-06-10 11:22:18 -04:00
Rick Reitmaier
4e416a5a6b Bug 568393 - msvc 2008 compiler generates bad code for CallInfo static initializer (r+wmaddox)
ugh

--HG--
extra : convert_revision : f7c07b8ca96fc2ef1179171f05e69b841ac2865f
2010-05-26 18:02:31 -07:00
Edwin Smith
ab48828f96 Bug 560926 - Add support for arithmetic with branch on overflow (r= nnethercote+ edwsmith+ wmaddox+) 2010-06-06 17:57:30 -07:00
Nicholas Nethercote
3c1d859013 Backout the last NJ-to-TM merge (TM revisions b44daa2c0503 to b3167f8f9459, inclusive) because it caused lots of oranges. r=me. 2010-06-03 21:28:18 -07:00
Rick Reitmaier
af0bc4b0af Bug 568393 - msvc 2008 compiler generates bad code for CallInfo static initializer (r+wmaddox)
ugh

--HG--
extra : convert_revision : f7c07b8ca96fc2ef1179171f05e69b841ac2865f
2010-05-26 18:02:31 -07:00
Edwin Smith
3b4ffa11f5 Bug 560926 - Add support for arithmetic with branch on overflow (r=nnethercote+ edwsmith+ wmaddox+)
Patch to add 'j' (branch) variants of the exit-on-overflow instructions,
plus a few dependents:

32-bit:
LIR_addjovi
LIR_subjovi
LIR_muljovi

64-bit:
LIR_subq
LIR_addjovq
LIR_subjovq

--HG--
extra : convert_revision : 68023362b0833433a0bc0c3b5af8994894488f33
2010-05-26 14:03:14 -04:00
Edwin Smith
603d2206c9 whitespace hygiene
--HG--
extra : convert_revision : f96ca24c15235dba3282e3649356b6a7acf5d2e2
2010-05-19 20:54:10 -04:00
Edwin Smith
edbad98461 Bug 566759 - Remove LOpcode aliases once they are no longer used (r=nnethercote+)
--HG--
extra : convert_revision : 6aa777cb07a63862372399ac78a6f39b573c6dc1
2010-05-19 09:34:07 -04:00
Nicholas Nethercote
7a0c7aaa29 Bug 562597 - nanojit: more LOpcode-related renamings. r=edwsmith.
--HG--
extra : convert_revision : 96391e53a0b48bd53fa98db68da86f76a55e9bd0
2010-05-11 17:14:20 -07:00
Nicholas Nethercote
93fba42127 Bug 564080 - nanojit: merge LIR_alloc[iq]. r=edwsmith.
--HG--
extra : convert_revision : bf229d93127ae64ffa62f4c872c2319bbc4dc59b
2010-05-06 16:13:11 -07:00
Nicholas Nethercote
3b86611069 Bug 560712 - nanojit: give immediates names when printing LIR. r=edwsmith.
--HG--
extra : convert_revision : 53522168256873ff92a5cf1668d3ef8e65a87f38
2010-04-27 18:40:51 -07:00
Nicholas Nethercote
03c04769c0 Bug 518267 - nanojit: some instructions not printed with TMFLAGS=assembly. r=edwsmith.
--HG--
extra : convert_revision : 118664704b902286b9b21a35e3a998685980066a
2010-04-27 15:31:31 -07:00