[Soot-list] How to handle native calls

Jochen Huck jochen.huck at student.kit.edu
Wed Feb 9 11:27:29 EST 2011


Hi again,

thanks for the pointer. That was exacly what I was searching for but I 
figured out that it won't solve my problem. The sideeffect analysis adds 
a DependenceTag to units. If a unit could call a native method the flag 
callsNative is set. If callsNative is set I have to assume that the 
sideeffects of that unit can't be calculated. So if one of two units has 
callsNative set I must assume that I can't execute them concurrently. 
But if SPARK handles the sideeffects of the native method that caused 
callsNative=true I don't have to assume that. The callsNative flag is 
set by SideeffectAnalysis if one of the methods a unit calls has the 
modifier native.
class SootMethod {
     ...
     public boolean isNative() {
         return Modifier.isNative(this.getModifiers());
     }
}
I assume that SPARK doesn't modify the modifiers of a native method if 
it handles the it. Am I right? Does the native simulation of SPARK 
handle all sideeffects of a native method (if it handles it)?

Regards,
Jochen

Am 09.02.2011 13:11, schrieb Eric Bodden:
> Hi Jochen.
>
> Yes that can be done. Spark has a native-method simulation framework.
>
> Look at this method for an example:
>
> soot.jimple.toolkits.pointer.nativemethods.JavaLangSystemNative.java_lang_System_arraycopy(SootMethod,
> ReferenceVariable, ReferenceVariable, ReferenceVariable[])
>
> All simulations are instantiated here:
> soot.jimple.toolkits.pointer.util.NativeMethodDriver
>
> Eric
>
>
> On 9 February 2011 13:00, Jochen Huck<jochen.huck at student.kit.edu>  wrote:
>> Hi,
>>
>> I use the sideeffect analysis to ensure that two statements have no
>> critical data dependencies. If one of these statements calls a native
>> method it must be assumed that there might be data dependencies. I just
>> wondered wheather it is possible to "inform" soot how to handle special
>> native methods (like System.arraycopy()). I would like to say something
>> like System.arraycopy(...) affects some points to sets - but the others
>> are not affected.
>>
>> Thanks,
>>
>> Jochen
>> _______________________________________________
>> Soot-list mailing list
>> Soot-list at sable.mcgill.ca
>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>
>
>



More information about the Soot-list mailing list