diff --git a/compiler/jvm/njvminl.pas b/compiler/jvm/njvminl.pas index 1b08b491ef..7ad1b45856 100644 --- a/compiler/jvm/njvminl.pas +++ b/compiler/jvm/njvminl.pas @@ -38,8 +38,7 @@ interface function first_copy: tnode; override; function first_assigned: tnode; override; - - function first_assert: tnode; override; + function first_get_frame: tnode; override; function first_box: tnode; override; function first_unbox: tnode; override; @@ -242,17 +241,10 @@ implementation end; - function tjvminlinenode.first_assert: tnode; - var - paras: tcallparanode; + function tjvminlinenode.first_get_frame: tnode; begin - paras:=tcallparanode(tcallparanode(left).right); - paras:=ccallparanode.create(cstringconstnode.createstr(current_module.sourcefiles.get_file_name(current_filepos.fileindex)),paras); - paras:=ccallparanode.create(genintconstnode(fileinfo.line),paras); - result:=cifnode.create(cnotnode.create(tcallparanode(left).left), - ccallnode.createintern('fpc_assert',paras),nil); - tcallparanode(left).left:=nil; - tcallparanode(left).right:=nil; + { no frame pointer on the JVM target } + result:=cnilnode.create; end; diff --git a/compiler/ninl.pas b/compiler/ninl.pas index b87b1cae99..8aa99afccd 100644 --- a/compiler/ninl.pas +++ b/compiler/ninl.pas @@ -66,6 +66,7 @@ interface function first_int_real: tnode; virtual; function first_abs_long: tnode; virtual; function first_IncludeExclude: tnode; virtual; + function first_get_frame: tnode; virtual; function first_setlength: tnode; virtual; function first_copy: tnode; virtual; { This one by default generates an internal error, because such @@ -3436,8 +3437,7 @@ implementation end; in_get_frame: begin - include(current_procinfo.flags,pi_needs_stackframe); - expectloc:=LOC_CREGISTER; + result:=first_get_frame; end; in_get_caller_frame: begin @@ -3613,6 +3613,13 @@ implementation end; + function tinlinenode.first_get_frame: tnode; + begin + include(current_procinfo.flags,pi_needs_stackframe); + expectloc:=LOC_CREGISTER; + end; + + function tinlinenode.first_setlength: tnode; var paras : tnode; @@ -3794,7 +3801,7 @@ implementation paras:=tcallparanode(tcallparanode(left).right); paras:=ccallparanode.create(cstringconstnode.createstr(current_module.sourcefiles.get_file_name(current_filepos.fileindex)),paras); paras:=ccallparanode.create(genintconstnode(fileinfo.line),paras); -{$if defined(x86) or defined(arm)} +{$if defined(x86) or defined(arm) or defined(jvm)} paras:=ccallparanode.create(geninlinenode(in_get_frame,false,nil),paras); {$else} paras:=ccallparanode.create(ccallnode.createinternfromunit('SYSTEM','GET_FRAME',nil),paras); diff --git a/compiler/psystem.pas b/compiler/psystem.pas index 1cb59e0420..a21222cb0c 100644 --- a/compiler/psystem.pas +++ b/compiler/psystem.pas @@ -96,9 +96,9 @@ implementation systemunit.insert(tsyssym.create('Length',in_length_x)); systemunit.insert(tsyssym.create('New',in_new_x)); systemunit.insert(tsyssym.create('Dispose',in_dispose_x)); -{$if defined(x86) or defined(arm)} +{$if defined(x86) or defined(arm) or defined(jvm)} systemunit.insert(tsyssym.create('Get_Frame',in_get_frame)); -{$endif defined(x86) or defined(arm)} +{$endif defined(x86) or defined(arm) or defined(jvm)} systemunit.insert(tsyssym.create('Unaligned',in_unaligned_x)); systemunit.insert(tsyssym.create('ObjCSelector',in_objc_selector_x)); { objc only } systemunit.insert(tsyssym.create('ObjCEncode',in_objc_encode_x)); { objc only } diff --git a/rtl/java/jcompproc.inc b/rtl/java/jcompproc.inc index 4736e0b223..d6d44c301e 100644 --- a/rtl/java/jcompproc.inc +++ b/rtl/java/jcompproc.inc @@ -640,7 +640,7 @@ Procedure fpc_HandleError (Errno : longint); compilerproc; procedure fpc_AbstractErrorIntern;compilerproc; *) -procedure fpc_assert(Const Msg,FName:unicodestring;LineNo:Longint{;ErrorAddr:Pointer}); compilerproc; +procedure fpc_assert(Const Msg,FName:unicodestring;LineNo:Longint;ErrorAddr:Pointer); compilerproc; {$ifdef FPC_HAS_FEATURE_FILEIO} Procedure fpc_reset_typed(var f : TypedFile;Size : Longint); compilerproc; diff --git a/rtl/java/jsystem.inc b/rtl/java/jsystem.inc index 76f912c085..c7fe79f666 100644 --- a/rtl/java/jsystem.inc +++ b/rtl/java/jsystem.inc @@ -1308,7 +1308,7 @@ begin end; -Procedure fpc_assert(Const Msg,FName:unicodestring;LineNo:Longint{;ErrorAddr:Pointer}); [Public,Alias : 'FPC_ASSERT']; compilerproc; +Procedure fpc_assert(Const Msg,FName:unicodestring;LineNo:Longint;ErrorAddr:Pointer); [Public,Alias : 'FPC_ASSERT']; compilerproc; begin (* if pointer(AssertErrorProc)<>nil then diff --git a/rtl/jvm/jvm.inc b/rtl/jvm/jvm.inc index a588dc81e5..3d74ad2749 100644 --- a/rtl/jvm/jvm.inc +++ b/rtl/jvm/jvm.inc @@ -41,13 +41,6 @@ procedure fpc_cpuinit; end; -{$define FPC_SYSTEM_HAS_GET_FRAME} -function get_frame:pointer; - begin - result:=nil; - end; - - {$define FPC_SYSTEM_HAS_GET_CALLER_ADDR} function get_caller_addr(framebp:pointer;addr:pointer=nil):pointer; begin