question about stubRoutines (original) (raw)

Vladimir Kozlov vladimir.kozlov at oracle.com
Thu Jul 5 16:25:16 PDT 2012


Look on MacroAssembler::testl() comment:

// Import other testl() methods from the parent class or else // they will be hidden by the following overriding declaration. using Assembler::testl; void testl(Register dst, AddressLiteral src);

Also build from scratch: generated precompiled header file may be not updated correctly.

Vladimir

Venkatachalam, Vasanth wrote:

How do you handle the case where instructions in assemblerx86.cpp don't have overloaded versions that take an AddressLiteral as a source argument? Below is how I'm handling this case. Is this correct?

Take for example, the andl instruction. I defined an overloaded version taking an AddressLiteral in MacroAssembler: void MacroAssembler::andl(Register dst, AddressLiteral src) { if(reachable(src)) { Assembler::andl(dst, asAddress(src)); } else { lea(rscratch1, src); Assembler::andl(dst, Address(rscratch1, 0)); } When I want to use the instruction (in StubGeneratorx8664.cpp), I do it as follows: ExternalAddress fooaddress(StubRoutines::x86::maskmantall8()); __ andl(rax, fooaddress);_ When I do this I get the build errors below: /home/tester/hotspot/hotspot-bd-dev/src/cpu/x86/vm/x8664.ad: In member function 'virtual void loadUB2LimmI8Node::emit(CodeBuffer&, PhaseRegAlloc*) const': /home/tester/hotspot/hotspot-bd-dev/src/cpu/x86/vm/x8664.ad:4850:44: error: no matching function for call to 'MacroAssembler::andl(RegisterImpl*&, intptrt)' /home/tester/hotspot/hotspot-bd-dev/src/cpu/x86/vm/x8664.ad:4850:44: note: candidate is: In file included from /home/tester/hotspot/hotspot-bd-dev/src/share/vm/asm/assembler.hpp:448:0, from /home/tester/hotspot/hotspot-bd-dev/src/share/vm/precompiled/precompiled.hpp:29: /home/tester/hotspot/hotspot-bd-dev/src/cpu/x86/vm/assemblerx86.hpp:2256:8: note: void MacroAssembler::andl(Register, AddressLiteral) /home/tester/hotspot/hotspot-bd-dev/src/cpu/x86/vm/assemblerx86.hpp:2256:8: note: no known conversion for argument 2 from 'intptrt {aka long int}' to 'AddressLiteral' -----Original Message----- From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com] Sent: Monday, June 25, 2012 7:47 PM To: Venkatachalam, Vasanth Cc: hotspot-dev at openjdk.java.net Subject: Re: question about stubRoutines Look how StubRoutines::x86::floatsignmask() is done. Then you can access it as external address: ExternalAddress foostartadr(StubRoutines::x86::foostart()); __ lea(r9, foostartAdr);_ Vladimir Venkatachalam, Vasanth wrote: Hi,

I'm trying to write a new stub routine in Hotspot's stubGeneratorx8664.cpp. The original code for the routine is in a MASM file. I'm trying to translate this code into calls to Hotspot's assembler so that the code can be implemented into a stub routine. The original MASM file has a large data segment (aligned to 16 bytes) which looks like: ALIGN 16 _foostart: DQ 0000000000000000h DQ 3f6ff00aa0000000h DQ 3f7fe02a60000000h DQ 3f87dc4750000000h DQ 3f8fc0a8b0000000h DQ 3f93cea440000000h DQ 3f97b91b00000000h This data segment is used in one of the instructions: _lea r9, QWORD PTR foostart Can anyone explain how to handle this data segment when writing a new StubRoutine in Hotspot? Vasanth -- Vasanth Venkatachalam AMD Runtimes (512)602-6177



More information about the hotspot-dev mailing list