comparison src/cpu/x86/vm/dump_x86_64.cpp @ 304:dc7f315e41f7

5108146: Merge i486 and amd64 cpu directories 6459804: Want client (c1) compiler for x86_64 (amd64) for faster start-up Reviewed-by: kvn
author never
date Wed, 27 Aug 2008 00:21:55 -0700
parents a61af66fc99e
children 9ee9cf798b59
comparison
equal deleted inserted replaced
303:fa4d1d240383 304:dc7f315e41f7
88 88
89 // Expecting to be called with "thiscall" convections -- the arguments 89 // Expecting to be called with "thiscall" convections -- the arguments
90 // are on the stack and the "this" pointer is in c_rarg0. In addition, rax 90 // are on the stack and the "this" pointer is in c_rarg0. In addition, rax
91 // was set (above) to the offset of the method in the table. 91 // was set (above) to the offset of the method in the table.
92 92
93 __ pushq(c_rarg1); // save & free register 93 __ push(c_rarg1); // save & free register
94 __ pushq(c_rarg0); // save "this" 94 __ push(c_rarg0); // save "this"
95 __ movq(c_rarg0, rax); 95 __ mov(c_rarg0, rax);
96 __ shrq(c_rarg0, 8); // isolate vtable identifier. 96 __ shrptr(c_rarg0, 8); // isolate vtable identifier.
97 __ shlq(c_rarg0, LogBytesPerWord); 97 __ shlptr(c_rarg0, LogBytesPerWord);
98 __ lea(c_rarg1, ExternalAddress((address)vtbl_list)); // ptr to correct vtable list. 98 __ lea(c_rarg1, ExternalAddress((address)vtbl_list)); // ptr to correct vtable list.
99 __ addq(c_rarg1, c_rarg0); // ptr to list entry. 99 __ addptr(c_rarg1, c_rarg0); // ptr to list entry.
100 __ movq(c_rarg1, Address(c_rarg1, 0)); // get correct vtable address. 100 __ movptr(c_rarg1, Address(c_rarg1, 0)); // get correct vtable address.
101 __ popq(c_rarg0); // restore "this" 101 __ pop(c_rarg0); // restore "this"
102 __ movq(Address(c_rarg0, 0), c_rarg1); // update vtable pointer. 102 __ movptr(Address(c_rarg0, 0), c_rarg1); // update vtable pointer.
103 103
104 __ andq(rax, 0x00ff); // isolate vtable method index 104 __ andptr(rax, 0x00ff); // isolate vtable method index
105 __ shlq(rax, LogBytesPerWord); 105 __ shlptr(rax, LogBytesPerWord);
106 __ addq(rax, c_rarg1); // address of real method pointer. 106 __ addptr(rax, c_rarg1); // address of real method pointer.
107 __ popq(c_rarg1); // restore register. 107 __ pop(c_rarg1); // restore register.
108 __ movq(rax, Address(rax, 0)); // get real method pointer. 108 __ movptr(rax, Address(rax, 0)); // get real method pointer.
109 __ jmp(rax); // jump to the real method. 109 __ jmp(rax); // jump to the real method.
110 110
111 __ flush(); 111 __ flush();
112 112
113 *mc_top = (char*)__ pc(); 113 *mc_top = (char*)__ pc();