comparison src/cpu/x86/vm/c1_Runtime1_x86.cpp @ 6275:957c266d8bc5

Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Tue, 21 Aug 2012 10:39:19 +0200
parents 17639f600cda bf7796b7367a
children 6b74f44c5059
comparison
equal deleted inserted replaced
5891:fd8832ae511d 6275:957c266d8bc5
46 // setup registers 46 // setup registers
47 const Register thread = NOT_LP64(rdi) LP64_ONLY(r15_thread); // is callee-saved register (Visual C++ calling conventions) 47 const Register thread = NOT_LP64(rdi) LP64_ONLY(r15_thread); // is callee-saved register (Visual C++ calling conventions)
48 assert(!(oop_result1->is_valid() || oop_result2->is_valid()) || oop_result1 != oop_result2, "registers must be different"); 48 assert(!(oop_result1->is_valid() || oop_result2->is_valid()) || oop_result1 != oop_result2, "registers must be different");
49 assert(oop_result1 != thread && oop_result2 != thread, "registers must be different"); 49 assert(oop_result1 != thread && oop_result2 != thread, "registers must be different");
50 assert(args_size >= 0, "illegal args_size"); 50 assert(args_size >= 0, "illegal args_size");
51 bool align_stack = false;
52 #ifdef _LP64
53 // At a method handle call, the stack may not be properly aligned
54 // when returning with an exception.
55 align_stack = (stub_id() == Runtime1::handle_exception_from_callee_id);
56 #endif
51 57
52 #ifdef _LP64 58 #ifdef _LP64
53 mov(c_rarg0, thread); 59 mov(c_rarg0, thread);
54 set_num_rt_args(0); // Nothing on stack 60 set_num_rt_args(0); // Nothing on stack
55 #else 61 #else
58 // push java thread (becomes first argument of C function) 64 // push java thread (becomes first argument of C function)
59 get_thread(thread); 65 get_thread(thread);
60 push(thread); 66 push(thread);
61 #endif // _LP64 67 #endif // _LP64
62 68
63 set_last_Java_frame(thread, noreg, rbp, NULL); 69 int call_offset;
70 if (!align_stack) {
71 set_last_Java_frame(thread, noreg, rbp, NULL);
72 } else {
73 address the_pc = pc();
74 call_offset = offset();
75 set_last_Java_frame(thread, noreg, rbp, the_pc);
76 andptr(rsp, -(StackAlignmentInBytes)); // Align stack
77 }
64 78
65 // do the call 79 // do the call
66 call(RuntimeAddress(entry)); 80 call(RuntimeAddress(entry));
67 int call_offset = offset(); 81 if (!align_stack) {
82 call_offset = offset();
83 }
68 // verify callee-saved register 84 // verify callee-saved register
69 #ifdef ASSERT 85 #ifdef ASSERT
70 guarantee(thread != rax, "change this code"); 86 guarantee(thread != rax, "change this code");
71 push(rax); 87 push(rax);
72 { Label L; 88 { Label L;
77 stop("StubAssembler::call_RT: rdi not callee saved?"); 93 stop("StubAssembler::call_RT: rdi not callee saved?");
78 bind(L); 94 bind(L);
79 } 95 }
80 pop(rax); 96 pop(rax);
81 #endif 97 #endif
82 reset_last_Java_frame(thread, true, false); 98 reset_last_Java_frame(thread, true, align_stack);
83 99
84 // discard thread and arguments 100 // discard thread and arguments
85 NOT_LP64(addptr(rsp, num_rt_args()*BytesPerWord)); 101 NOT_LP64(addptr(rsp, num_rt_args()*BytesPerWord));
86 102
87 // check for pending exceptions 103 // check for pending exceptions