Commit Graph

42 Commits

Author SHA1 Message Date
Chris Lattner
0cb162b3bb Use the SystemUtils.h file to do our dirty work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13868 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-28 00:57:27 +00:00
Chris Lattner
c52663c4ed This code is a real mess, but at least get the JIT *building* on platforms
(such as plan 9) without mmap.  Of course it won't RUN... but that's another
step.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13839 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-27 18:03:56 +00:00
Brian Gaeke
aea1b58f1e Implement emitWordAt() for the JIT emitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13118 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 17:11:14 +00:00
Chris Lattner
6c0398ed47 There is no reason to #define fd
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11190 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-08 19:33:07 +00:00
Chris Lattner
c07ed13875 Implement PR135, lazy emission of global variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10549 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 03:36:47 +00:00
Chris Lattner
4d326fa9be Cleanup the JIT as per PR176. This renames the VM class to JIT, and merges the
VM.cpp and JIT.cpp files into JIT.cpp.  This also splits some nasty code out
into TargetSelect.cpp so that people hopefully won't notice it.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10544 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 01:46:27 +00:00
Chris Lattner
c19aadee66 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10318 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-08 08:06:28 +00:00
Chris Lattner
2c0a6a19ef Emit constants to one contiguous block, but this time, respect alignment constraints.
If this doesn't work Misha, feel free to revert it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10267 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-30 04:23:21 +00:00
Misha Brukman
91de352796 Go back to allocating memory for each constant separately. Since SPARCs do not
allow unaligned loads, that is probably the problem I've been seeing in numerous
SPARC test cases failing. X86, on the other hand, just slows down unaligned
accesses, since it must make 2 aligned accesses for each unaligned one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10266 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-30 00:50:53 +00:00
Misha Brukman
ef7e57018d Emit the MachineConstantPool constants in one contiguous memory `pool'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10060 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 20:40:07 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +00:00
John Criswell
b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +00:00
Chris Lattner
e738656c0b Hrm, a relic from the past. How cute :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9283 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 05:45:49 +00:00
Brian Gaeke
6020ddd57e Fix a typo in a comment, and zap a blank line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9184 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 23:33:38 +00:00
Brian Gaeke
364f86d4df Make mmap's fd for anonymous memory acquisition default to -1, except on
Linux. This is consistent with what FreeBSD and Solaris both want.
This makes the JIT work on FreeBSD 5.1-RELEASE. Whee.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9045 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-11 03:51:18 +00:00
Brian Gaeke
e24b616faa Don't include Config/stdio.h or <stdio.h>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9031 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 18:46:29 +00:00
Chris Lattner
011efae2f0 Actually _PASS IN_ NO_RESERVE if we have it.
Thanks to Brian for fixing this obvious oops


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8899 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-06 19:07:41 +00:00
Misha Brukman
36d10ef7e7 * Move include files from middle of file to the top where they belong, moving
the #define up there too
* Since we're including system headers, use the ones in include/llvm/Config
* While we're here, use the canonical LLVM header ordering algorithm


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8463 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 20:52:05 +00:00
Misha Brukman
88b4855499 Fix warning when _POSIX_MAPPED_FILES is already defined in unistd.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8436 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 15:09:45 +00:00
Chris Lattner
688506de24 Implement a _REAL_ memory manager for the code generated by the JIT. This
speeds up program execution by 15% pretty consistently for large programs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7845 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 18:35:27 +00:00
Chris Lattner
3785fad56e Specify DEBUG_TYPE's for the JIT debug messages
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7604 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 17:00:32 +00:00
Chris Lattner
c648dabf65 DEBUG got moved to Debug.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7491 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 22:13:59 +00:00
Misha Brukman
89e8be00c5 * Stop hard-coding a value for beginning of emitted code on Sparc since we can
now handle far calls (i.e., beyond the 30-bit limit in call instructions).
* As a side-effect, this allows us to unify and clean up the mmap() call and
  code around it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7381 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 16:57:16 +00:00
Misha Brukman
fd31a78124 Add rationale for the MAP_ANONYMOUS vs. MAP_ANON flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7368 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 19:26:19 +00:00
Misha Brukman
d69c1e6dc2 Add ability for external C code to get pointers to functions given their name.
This us used by bugpoint -- when code is compiled to a shared object to be
JITted, it must use the JIT's lazy resolution method to find function addresses,
because some functions will not be available at .so load time, as they are in
the bytecode file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7363 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 19:09:06 +00:00
John Criswell
7a73b80b90 Merged in autoconf branch. This provides configuration via the autoconf
system.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7014 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 21:59:07 +00:00
Brian Gaeke
02c26b681e Get rid of the duplicate '0x' in debug mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7012 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 18:06:20 +00:00
Brian Gaeke
4399a4982a Add #ifdef hack for MAP_ANONYMOUS being spelled MAP_ANON on some platforms.
(We're already talking about autoconf'ing this, so I'm assuming this hack
will be short-lived...I just don't want it to get lost in my working files.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6761 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 23:14:06 +00:00
Chris Lattner
08d5e1f718 Add #include for older GCC's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6670 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-08 06:43:57 +00:00
Misha Brukman
1d4408506b Output function address as hex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6649 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 06:52:35 +00:00
Misha Brukman
cf614a32d5 Removed debug print statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6641 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 00:00:54 +00:00
Misha Brukman
3a55e8aae4 * Institute a hack for the Sparc call to mmap() to get our generated code to be
laid out closer to the VM so that calls to library functions (e.g. puts()) and
  callback (e.g.  JITResolver::CompilationCallback) fit into 30 bits of the call
  instruction.
* Abort if architecture is not yet supported (not X86 or Sparc) because it
  likely requires a different set of parameters to mmap() .
* Stop using hard-coded values for page size; use sysconf(_SC_PAGESIZE) instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6610 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 19:45:25 +00:00
Misha Brukman
906f5fa5c8 * Removed SparcEmitter.cpp; rolled into lib/Target/Sparc/SparcV9CodeEmitter.cpp
* No more createX86Emitter() vs. createSparcEmitter() -- there can be only one
* As a result, the memory management semantics must be handled according to
  platform -- the parameters to mmap() are particularly sensitive to the host
  architecture.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6527 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02 03:23:16 +00:00
Chris Lattner
d5af63f325 Remove obsolete code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6518 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02 00:09:00 +00:00
Chris Lattner
bba1b6df9a Move target specific code to target files. The new MachineCodeEmitter
class is actually target independent!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6517 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-01 23:24:36 +00:00
Misha Brukman
abb027cf41 Allow for specification of which JIT to run on the commandline.
`lli -march=x86' or `lli -march=sparc' will forcefully select the JIT even on a
different platform. Running lli without the -march option will select the JIT
for the platform that it's currently running on.

Pro: can test Sparc JIT (debug printing mode) on X86 -- faster to compile/link
LLVM source base to test changes.
Con: Linking lli on x86 now pulls in all the Sparc libs -> longer link time
(but X86 can bear it, right?)

In the future, perhaps this should be a ./configure option to enable/disable
target JITting...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6360 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 21:40:39 +00:00
Chris Lattner
6125fddb52 Add support for function stubs, which allow calling functions which need to
have an address available, but have not yet been code generated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6059 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-09 03:30:07 +00:00
Chris Lattner
eb5a93b86b Minor speedup by avoiding callbacks to functions already generated
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6052 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 21:44:21 +00:00
Chris Lattner
c309a7627c Improve efficiency of JIT by having it use direct function calls instead of
signals to regain control from the executing code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6051 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 21:34:11 +00:00
Chris Lattner
910687ec55 Fix warnings on sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5427 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-29 18:02:02 +00:00
Chris Lattner
1cc08381f1 Add support for new types of values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5256 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 01:00:12 +00:00
Chris Lattner
bd199fb114 Initial checkin of new LLI with JIT compiler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5126 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-24 00:01:05 +00:00