mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-07-25 21:27:52 +02:00
* tprocdef -> tabstractprocdef typecasts so the code will also work
when calling procvars is supported git-svn-id: branches/jvmbackend@18495 -
This commit is contained in:
parent
fab08ca975
commit
99177a75fb
@ -65,11 +65,11 @@ implementation
|
|||||||
already been done before calling the current constructor) }
|
already been done before calling the current constructor) }
|
||||||
if procdefinition.typ<>procdef then
|
if procdefinition.typ<>procdef then
|
||||||
exit;
|
exit;
|
||||||
if tprocdef(procdefinition).proctypeoption<>potype_constructor then
|
if tabstractprocdef(procdefinition).proctypeoption<>potype_constructor then
|
||||||
exit;
|
exit;
|
||||||
if not(methodpointer.resultdef.typ in [classrefdef,recorddef]) then
|
if not(methodpointer.resultdef.typ in [classrefdef,recorddef]) then
|
||||||
exit;
|
exit;
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_sym(a_new,current_asmdata.RefAsmSymbol(tabstractrecorddef(tprocdef(procdefinition).owner.defowner).jvm_full_typename(true))));
|
current_asmdata.CurrAsmList.concat(taicpu.op_sym(a_new,current_asmdata.RefAsmSymbol(tabstractrecorddef(tabstractprocdef(procdefinition).owner.defowner).jvm_full_typename(true))));
|
||||||
{ the constructor doesn't return anything, so put a duplicate of the
|
{ the constructor doesn't return anything, so put a duplicate of the
|
||||||
self pointer on the evaluation stack for use as function result
|
self pointer on the evaluation stack for use as function result
|
||||||
after the constructor has run }
|
after the constructor has run }
|
||||||
@ -92,7 +92,7 @@ implementation
|
|||||||
|
|
||||||
procedure tjvmcallnode.do_release_unused_return_value;
|
procedure tjvmcallnode.do_release_unused_return_value;
|
||||||
begin
|
begin
|
||||||
if (tprocdef(procdefinition).proctypeoption=potype_constructor) and
|
if (tabstractprocdef(procdefinition).proctypeoption=potype_constructor) and
|
||||||
(current_procinfo.procdef.proctypeoption=potype_constructor) then
|
(current_procinfo.procdef.proctypeoption=potype_constructor) then
|
||||||
exit;
|
exit;
|
||||||
case resultdef.size of
|
case resultdef.size of
|
||||||
@ -124,7 +124,7 @@ implementation
|
|||||||
else
|
else
|
||||||
realresdef:=tstoreddef(typedef);
|
realresdef:=tstoreddef(typedef);
|
||||||
{ a constructor doesn't actually return a value in the jvm }
|
{ a constructor doesn't actually return a value in the jvm }
|
||||||
if (tprocdef(procdefinition).proctypeoption=potype_constructor) then
|
if (tabstractprocdef(procdefinition).proctypeoption=potype_constructor) then
|
||||||
totalremovesize:=pushedparasize
|
totalremovesize:=pushedparasize
|
||||||
else
|
else
|
||||||
{ even a byte takes up a full stackslot -> align size to multiple of 4 }
|
{ even a byte takes up a full stackslot -> align size to multiple of 4 }
|
||||||
@ -138,7 +138,7 @@ implementation
|
|||||||
|
|
||||||
{ if this was an inherited constructor call, initialise all fields that
|
{ if this was an inherited constructor call, initialise all fields that
|
||||||
are wrapped types following it }
|
are wrapped types following it }
|
||||||
if (tprocdef(procdefinition).proctypeoption=potype_constructor) and
|
if (tabstractprocdef(procdefinition).proctypeoption=potype_constructor) and
|
||||||
(cnf_inherited in callnodeflags) then
|
(cnf_inherited in callnodeflags) then
|
||||||
thlcgjvm(hlcg).gen_initialize_fields_code(current_asmdata.CurrAsmList);
|
thlcgjvm(hlcg).gen_initialize_fields_code(current_asmdata.CurrAsmList);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user