Age | Commit message (Collapse) | Author | Files | Lines |
|
This patch adds '-Xtrace:signals' command line option for tracing VM
signals.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Table 2-5 ("Special Cases of REX Encodings") of Intel manual states
that:
EBP without a displacement must be done using mod = 01 with
displacement of 0.
The problem is visible on x86-64 where INSN_JMP_MEMINDEX is encoded
wrong. This fixes issue #34.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Make the error more readable and add information about number of
arguments passed on the stack:
[penberg@tux jruby-1.7.3]$ jato -Xdebug:stack -jar lib/jruby.jar -v
Error: stack is 8 bytes misaligned when entering function:
gnu/java/net/loader/JarURLLoader.<init>(Ljava/net/URLClassLoader;Lgnu/java/net/loader/URLStreamHandlerCache;Ljava/net/URLStreamHandlerFactory;Ljava/net/URL;Ljava/net/URL;)V.
which has 0 arguments passed on the stack.
Aborted
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
It seemed like a good testing strategy at the time but it has turned out to be
more trouble than it's worth.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
vm/classloader.c: In function ‘load_class_from_classpath_file’:
vm/classloader.c:375:2: warning: switch missing default case [-Wswitch-default]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
runtime/reflection.c: In function ‘vm_type_to_class’:
runtime/reflection.c:238:2: warning: switch missing default case [-Wswitch-default]
runtime/reflection.c: In function ‘object_to_jvalue’:
runtime/reflection.c:456:2: warning: switch missing default case [-Wswitch-default]
runtime/reflection.c: In function ‘jvalue_to_object’:
runtime/reflection.c:574:2: warning: switch missing default case [-Wswitch-default]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
runtime/java_lang_reflect_VMField.c: In function ‘to_jlong_value’:
runtime/java_lang_reflect_VMField.c:67:2: warning: switch missing default case [-Wswitch-default]
runtime/java_lang_reflect_VMField.c: In function ‘to_jint_value’:
runtime/java_lang_reflect_VMField.c:95:2: warning: switch missing default case [-Wswitch-default]
runtime/java_lang_reflect_VMField.c: In function ‘to_jshort_value’:
runtime/java_lang_reflect_VMField.c:122:2: warning: switch missing default case [-Wswitch-default]
runtime/java_lang_reflect_VMField.c: In function ‘to_jdouble_value’:
runtime/java_lang_reflect_VMField.c:147:2: warning: switch missing default case [-Wswitch-default]
runtime/java_lang_reflect_VMField.c: In function ‘to_jfloat_value’:
runtime/java_lang_reflect_VMField.c:177:2: warning: switch missing default case [-Wswitch-default]
runtime/java_lang_reflect_VMField.c: In function ‘to_jchar_value’:
runtime/java_lang_reflect_VMField.c:206:2: warning: switch missing default case [-Wswitch-default]
runtime/java_lang_reflect_VMField.c: In function ‘to_jbyte_value’:
runtime/java_lang_reflect_VMField.c:230:2: warning: switch missing default case [-Wswitch-default]
runtime/java_lang_reflect_VMField.c: In function ‘to_jboolean_value’:
runtime/java_lang_reflect_VMField.c:254:2: warning: switch missing default case [-Wswitch-default]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
CC vm/fault-inject.o
vm/fault-inject.c: In function ‘vm_fault_enabled’:
vm/fault-inject.c:39:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
vm/fault-inject.c: In function ‘vm_fault_arg’:
vm/fault-inject.c:47:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
vm/fault-inject.c: In function ‘native_vm_enable_fault’:
vm/fault-inject.c:56:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
vm/fault-inject.c: In function ‘native_vm_disable_fault’:
vm/fault-inject.c:65:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
vm/object.c:303:2: warning: switch missing default case [-Wswitch-default]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
vm/preload.c:80:2: warning: missing initializer [-Wmissing-field-initializers]
vm/preload.c:80:2: warning: (near initialization for ‘primitive_preload_entries[0].optional’) [-Wmissing-field-initializers]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
jato.c: In function ‘main’:
jato.c:1213:2: warning: switch missing default case [-Wswitch-default]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
vm/stack-trace.c: In function ‘stack_trace_elem_type_name’:
vm/stack-trace.c:723:2: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
runtime/java_lang_VMClassLoader.c: In function ‘get_primitive_class_name’:
runtime/java_lang_VMClassLoader.c:44:2: warning: switch missing default case [-Wswitch-default]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
cafebabe/constant_pool.c: In function ‘cafebabe_constant_pool_deinit’:
cafebabe/constant_pool.c:318:2: warning: switch missing default case [-Wswitch-default]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
cafebabe/annotations_attribute.c: In function ‘cafebabe_annotation_free’:
cafebabe/annotations_attribute.c:191:3: warning: switch missing default case [-Wswitch-default]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
arch/x86/instruction.c: In function ‘ssa_chg_jmp_direction’:
arch/x86/instruction.c:683:2: warning: switch missing default case [-Wswitch-default]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
vm/jni-interface.c:1676:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
vm/verifier.c:674:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
jit/bytecode-to-ir.c: In function ‘do_convert_bb_to_ir’:
jit/bytecode-to-ir.c:200:9: warning: missing initializer [-Wmissing-field-initializers]
jit/bytecode-to-ir.c:200:9: warning: (near initialization for ‘buffer.buffer’) [-Wmissing-field-initializers]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
jit/clobber.c: In function ‘mark_clobbers’:
jit/clobber.c:102:4: warning: switch missing default case [-Wswitch-default]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
arch/x86/encode.c: In function ‘x86_encode_reg’:
arch/x86/encode.c:109:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Spotted by GCC:
vm/types.c: In function ‘vmtype_to_bytecode_type’:
vm/types.c:119:2: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
vm/types.c: In function ‘get_vm_type_name’:
vm/types.c:140:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
GCC points out that:
arch/x86/call.c: In function ‘native_call’:
arch/x86/call.c:247:2: warning: switch missing default case [-Wswitch-default]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
GCC reports the following problem in range_is_empty()
include/jit/vars.h: In function ‘range_is_empty’:
include/jit/vars.h:45:2: warning: comparison is always false due to limited range of data type [-Wtype-limits]
Fix it.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Section 3.2.2 ("The Stack Frame") of the SVR4 x86-64 ABI states that:
The end of the input argument area shall be aligned on a 16 byte
boundary. In other words, the value (%rsp - 8) is always a multiple of
16 when control is transferred to the function entry point. The stack
pointer, %rsp, always points to the end of the latest allocated stack
frame.
Unfortunately the JIT compiler does not take that into account for
arguments that are passed on the stack for x86-64. Fix the problem by
adding a new STMT_BEFORE_ARGS statement that aligns the stack pointer
properly and teach method_args_cleanup() to deal with the alignment.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
The signal_bh_trampoline() function forgot to save and restore r10 and
r11 which are also caller-save registers.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Add stack alignment check to stack debugging that is enabled by the
"-Xdebug:stack" command line option.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
The mark_clobbers() function doesn't deal with INSN_RESTORE_CALLER_REGS
which causes caller-save register clobbering when calling functions with
the return type void.
Fix that up to make x86-64 behave properly again.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Fixups are not known to work properly on 64-bit so don't use them. This
fixes this:
[penberg@golgotha jato]$ ./jato -Xtrace:exceptions -cp test/functional jvm/EntryTest
[main] SIGSEGV at RIP 051e9aa8 while accessing memory address 00000000.
[main] Registers:
[main] rsp: 00007fffde9193d0
[main] rax: 0000000041fb9d20 rbx: 0000000000008000 rcx: 0000000000008000
[main] rdx: 0000000000000000 rsi: 0000000004921000 rdi: 0000000001a5fd20
[main] rbp: 00007fffde9195b0 r8: 0000000000008000 r9: 0000000004921000
[main] r10: 0000003ba1fb0778 r11: 0000000003de7b40 r12: 0000000000008000
[main] r13: 000000000525cc80 r14: 0000000000000002 r15: 0000000001a5fd20
[main] Stack:
[main] 0000000001a5fd20 0000000001a5fd20 0000000004921000 0000000000000000
[main] 0000000000008000 0000000000008000 00007fffde919440 0000000005239800
[main] 0000000005296080 0000000000000000 00000000de919460 0000000003de7088
[main] Code: 00 00 00 20 a4 7c 04 00 00 00 00 80 99 1e 05 00 00 00 00 2f 00 00 00 00 00 00 00 e1 00 00 00 00 00 00 00 10 4b 1f 05 00 00 00 00 <30> 12 19 05 00 00 00 00 28 4b 1f 05 00 00 00 00 02 00 00 00 00
[main] Native and Java stack trace:
[main] [<051e9aa8>] native : signal_bh_trampoline+4dbbef4 (arch/x86/signal-bh.S:124)
[main] [<41fb9140>] jit : java/util/zip/Inflater.inflate(Inflater.java:322)
[main] [<41fb77f4>] jit : java/util/zip/InflaterInputStream.read(InflaterInputStream.java:196)
[main] [<41f7b710>] jit : java/io/InputStreamReader.read(InputStreamReader.java:393)
[main] [<41f79a75>] jit : java/io/BufferedReader.fill(BufferedReader.java:370)
[main] [<41f7780b>] jit : java/io/BufferedReader.readLine(BufferedReader.java:469)
[main] [<41fb6c03>] jit : gnu/java/util/jar/JarUtils.read_attributes(JarUtils.java:194)
[main] [<41fb67a5>] jit : gnu/java/util/jar/JarUtils.readMainSection(JarUtils.java:140)
[main] [<41fb4456>] jit : gnu/java/util/jar/JarUtils.readMFManifest(JarUtils.java:101)
[main] [<41f38b51>] jit : java/util/jar/Manifest.read(Manifest.java:162)
[main] [<41f35b1d>] jit : java/util/jar/Manifest.<init>(Manifest.java:89)
[main] [<41f1ebdf>] jit : java/util/jar/JarFile.readManifest(JarFile.java:303)
[main] [<41f1d019>] jit : java/util/jar/JarFile.<init>(JarFile.java:268)
[main] [<41ecda04>] jit : gnu/java/net/protocol/jar/Connection$JarFileCache.get(Connection.java:99)
[main] [<41ecac72>] jit : gnu/java/net/protocol/jar/Connection.connect(Connection.java:141)
[main] [<41ec9cb2>] jit : gnu/java/net/protocol/jar/Connection.getInputStream(Connection.java:159)
[main] [<41ebfbbd>] jit : java/net/URL.openStream(URL.java:737)
[main] [<41bdc459>] jit : java/lang/VMClassLoader.getBootPackages(VMClassLoader.java:262)
[main] [<41bcb2ab>] jit : java/lang/VMClassLoader.<clinit>(VMClassLoader.java:88)
[main] [<004101b0>] native : vm_class_init+175 (/home/penberg/jato/vm/class.c:748)
[main] [<004254c2>] native : vm_class_ensure_init+ffffffffffff2f64 (/home/penberg/jato/include/vm/class.h:126)
[main] [<41bc5b22>] jit : java/lang/VMClassLoader.getSystemClassLoader(VMClassLoader.java)
[main] [<41bc7c43>] jit : java/lang/ClassLoader$StaticData.<clinit>(ClassLoader.java:154)
[main] [<004101b0>] native : vm_class_init+175 (/home/penberg/jato/vm/class.c:748)
[main] [<0041e47a>] native : vm_class_ensure_init+fffffffffffebf1c (/home/penberg/jato/include/vm/class.h:126)
[main] [<00419e0c>] native : static_field_signal_bh+e (/home/penberg/jato/vm/static.c:66)
[main] [<0042dc3b>] native : signal_bh_trampoline+87 (arch/x86/signal-bh.S:124)
[main] [<41bc4f20>] jit : java/lang/ClassLoader.getSystemClassLoader(ClassLoader.java:796)
[main] [<0041b4ea>] native : native_call_gp+c6 (/home/penberg/jato/arch/x86/call.c:203)
[main] [<0041b54f>] native : native_call+42 (/home/penberg/jato/arch/x86/call.c:270)
[main] [<0040f877>] native : call_method_a+41 (/home/penberg/jato/vm/call.c:54)
[main] [<0040f941>] native : vm_call_method_v+99 (/home/penberg/jato/vm/call.c:71)
[main] [<004119f2>] native : vm_call_method_object+48e6 (/home/penberg/jato/include/vm/call.h:81)
[main] [<00405e6f>] native : do_main_class+18 (/home/penberg/jato/jato.c:1004)
[main] [<00405775>] native : ./jato() [0x405775]
[main] [<3ba1c21734>] native : signal_bh_trampoline+3ba17f3b80 (arch/x86/signal-bh.S:124)
Aborted (core dumped)
and makes it visible what's really happening:
[penberg@golgotha jato]$ ./jato -Xtrace:exceptions -cp test/functional jvm/EntryTest
[main] trace exception: exception object 0x459a240 (java/lang/IllegalArgumentException) thrown
[main] message : 0x45b1e38 = "Non-positive averageCharsPerByte" (java/lang/String)
[main] from : 0x40f86260: java/nio/charset/CharsetDecoder.<init>(Ljava/nio/charset/Charset;FFLjava/lang/String;)V
[main] (CharsetDecoder.java:72)
[main] action : unwind to 0x40f85a71: java/nio/charset/CharsetDecoder.<init>(Ljava/nio/charset/Charset;FF)V
[main] (CharsetDecoder.java:89)
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
$PROGRAM is now $PROGRAMS.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Separate command line option parsing from the VM launcher.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Add support for compiling multiple programs that use "libjvm.a" so we
can experiment with alternative launcher programs.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Reported-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Document GNU Classpath dependencies on Fedora 17
|
|
GNU Classpath 0.99 does not appear to require either FastJar or PCCTS.
Signed-off-by: Jussi Virtanen <jussi.k.virtanen@gmail.com>
|
|
Remove 'libzip' dependency from documentation
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
The 'libzip' dependency has already been removed. Update the
documentation accordingly.
Signed-off-by: Jussi Virtanen <jussi.k.virtanen@gmail.com>
|
|
Remove 'libzip' dependency
|
|
It is not actually needed.
Signed-off-by: Jussi Virtanen <jussi.k.virtanen@gmail.com>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Reading vm/jar.c can feel like pulling teeth at times...
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Don't add the same call instruction twice to the compilation unit;
otherwise the compile will enter an infinite loop in the liveness
analysis.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Fix the instruction selector rule for invokestatic to properly handle
missing methods. The NoSuchMethodErrorTest test case is not enabled due
to unrelated problems that cause it to hang indefinitely while compiling
the test method for invokevirtual.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Print out a human-readable error message if a dependency check fails.
For example, if the libbfd library is missing, we print out the
following error message:
$ make
Makefile:200: *** No libbfd found, please install binutils-devel or binutils-dev package.. Stop.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Given this test program:
public class Hashtable<K, V> {
private final float loadFactor;
public Hashtable(int initialCapacity, float loadFactor)
{
HashEntry<K, V>[] buckets = (HashEntry<K, V>[]) new HashEntry[initialCapacity];
if (!(loadFactor > 0))
throw new IllegalArgumentException();
this.loadFactor = loadFactor;
}
private static final class HashEntry<K, V> {
}
public static void main(String[] args) {
Hashtable ht = new Hashtable(100, 0.75f);
}
}
If you compile Jato with GCC optimization level "-O2", for example:
make CFLAGS=-O2
and then run the program as follows:
javac Hashtable.java
./jato -Xtrace:exceptions \
-bootclasspath .:/usr/local/classpath/share/classpath/glibj.zip \
-Djava.library.path=/usr/local/classpath/lib/classpath/ \
-Xnosystemclassloader Hashtable
You will see the following crash:
[main] trace exception: exception object 0x236c630 (java/lang/IllegalArgumentException) thrown
[main] message : 0x0 null
[main] from : 0x40fa8fc7: Hashtable.<init>(IF)V
[main] (Hashtable.java:12)
[main] action : unwind to 0x40fa8db1: Hashtable.main([Ljava/lang/String;)V
[main] (Hashtable.java:20)
[main] trace exception: exception object 0x236c630 (java/lang/IllegalArgumentException) thrown
[main] message : 0x0 null
[main] from : 0x40fa8db0: Hashtable.main([Ljava/lang/String;)V
[main] (Hashtable.java:20)
[main] action : unwind to native caller at 0x41e4b8
Exception in thread "main" java.lang.IllegalArgumentException
at Hashtable.<init>(Hashtable.java:12)
at Hashtable.main(Hashtable.java:20)
Now while this doesn't seem to happen with the "-Os" GCC optimization
level, it's by pure luck. Looking at the generated assembly, we see that
XMM registers (which are *caller saved* registers on x86-64) are not
saved before call instructions:
[main] 0x41d7ff51: 48 89 e5 mov %rsp,%rbp
[main] 0x41d7ff54: 48 83 ec 40 sub $0x40,%rsp
[main] 0x41d7ff58: 53 push %rbx
[main] 0x41d7ff59: 41 54 push %r12
[main] 0x41d7ff5b: 41 55 push %r13
[main] 0x41d7ff5d: 41 56 push %r14
[main] 0x41d7ff5f: 41 57 push %r15
[main] 0x41d7ff61: 57 push %rdi
[main] 0x41d7ff62: 49 89 ff mov %rdi,%r15
[main] 0x41d7ff65: 49 89 f6 mov %rsi,%r14
[main] 0x41d7ff68: f3 0f 10 f8 movss %xmm0,%xmm7
[main] 0x41d7ff6c: 4d 89 fd mov %r15,%r13
[main] 0x41d7ff6f: 4d 85 6d 00 test %r13,0x0(%r13)
[main] 0x41d7ff73: 4c 89 ef mov %r13,%rdi
[main] 0x41d7ff76: f6 04 25 00 90 d3 00 00 testb $0x0,0xd39000
[main] 0x41d7ff7e: e8 bd cd ff ff callq 0x0000000041d7cd40 # java/lang/Object.<init>()V
[main] 0x41d7ff83: 45 89 f6 mov %r14d,%r14d
[main] 0x41d7ff86: 4c 89 f7 mov %r14,%rdi
[main] 0x41d7ff89: e8 c2 51 6b be callq 0x0000000000435150 # array_size_check+0 (/home/penberg/jato/vm/object.c:494)
which means that the any function that uses the XMM registers will
clobber our registers.
To fix the issue, use the following simple strategy suggested by "Linear
Scan Register Allocation" by Poletto and Sarkar (1999):
The simplest solution is to use all registers, and insert saves and
restores where appropriate around function calls after register
allocation.
This fixes #25.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Move the oddly named 'method_real_argument_count' to 'vm/method.c' and
rename it to vm_method_arg_stack_count(). The API is useful for
implementing alternative codegen backends.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
The BC2IR test cases in test/unit were a good idea for bootstrapping
Jato back in 2005. However, their usefulness has since decreased and in
fact they have held back code cleanups because of the weird dependencies
they introduce.
So drop them for good.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Remove a dependency from the more generic jit/expression.c to a BC2IR
specific function that depends on dup_expr(). This makes it easier to
remove obsolete BC2IR test cases.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
The "quick" JVM bytecode opcodes have never been used by Jato so drop
them. They are there for historical reasons only when Jato was still a
JIT compiler inside JamVM.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
The 'edx' variable is always NULL on 64-bit so drop the extra branch.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch fixes XMM8-XMM15 register encoding for memlocals on x86-64. I
noticed the problem while looking at assembly dumps for caller-save register
saving and restoring.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
In preparation for fixing clobbering issues in the register allocator, drop
BC2IR test cases that will break.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
The `java/lang` package is reserved for the JVM. Jato does not enforce
this but HotSpot, for example, does which means we cannot run the same
test set on it.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
There are two different test cases for java/lang/Class. Merge
them to a single file.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
There are two different test cases for java/lang/reflect/Method. Merge
them to a single file.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Make sure we clear existing text for 'Test FAILED' printout so the
output doesn't look like crap.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch moves x86_call_disp() helper function to <arch/isa.h> and converts
x86 architecture code to use it.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch simplifies the inline caching code by separating 'return addresses'
from 'call-sites'.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
CC arch/x86/inline-cache.o
arch/x86/inline-cache.c: In function ‘is_valid_ic’:
arch/x86/inline-cache.c:47:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/inline-cache.c:49:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/inline-cache.c: In function ‘ic_set_to_monomorphic’:
arch/x86/inline-cache.c:112:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/inline-cache.c:113:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/inline-cache.c:113:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
arch/x86/inline-cache.c: In function ‘ic_set_to_megamorphic’:
arch/x86/inline-cache.c:131:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/inline-cache.c:132:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Call instruction target offsets are 32-bit even on x86-64.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
As a cleanup, introduce 'arg_gp_regs' and 'arg_xmm_regs' on x86-64 and use
them.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Jato currently only works with the "-Os" GCC optimization level on x86-64.
Furthermore, the problems exposed by "-ftree-vectorize" were due to Jato bugs
so it's pointless to disable the optimization.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Use the "r12" format for live intervals in liveness tracing to make searching
the LIR and the machine register allocation table easier.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch eliminates a redundant register to register store from
EXPR_LOCAL_FLOAT instruction selector rule.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch eliminates a redundant register to register store from EXPR_LOCAL
instruction selector rule.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
The get_fixed_var() function always returns a non-NULL 'struct var_info'.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
CC spill-reload-test.o
spill-reload-test.c: In function ‘test_empty_interval_is_never_spilled’:
spill-reload-test.c:152:22: warning: variable ‘bb’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Fixes the following issue reported by GCC '-Wunused-but-set-variable':
jit/bytecode-to-ir.c: In function ‘pick_and_propagate_temporaries’:
jit/bytecode-to-ir.c:363:6: warning: variable ‘slot_ndx’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch fixes ->vm_type for EXPR_ARG expressions. This fixes instruction
selector rules on x86-64 that use it to distinguish between MOVSS and MOVSD for
floats and doubles, respectively.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Johannes Laire <johannes@laire.fi>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Johannes Laire <johannes@laire.fi>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Commit 1421557 ("jit: Fix argument register clobbering") fixed bunch of failing
functional tests. Enable them.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch fixes a long-standing bug on x86-64 where arguments in register are
clobbered. The problem is visible in ParameterPassingLivenessTest which passes
with this patch applied.
Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: Tomek Grabiec <tgrabiec@gmail.com>
Cc: Vegard Nossum <vegardno@ifi.uio.no>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch fixes a NPE during Jenkins startup.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Joonas Reynders <joonas.reynders@iki.fi>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Nikhil Sarda <nikhilsarda.iitkgp@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This fix unblocks Maven from starting up.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch fixes edx clobbering issue with 64-bit JNI function return values.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
We advertise Java 1.6 version with "jato -version" but we also need to do that
for JVM defined system properties. This fixes Jenkins early startup
java.lang.UnsupportedClassVersionError exception.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Suggested-by: Charles Oliver Nutter <headius@headius.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch fixes AsciiDoc complaints for internals.txt and adds a table of
contents to the document.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch fixes multianewarray code generation on x86-64. Now that we already
use proper varargs for vm_object_alloc_multi_array() the only thing remaining
is making sure arguments are passed in correct registers and that we don't mess
up the stack pointer after the call to vm_object_alloc_multi_array().
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch simplifies multianewarray code generation in preparation for fixing
multianewarray on x86-64 and other architectures that pass arguments in
registers.
The main issue with the current code is that arguments passed to
multiarray_size_check() and vm_object_alloc_multi_array() are shared which is
fine on 32-bit x86 where arguments are on the stack. Unfortunately for x86-64
arguments are passed in registers and are thus clobbered by the
multiarray_size_check() function.
By dropping EXPR_MULTIARRAY_SIZE_CHECK, we avoid the issue completely which
makes fixing multianewarray easier.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Joonas Reynders <joonas.reynders@iki.fi>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
In preparation for fixing multianewarray support on x86-64, convert
vm_object_alloc_multi_array() to use varargs instead of passing a pointer to
stack.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This reverts commit 12c4f26ce3316e114e9b7949a2eee06954734d93. It breaks
EntryTest when -Xdebug:stack is enabled.
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Fix same issues on 32-bit as commit 1dd46e3 ("x86-64: Fix stack pointer
alignment with -Xdebug:stack") on 64-bit. This fixes wide-spread test breakage
when -Xdebug:stack is enabled.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Running EntryTest on x86-64 with -Xdebug:stack crashes as follows:
./jato -Xdebug:stack -cp test/functional -bootclasspath test/functional:`./tools/classpath-config`/share/classpath/glibj.zip -Djava.library.path=`./tools/classpath-config`/lib/classpath/ -Xnosystemclassloader jvm/EntryTest
[main] SIGSEGV at RIP 3de6406973 while accessing memory address 00000000.
[main] Registers:
[main] rsp: 00007fff9282db78
[main] rax: 0000000000000000 rbx: 0000000001be3090 rcx: 0000000000000020
[main] rdx: 000000000000016c rsi: 000000000000005b rdi: 0000000001be3090
[main] rbp: 00007fff9282dce8 r8: 000000000000000a r9: 0000000070000021
[main] r10: 000000006ffffdff r11: 0000000000000246 r12: 00007fff9282dda0
[main] r13: 000000006ffffeff r14: 00007fff9282dae0 r15: 00007fff9282da80
[main] Stack:
[main] 000000000000002d 0000003de6847ffe 0000000000000001 0000000000000014
[main] 00007fff9282dbf8 000000000000002a 0000003de687447e 00007fff9282e200
[main] 00007f6a4844a000 00007f6a4844ad00 00007f6a48449c58 00007fff9282db78
[main] Code: 83 a8 02 00 00 0f 85 7b 05 00 00 48 89 df e8 55 3f 00 00 f6 45 10 08 0f 84 cb 00 00 00 f6 83 d4 03 00 00 20 48 8b 05 ed 8f 21 00 <66> 0f 6f 85 40 ff ff ff 48 0f 45 c3 48 83 3d 51 82 21 00 00 48
[main] Native and Java stack trace:
[main] [<3de6406973>] native : signal_bh_trampoline+3de5fc030f (arch/x86/signal-bh.S:124)
[main] [<3de6407e76>] native : signal_bh_trampoline+3de5fc1812 (arch/x86/signal-bh.S:124)
Aborted
The problem is that when we push a 8 byte canary on the stack, the stack
pointer is no longer aligned to 16 bytes which is required for some SSE
operations on 64-bit.
This patch fixes the issue.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
The specialized instruction selection rules are not needed for correctness
because EXPR_VALUE and EXPR_FVALUE combined with EXPR_ARG deals with immediate
arguments just fine.
The immediate floating point rule is broken so drop bot specialized runes for
now. We can reintroduce them later on if we can show there's a performance
benefit in having them.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Use MOVSS and MOVSD instructions for float and double arguments, respectively,
and reserve 8 bytes for each argument on stack regardless of the type.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch replaces a magic number with the MAX_FRAME_SIZE_SUBTRACTED constant.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This cleans up instruction encoding bit-twiddling hacks. We also need to
cleanup insn_encode() in the future.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch adds ARMv5 codegen helper macros in preparation for cleaning up
arch/arm/encode.c.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Use shorter name that actually describes what the function does.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Joonas Reynders <joonas.reynders@iki.fi>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
In addition to space reserved for locals, unwinding has to account for
callee-saved registers and other values saved on the stack. Both x86 and
x86-64 were affected, the former since it adopted a few stack layout
changes (standard prologs/epilogs and canaries), while the latter seems
to have been affected for a long time.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch fixes return value tracing. Note that only integer return values are
supported for now.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch enables the GDB hooks on 32-bit x86 as well. See
Documentation/debugging.txt for details how to set breakpoints in JIT'd code.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Use 'add' and 'sub' instructions instead of 'adds' and 'subs' for 32-bit
operations, respectively.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch simplifies instruction selection rules for binary operations that
involve immediate values.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
|
|
This patch adds INSN_NOP support for x86 architecture. The instruction is
useful for marking instruction selector rules for debugging purposes.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Xerxes Rånby <xerxes@zafena.se>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch fixes the non-standard stack frame layout on 32-bit. Prolog is
changed as follows:
Before:
[main] 0xa736b790: 57 push %edi
[main] 0xa736b791: 56 push %esi
[main] 0xa736b792: 53 push %ebx
[main] 0xa736b793: 55 push %ebp
[main] 0xa736b794: 89 e5 mov %esp,%ebp
[main] 0xa736b796: 83 ec 10 sub $0x10,%esp
After:
[main] 0xa73db4a8: 55 push %ebp
[main] 0xa73db4a9: 89 e5 mov %esp,%ebp
[main] 0xa73db4ab: 83 ec 10 sub $0x10,%esp
[main] 0xa73db4ae: 57 push %edi
[main] 0xa73db4af: 56 push %esi
[main] 0xa73db4b0: 53 push %ebx
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Joonas Reynders <joonas.reynders@iki.fi>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Joonas Reynders <joonas.reynders@iki.fi>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
We've been mistakenly using the 32-bit mov in a few cases, since it went
by the name of __emit_mov_imm_reg(). This removes the 32-bit version
altogether to avoid confusion.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This places a canary value on the stack to check for corruption. Despite
being called "redzoning", it has nothing to do with the x86-64 redzone
as described in the ABI.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Using %rsp to get *this seems fragile, we can look it up relative to
%rbp if we know the frame size and the stack layout used by prologs.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
It's useful to check whether additional tests pass following some
changes. This adds the option '-s' to tools/test.py which runs only the
unsupported tests and reports the ones which are passed, instead of
failures.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Let these emitters know the frame size in case we need to recover *this
in a non-trivial way.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
The uninitialized method_info proved problematic when tests failed.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Joonas Reynders <joonas.reynders@iki.fi>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
We need to cleanup stack after the call to bsearch() in generated code.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
We pass reference to method class automatically for static JNI methods.
However, we also need to clean them up on architectures that pass arguments on
the stack.
Before:
[main] 0xa72f7997: bf 30 ac 53 0a mov $0xa53ac30,%edi
[main] 0xa72f799c: 57 push %edi
[main] 0xa72f799d: f6 04 25 00 f0 9f 09 00 testb $0x0,0x99ff000(,%eiz,1)
[main] 0xa72f79a5: e8 f6 e0 ff ff call 0x00000000a72f5aa0 # gnu/java/nio/VMChannel.initIDs()V
[main] 0xa72f79aa: 65 8b 3d ec b7 ff ff mov %gs:0xffffb7ec,%edi
[main] 0xa72f79b1: 85 3f test %edi,(%edi)
[main] 0xa72f79b3: e9 01 00 00 00 jmp 0x00000000a72f79b9
After:
[main] 0xa735b997: bf 30 6c 45 0a mov $0xa456c30,%edi
[main] 0xa735b99c: 57 push %edi
[main] 0xa735b99d: f6 04 25 00 b0 91 09 00 testb $0x0,0x991b000(,%eiz,1)
[main] 0xa735b9a5: e8 f6 e0 ff ff call 0x00000000a7359aa0 # gnu/java/nio/VMChannel.initIDs()V
[main] 0xa735b9aa: 81 c4 04 00 00 00 add $0x4,%esp
[main] 0xa735b9b0: 65 8b 3d ec b7 ff ff mov %gs:0xffffb7ec,%edi
[main] 0xa735b9b7: 85 3f test %edi,(%edi)
[main] 0xa735b9b9: e9 01 00 00 00 jmp 0x00000000a735b9bf
This patch fixes one stack smashing bug detected by -Xdebug:stack command line
option on 32-bit x86.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
The vm_method_do_init() function overwrites struct vm_method::args_count so
there's absolutely no reason to assign it in vm_method_init_from_interface().
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
and Abstract classes
Signed-off-by: Joonas Reynders <joonas.reynders@iki.fi>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch introduces -Xdebug:stack command line option that enables JIT code
stack smashing detection.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Commit 02b74cf ("x86-32: Fix stack frame size in generated prolog") forgot to
fix cu_frame_locals_offset().
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Same as commit 0ab0e6f ("x86-64: Simplify __emit_insn()") but for 32-bit.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Same as commit 8319a7f ("x86-64: Remove forward declarations from emit_64.c")
but for 32-bit.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Same as commit 27dcbf7 ("x86-64: Remove 32-bit ifdefs from emit_64.c") but for
32-bit.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Move code around so that we can drop forward declarations.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
As a first step to cleaning up the file, remove 32-bit ifdefs.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
The arch/x86/emit-code.c file is a twisted maze these days. Split it into
32-bit and 64-bit versions so that we can clean it up.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Same as commit f3a677c ("x86-32: Simplify prolog and epilog code generation")
but on x86-64.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch introduces a 'callee_save_regs' array and changes emit_prolog() and
emit_epilog() to use it.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Passing certain parameters results in nested calling sequences on
x86-64, but this isn't handled correctly at the moment.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
GDB doesn't give us sensible backtraces when building without debugging
CFLAGS. Moreover, registering compiled methods with GDB could impact
performance needlessly.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
The ->args_count member of struct vm_method represents the total number of
arguments. However, in frame_local_offset() we are interested in the number of
arguments that are passed on the stack.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Same as commit 02b74cf ("x86-32: Fix stack frame size in generated prolog") but
for 64-bit x86.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
The frame_locals_size() function returns stack frame size in bytes so just use
the returned value in emit_prolog(). This fixes unnecessary large stack frames
on x86-32.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
SSE instructions that operate on the stack require stack pointer to be aligned
to 16 bytes. This patch is needed to be able to fix too large stack frame
sizes on x86.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
This patch removes a redundant push eax/pop eax pair from static method
trampolines.
Before:
[main] # Trampoline:
[main] 0xa739cab0: 55 push %ebp
[main] 0xa739cab1: 89 e5 mov %esp,%ebp
[main] 0xa739cab3: 68 40 16 b7 08 push $0x8b71640
[main] 0xa739cab8: e8 73 38 d0 60 call 0x00000000080a0330 # jit_magic_trampoline+0 (/home/penberg/src/jato/jit/trampoline.c:95)
[main]
[main] 0xa739cabd: 83 c4 04 add $0x4,%esp
[main] 0xa739cac0: 65 8b 0d f0 b7 ff ff mov %gs:0xffffb7f0,%ecx
[main] 0xa739cac7: 85 09 test %ecx,(%ecx)
[main] 0xa739cac9: 50 push %eax
[main] 0xa739caca: 58 pop %eax
[main] 0xa739cacb: 5d pop %ebp
[main] 0xa739cacc: ff e0 jmp *%eax
After:
[unknown] # Trampoline:
[unknown] 0xa7399f80: 55 push %ebp
[unknown] 0xa7399f81: 89 e5 mov %esp,%ebp
[unknown] 0xa7399f83: 68 c0 d8 c2 08 push $0x8c2d8c0
[unknown] 0xa7399f88: e8 a3 63 d0 60 call 0x00000000080a0330 # jit_magic_trampoline+0 (/home/penberg/src/jato/jit/trampoline.c:95)
[unknown]
[unknown] 0xa7399f8d: 83 c4 04 add $0x4,%esp
[unknown] 0xa7399f90: 65 8b 0d f0 b7 ff ff mov %gs:0xffffb7f0,%ecx
[unknown] 0xa7399f97: 85 09 test %ecx,(%ecx)
[unknown] 0xa7399f99: 5d pop %ebp
[unknown] 0xa7399f9a: ff e0 jmp *%eax
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
|
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|