Mercurial > hg > truffle
comparison src/cpu/x86/vm/cppInterpreter_x86.cpp @ 520:52a431267315
6791168: Fix invalid code in bytecodeInterpreter that can cause gcc ICE
Summary: Fix compilation errors from latest gcc in CC_INTERP including offending missing void* cast.
Reviewed-by: xlu
author | coleenp |
---|---|
date | Tue, 13 Jan 2009 14:41:44 -0500 |
parents | 9ee9cf798b59 |
children | 0fbdb4381b99 98cb887364d3 |
comparison
equal
deleted
inserted
replaced
516:fc7ab6287598 | 520:52a431267315 |
---|---|
592 // if the compilation did not complete (either went background or bailed out). | 592 // if the compilation did not complete (either went background or bailed out). |
593 __ movptr(rax, (int32_t)false); | 593 __ movptr(rax, (int32_t)false); |
594 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), rax); | 594 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), rax); |
595 | 595 |
596 // for c++ interpreter can rsi really be munged? | 596 // for c++ interpreter can rsi really be munged? |
597 __ lea(state, Address(rbp, -sizeof(BytecodeInterpreter))); // restore state | 597 __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); // restore state |
598 __ movptr(rbx, Address(state, byte_offset_of(BytecodeInterpreter, _method))); // restore method | 598 __ movptr(rbx, Address(state, byte_offset_of(BytecodeInterpreter, _method))); // restore method |
599 __ movptr(rdi, Address(state, byte_offset_of(BytecodeInterpreter, _locals))); // get locals pointer | 599 __ movptr(rdi, Address(state, byte_offset_of(BytecodeInterpreter, _locals))); // get locals pointer |
600 | 600 |
601 __ jmp(*do_continue, relocInfo::none); | 601 __ jmp(*do_continue, relocInfo::none); |
602 | 602 |
656 | 656 |
657 // locals + overhead, in bytes | 657 // locals + overhead, in bytes |
658 const Address size_of_stack (rbx, methodOopDesc::max_stack_offset()); | 658 const Address size_of_stack (rbx, methodOopDesc::max_stack_offset()); |
659 // Always give one monitor to allow us to start interp if sync method. | 659 // Always give one monitor to allow us to start interp if sync method. |
660 // Any additional monitors need a check when moving the expression stack | 660 // Any additional monitors need a check when moving the expression stack |
661 const one_monitor = frame::interpreter_frame_monitor_size() * wordSize; | 661 const int one_monitor = frame::interpreter_frame_monitor_size() * wordSize; |
662 __ load_unsigned_word(rax, size_of_stack); // get size of expression stack in words | 662 __ load_unsigned_word(rax, size_of_stack); // get size of expression stack in words |
663 __ lea(rax, Address(noreg, rax, Interpreter::stackElementScale(), one_monitor)); | 663 __ lea(rax, Address(noreg, rax, Interpreter::stackElementScale(), one_monitor)); |
664 __ lea(rax, Address(rax, rdx, Interpreter::stackElementScale(), overhead_size)); | 664 __ lea(rax, Address(rax, rdx, Interpreter::stackElementScale(), overhead_size)); |
665 | 665 |
666 #ifdef ASSERT | 666 #ifdef ASSERT |
1827 | 1827 |
1828 Label return_with_exception; | 1828 Label return_with_exception; |
1829 Label unwind_and_forward; | 1829 Label unwind_and_forward; |
1830 | 1830 |
1831 // restore state pointer. | 1831 // restore state pointer. |
1832 __ lea(state, Address(rbp, -sizeof(BytecodeInterpreter))); | 1832 __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); |
1833 | 1833 |
1834 __ movptr(rbx, STATE(_method)); // get method | 1834 __ movptr(rbx, STATE(_method)); // get method |
1835 #ifdef _LP64 | 1835 #ifdef _LP64 |
1836 __ movptr(Address(r15_thread, Thread::pending_exception_offset()), rax); | 1836 __ movptr(Address(r15_thread, Thread::pending_exception_offset()), rax); |
1837 #else | 1837 #else |
1875 | 1875 |
1876 address compiled_entry = __ pc(); | 1876 address compiled_entry = __ pc(); |
1877 | 1877 |
1878 // The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases | 1878 // The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases |
1879 if (UseSSE < 2) { | 1879 if (UseSSE < 2) { |
1880 __ lea(state, Address(rbp, -sizeof(BytecodeInterpreter))); | 1880 __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); |
1881 __ movptr(rbx, STATE(_result._to_call._callee)); // get method just executed | 1881 __ movptr(rbx, STATE(_result._to_call._callee)); // get method just executed |
1882 __ movl(rcx, Address(rbx, methodOopDesc::result_index_offset())); | 1882 __ movl(rcx, Address(rbx, methodOopDesc::result_index_offset())); |
1883 __ cmpl(rcx, AbstractInterpreter::BasicType_as_index(T_FLOAT)); // Result stub address array index | 1883 __ cmpl(rcx, AbstractInterpreter::BasicType_as_index(T_FLOAT)); // Result stub address array index |
1884 __ jcc(Assembler::equal, do_float); | 1884 __ jcc(Assembler::equal, do_float); |
1885 __ cmpl(rcx, AbstractInterpreter::BasicType_as_index(T_DOUBLE)); // Result stub address array index | 1885 __ cmpl(rcx, AbstractInterpreter::BasicType_as_index(T_DOUBLE)); // Result stub address array index |
1886 __ jcc(Assembler::equal, do_double); | 1886 __ jcc(Assembler::equal, do_double); |
1887 #ifdef COMPILER2 | 1887 #if !defined(_LP64) || defined(COMPILER1) || !defined(COMPILER2) |
1888 __ empty_FPU_stack(); | 1888 __ empty_FPU_stack(); |
1889 #endif // COMPILER2 | 1889 #endif // COMPILER2 |
1890 __ jmp(done_conv); | 1890 __ jmp(done_conv); |
1891 | 1891 |
1892 __ bind(do_float); | 1892 __ bind(do_float); |
1926 // calling convention left it (i.e. params may or may not be present) | 1926 // calling convention left it (i.e. params may or may not be present) |
1927 // Copy the result from tosca and place it on java expression stack. | 1927 // Copy the result from tosca and place it on java expression stack. |
1928 | 1928 |
1929 // Restore rsi/r13 as compiled code may not preserve it | 1929 // Restore rsi/r13 as compiled code may not preserve it |
1930 | 1930 |
1931 __ lea(state, Address(rbp, -sizeof(BytecodeInterpreter))); | 1931 __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); |
1932 | 1932 |
1933 // restore stack to what we had when we left (in case i2c extended it) | 1933 // restore stack to what we had when we left (in case i2c extended it) |
1934 | 1934 |
1935 __ movptr(rsp, STATE(_stack)); | 1935 __ movptr(rsp, STATE(_stack)); |
1936 __ lea(rsp, Address(rsp, wordSize)); | 1936 __ lea(rsp, Address(rsp, wordSize)); |
1940 #ifdef _LP64 | 1940 #ifdef _LP64 |
1941 __ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); | 1941 __ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); |
1942 #else | 1942 #else |
1943 __ movptr(rcx, STATE(_thread)); // get thread | 1943 __ movptr(rcx, STATE(_thread)); // get thread |
1944 __ cmpptr(Address(rcx, Thread::pending_exception_offset()), (int32_t)NULL_WORD); | 1944 __ cmpptr(Address(rcx, Thread::pending_exception_offset()), (int32_t)NULL_WORD); |
1945 #endif / __LP64 | 1945 #endif // _LP64 |
1946 __ jcc(Assembler::notZero, return_with_exception); | 1946 __ jcc(Assembler::notZero, return_with_exception); |
1947 | 1947 |
1948 // get method just executed | 1948 // get method just executed |
1949 __ movptr(rbx, STATE(_result._to_call._callee)); | 1949 __ movptr(rbx, STATE(_result._to_call._callee)); |
1950 | 1950 |