diff --git a/.gitattributes b/.gitattributes index c4463ddfe5..918197fed9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7370,6 +7370,8 @@ rtl/java/jrec.inc svneol=native#text/plain rtl/java/jrech.inc svneol=native#text/plain rtl/java/jset.inc svneol=native#text/plain rtl/java/jseth.inc svneol=native#text/plain +rtl/java/jsstringh.inc svneol=native#text/plain +rtl/java/jsstrings.inc svneol=native#text/plain rtl/java/jsystem.inc svneol=native#text/plain rtl/java/jsystemh.inc svneol=native#text/plain rtl/java/jsystemh_types.inc svneol=native#text/plain @@ -7380,8 +7382,6 @@ rtl/java/objpas.pp svneol=native#text/plain rtl/java/objpash.inc svneol=native#text/plain rtl/java/rtl.cfg svneol=native#text/plain rtl/java/rtti.inc svneol=native#text/plain -rtl/java/sstringh.inc svneol=native#text/plain -rtl/java/sstrings.inc svneol=native#text/plain rtl/java/sysos.inc svneol=native#text/plain rtl/java/sysosh.inc svneol=native#text/plain rtl/java/sysres.inc svneol=native#text/plain diff --git a/compiler/jvm/njvmcon.pas b/compiler/jvm/njvmcon.pas index 2a3353d8b4..2d0aaf0d67 100644 --- a/compiler/jvm/njvmcon.pas +++ b/compiler/jvm/njvmcon.pas @@ -163,7 +163,6 @@ implementation function tjvmstringconstnode.pass_1: tnode; var strclass: tobjectdef; - psym: tsym; pw: pcompilerwidestring; begin { all Java strings are utf-16. However, there is no way to @@ -197,13 +196,11 @@ implementation internalerror(2011052401); end; cst_type:=cst_unicodestring; - psym:=search_struct_member(strclass,'CREATEFROMLITERALSTRINGBYTES'); - if not assigned(psym) or - (psym.typ<>procsym) then - internalerror(2011052001); { since self will be freed, have to make a copy } - result:=ccallnode.create(ccallparanode.create(self.getcopy,nil), - tprocsym(psym),psym.owner,nil,[]); + result:=ccallnode.createinternmethodres( + cloadvmtaddrnode.create(ctypenode.create(strclass)), + 'CREATEFROMLITERALSTRINGBYTES',ccallparanode.create(self.getcopy,nil), + resultdef); end; diff --git a/compiler/ncal.pas b/compiler/ncal.pas index 0be9585a16..956baed3ac 100644 --- a/compiler/ncal.pas +++ b/compiler/ncal.pas @@ -133,6 +133,7 @@ interface constructor createinternresfromunit(const fromunit, procname: string; params: tnode; res:tdef); constructor createinternreturn(const name: string; params: tnode; returnnode : tnode); constructor createinternmethod(mp: tnode; const name: string; params: tnode); + constructor createinternmethodres(mp: tnode; const name: string; params: tnode; res:tdef); destructor destroy;override; constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override; procedure ppuwrite(ppufile:tcompilerppufile);override; @@ -1193,6 +1194,14 @@ implementation end; + constructor tcallnode.createinternmethodres(mp: tnode; const name: string; params: tnode; res: tdef); + begin + createinternmethod(mp,name,params); + typedef:=res; + include(callnodeflags,cnf_typedefset) + end; + + destructor tcallnode.destroy; begin methodpointer.free; diff --git a/rtl/java/sstringh.inc b/rtl/java/jsstringh.inc similarity index 100% rename from rtl/java/sstringh.inc rename to rtl/java/jsstringh.inc diff --git a/rtl/java/sstrings.inc b/rtl/java/jsstrings.inc similarity index 100% rename from rtl/java/sstrings.inc rename to rtl/java/jsstrings.inc