Commit Graph

40 Commits

Author SHA1 Message Date
Brian Gaeke 0c4fb283f3 Implement emitWordAt() for the JIT emitter.
llvm-svn: 13118
2004-04-23 17:11:14 +00:00
Chris Lattner 6604615a16 There is no reason to #define fd
llvm-svn: 11190
2004-02-08 19:33:07 +00:00
Chris Lattner fbcc0aa18d Implement PR135, lazy emission of global variables
llvm-svn: 10549
2003-12-20 03:36:47 +00:00
Chris Lattner 9bcae072d1 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.  :)

llvm-svn: 10544
2003-12-20 01:46:27 +00:00
Chris Lattner c0e1b071b9 Finegrainify namespacification
llvm-svn: 10318
2003-12-08 08:06:28 +00:00
Chris Lattner 98e72b4bb3 Emit constants to one contiguous block, but this time, respect alignment constraints.
If this doesn't work Misha, feel free to revert it.

llvm-svn: 10267
2003-11-30 04:23:21 +00:00
Misha Brukman 873cf93b6e 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.

llvm-svn: 10266
2003-11-30 00:50:53 +00:00
Misha Brukman be755279f3 Emit the MachineConstantPool constants in one contiguous memory `pool'.
llvm-svn: 10060
2003-11-17 20:40:07 +00:00
Brian Gaeke 960707c335 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell 482202a601 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner f2a34aa278 Hrm, a relic from the past. How cute :)
llvm-svn: 9283
2003-10-20 05:45:49 +00:00
Brian Gaeke 13b9395071 Fix a typo in a comment, and zap a blank line.
llvm-svn: 9184
2003-10-16 23:33:38 +00:00
Brian Gaeke 74edce6f7c 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.

llvm-svn: 9045
2003-10-11 03:51:18 +00:00
Brian Gaeke cc31fddf13 Don't include Config/stdio.h or <stdio.h>.
llvm-svn: 9031
2003-10-10 18:46:29 +00:00
Chris Lattner a220b04ce4 Actually _PASS IN_ NO_RESERVE if we have it.
Thanks to Brian for fixing this obvious oops

llvm-svn: 8899
2003-10-06 19:07:41 +00:00
Misha Brukman 93d0ffb864 * 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

llvm-svn: 8463
2003-09-10 20:52:05 +00:00
Misha Brukman 8c056e4337 Fix warning when _POSIX_MAPPED_FILES is already defined in unistd.h
llvm-svn: 8436
2003-09-10 15:09:45 +00:00
Chris Lattner f26be8427d Implement a _REAL_ memory manager for the code generated by the JIT. This
speeds up program execution by 15% pretty consistently for large programs

llvm-svn: 7845
2003-08-14 18:35:27 +00:00
Chris Lattner ee937c80ed Specify DEBUG_TYPE's for the JIT debug messages
llvm-svn: 7604
2003-08-05 17:00:32 +00:00
Chris Lattner f0c6964470 DEBUG got moved to Debug.h
llvm-svn: 7491
2003-08-01 22:13:59 +00:00
Misha Brukman e47f069855 * 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.

llvm-svn: 7381
2003-07-29 16:57:16 +00:00
Misha Brukman c0ae1cd93e Add rationale for the MAP_ANONYMOUS vs. MAP_ANON flags.
llvm-svn: 7368
2003-07-28 19:26:19 +00:00
Misha Brukman 057f460053 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.

llvm-svn: 7363
2003-07-28 19:09:06 +00:00
John Criswell 3ef61afb76 Merged in autoconf branch. This provides configuration via the autoconf
system.

llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Brian Gaeke eba22eb59d Get rid of the duplicate '0x' in debug mode.
llvm-svn: 7012
2003-06-30 18:06:20 +00:00
Brian Gaeke a7cf81bc75 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.)

llvm-svn: 6761
2003-06-17 23:14:06 +00:00
Chris Lattner 569358416f Add #include for older GCC's
llvm-svn: 6670
2003-06-08 06:43:57 +00:00
Misha Brukman a2b55253c6 Output function address as hex.
llvm-svn: 6649
2003-06-06 06:52:35 +00:00
Misha Brukman 6940c8644e Removed debug print statement.
llvm-svn: 6641
2003-06-06 00:00:54 +00:00
Misha Brukman 1d443d1250 * 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.

llvm-svn: 6610
2003-06-04 19:45:25 +00:00
Misha Brukman 6ac7fe7dc0 * 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.

llvm-svn: 6527
2003-06-02 03:23:16 +00:00
Chris Lattner cd0a9fa5b4 Remove obsolete code
llvm-svn: 6518
2003-06-02 00:09:00 +00:00
Chris Lattner 6b689e3ad4 Move target specific code to target files. The new MachineCodeEmitter
class is actually target independent!

llvm-svn: 6517
2003-06-01 23:24:36 +00:00
Misha Brukman 56d27325c0 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...

llvm-svn: 6360
2003-05-27 21:40:39 +00:00
Chris Lattner fdbd98b67f Add support for function stubs, which allow calling functions which need to
have an address available, but have not yet been code generated.

llvm-svn: 6059
2003-05-09 03:30:07 +00:00
Chris Lattner 037f1e58bd Minor speedup by avoiding callbacks to functions already generated
llvm-svn: 6052
2003-05-08 21:44:21 +00:00
Chris Lattner d340dbdb5d Improve efficiency of JIT by having it use direct function calls instead of
signals to regain control from the executing code

llvm-svn: 6051
2003-05-08 21:34:11 +00:00
Chris Lattner 75f7f8d906 Fix warnings on sparc
llvm-svn: 5427
2003-01-29 18:02:02 +00:00
Chris Lattner 4ba3bbb8d4 Add support for new types of values
llvm-svn: 5256
2003-01-13 01:00:12 +00:00
Chris Lattner 996fe01028 Initial checkin of new LLI with JIT compiler
llvm-svn: 5126
2002-12-24 00:01:05 +00:00