mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-03 23:29:28 +01:00 
			
		
		
		
	+ generic implementation of thlcgobj.a_call_ref()
* override thlcg.a_call_reg() in JVM hlcgcpu with dummy that calls
    internalerror
git-svn-id: trunk@21099 -
			
			
This commit is contained in:
		
							parent
							
								
									e20639732f
								
							
						
					
					
						commit
						4fced5d142
					
				@ -182,7 +182,7 @@ unit hlcgobj;
 | 
			
		||||
          }
 | 
			
		||||
          procedure a_call_name(list : TAsmList;pd : tprocdef;const s : TSymStr; weak: boolean);virtual;abstract;
 | 
			
		||||
          procedure a_call_reg(list : TAsmList;pd : tabstractprocdef;reg : tregister);virtual;abstract;
 | 
			
		||||
          procedure a_call_ref(list : TAsmList;pd : tabstractprocdef;ref : treference);virtual;abstract;
 | 
			
		||||
          procedure a_call_ref(list : TAsmList;pd : tabstractprocdef;ref : treference);virtual;
 | 
			
		||||
          { same as a_call_name, might be overridden on certain architectures to emit
 | 
			
		||||
            static calls without usage of a got trampoline }
 | 
			
		||||
          procedure a_call_name_static(list : TAsmList;pd : tprocdef;const s : TSymStr);virtual;
 | 
			
		||||
@ -780,6 +780,22 @@ implementation
 | 
			
		||||
         end;
 | 
			
		||||
    end;
 | 
			
		||||
 | 
			
		||||
  procedure thlcgobj.a_call_ref(list: TAsmList; pd: tabstractprocdef; ref: treference);
 | 
			
		||||
    var
 | 
			
		||||
      reg: tregister;
 | 
			
		||||
      size: tdef;
 | 
			
		||||
    begin
 | 
			
		||||
      { the loaded data is always a pointer to a procdef. A procvardef is
 | 
			
		||||
        implicitly a pointer already, but a procdef isn't -> create one }
 | 
			
		||||
      if pd.typ=procvardef then
 | 
			
		||||
        size:=pd
 | 
			
		||||
      else
 | 
			
		||||
        size:=getpointerdef(pd);
 | 
			
		||||
      reg:=getaddressregister(list,size);
 | 
			
		||||
      a_load_ref_reg(list,size,size,ref,reg);
 | 
			
		||||
      a_call_reg(list,pd,reg);
 | 
			
		||||
    end;
 | 
			
		||||
 | 
			
		||||
  procedure thlcgobj.a_call_name_static(list: TAsmList; pd: tprocdef; const s: TSymStr);
 | 
			
		||||
    begin
 | 
			
		||||
      a_call_name(list,pd,s,false);
 | 
			
		||||
 | 
			
		||||
@ -52,6 +52,7 @@ uses
 | 
			
		||||
 | 
			
		||||
      procedure a_call_name(list : TAsmList;pd : tprocdef;const s : TSymStr; weak: boolean);override;
 | 
			
		||||
      procedure a_call_name_inherited(list : TAsmList;pd : tprocdef;const s : TSymStr);override;
 | 
			
		||||
      procedure a_call_ref(list: TAsmList; pd: tabstractprocdef; ref: treference); override;
 | 
			
		||||
 | 
			
		||||
      procedure a_load_const_reg(list : TAsmList;tosize : tdef;a : aint;register : tregister);override;
 | 
			
		||||
      procedure a_load_const_ref(list : TAsmList;tosize : tdef;a : aint;const ref : treference);override;
 | 
			
		||||
@ -301,6 +302,12 @@ implementation
 | 
			
		||||
    end;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  procedure thlcgjvm.a_call_ref(list: TAsmList; pd: tabstractprocdef; ref: treference);
 | 
			
		||||
    begin
 | 
			
		||||
      internalerror(2012042824);
 | 
			
		||||
    end;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  procedure thlcgjvm.a_load_const_stack_intern(list : TAsmList;size : tdef;a : aint; typ: TRegisterType; legalize_const: boolean);
 | 
			
		||||
    begin
 | 
			
		||||
      if legalize_const and
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user