[Soot-list] Fast Lookup of SootMethod/SootMethodRef

Marc-Andre Laverdiere-Papineau marc-andre.laverdiere-papineau at polymtl.ca
Thu Feb 28 11:46:46 EST 2013


Hello,

Just to make sure that I am very clear... I was talking about SootMethod 
or SootMethodRef objects.

EquivalentValue wrappers are meant for Value objects, so I wasn't able 
to use that. Porting it would be trivial, I guess. But SootMethod has 
equivHashCode, but not equivEquals. Not sure it is a problem, but anyways...

SootMethod.getNumber() returns some kind of int, but I don't know what 
it really stands for. The only call I to setNumber is ArrayNumberer - 
which apparently gives numbers to store in bit sets. But since I don't 
know the internal design of Soot, I wanted to know if I have a guarantee 
that those are set by the time I run my code in wjtp?

Regards,

Marc-André Laverdière-Papineau
Doctorant - PhD Candidate

On 13-02-28 11:37 AM, Eric Bodden wrote:
>> What about their numbers? Are those guaranteed to be unique? If so, then
>> lookups would be very fast.
>
> Do they have numbers? As in StringNumberer? If so then yes, they
> should be unique I guess.
>
> Cheers,
> Eric
>
>>
>>
>> Marc-André Laverdière-Papineau
>> Doctorant - PhD Candidate
>>
>> On 13-02-28 03:30 AM, Eric Bodden wrote:
>>>
>>> I think the reason for the current behavior is that there are some
>>> algorithms in Soot which really like to keep multiple "equal" method
>>> refs apart, even when they are stored in structures like hash sets.
>>> But if you wrap them into EquivalentValue wrappers then this should
>>> actually work. This wrapper dispatches equals/hashCode to special
>>> "equivTo" methods.
>>>
>>> Eric
>>>
>>> On 27 February 2013 20:03, Marc-Andre Laverdiere-Papineau
>>> <marc-andre.laverdiere-papineau at polymtl.ca> wrote:
>>>>
>>>> Hello,
>>>>
>>>> I want to check against a whitelist of methods, and I stored
>>>> SootMethodRef instances in a big HashSet.
>>>>
>>>> Weirdly enough, using set.contains(), I kept on getting false.
>>>>
>>>> I looked into the implementation, and it seems like equals and hashcode
>>>> are not implemented.
>>>>
>>>> Is this something that was left out voluntarily?
>>>>
>>>> Should I use a set or bit set with getNumber()? Are those numbers
>>>> guaranteed to have no collisions?
>>>>
>>>> Otherwise, what is the fast way to do such lookups?
>>>>
>>>> Regards,
>>>>
>>>> --
>>>> Marc-André Laverdière-Papineau
>>>> Doctorant - PhD Candidate
>>>> _______________________________________________
>>>> 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