Re: [rvm-research] Introducing AllocationStrategy annotation

Robin Garner <[email protected]> Tue, 10 Jul 2018 11:54:59 +1000
Newsgroups gmane.comp.java.jikes.rvm.devel
Message-ID <[email protected]>
 > Isn't the @NonMoving annotation only used internal to the rvm?

yes.  But there's nothing stopping you from applying it (or any other 
vmmagic pragma) to user code.

> I don't think this would apply to my case,  or am I mistaking?

I would imagine you would implement it in the same way.  Your annotation is a pragma, too, just not in the org.vmmagic package.

Assuming your NVM implementation defines an MMTk Allocator, then your implementation is probably almost identical, in that an annotated 'new' results in a different allocator ID to be passed through to MMTk's 'alloc' method.

cheers


On 10/07/18 03:52, Ruben Peter Vervaeke wrote:
> Thank you for your answer. Isn't the @NonMoving annotation only used internal to the rvm? It's part of the 'magic' pragma I guess. I don't think this would apply to my case,  or am I mistaking?
>
>
> -----Oorspronkelijk bericht-----
> Van: Robin Garner <[email protected]>
> Verzonden: zondag 8 juli 2018 15:21
> Aan: [email protected]
> Onderwerp: Re: [rvm-research] Introducing AllocationStrategy annotation
>
> Take a look at the @NonMoving annotation.
>
> cheers
>
>
> On 08/07/18 00:34, Ruben Peter Vervaeke wrote:
>> Hi,
>>
>> My name is Ruben Vervaeke and I'm a Master student in Applied Computer
>> Science at the VUB in Belgium. For my thesis project I need to
>> introduce a new annotation in the JDK (provisionally called
>> AllocationStrategy). I need to make such an annotation available to
>> the runtime rvm. The idea is that a developer can hint to the rvm that
>> certain heap allocations will be written a lot or will be written once
>> (or few times). Using this information the rvm should be able to
>> decide a specific allocation plan for the object(s) in question. This
>> is to support a hybrid memory model that can switch between
>> conventional DRAM memory hardware and NVM-based memory hardware.
>>
>> The focus for me lies on making such an annotation available to the
>> rvm, so it can decide what allocation plan to use. Another PhD student
>> has already modified the rvm for supporting the hybrid memory model
>> (using conventional DRAM or NVM memory).
>>
>> My question is: is it possible to make such an annotation available to
>> the rvm at allocation-time? If so, what would be the steps to take to
>> achieve this?
>>
>> An initial challenge that comes to mind: how to add an annotation to
>> the JDK library and use it in the RVM codebase?
>>
>> The declaration of this annotation in the JDK would look like this:
>>
>> @Retention(RetentionPolicy.RUNTIME)
>>
>> @Target({ElementType.CONSTRUCTOR, ElementType.FIELD,
>> ElementType.TYPE})
>>
>> public @interface AllocationStrategy {
>>
>> MutationFrequency mutationFrequency();
>>
>> }
>>
>> public enum MutationFrequency {
>>
>>                  NONE,
>>
>>                  LOW,
>>
>>                  MID,
>>
>>                  HIGH;
>>
>> }
>>
>> The semantics of the annotation:
>>
>>    * CONSTRUCTOR: when declared on a specific constructor,
>>      instantiations of the class using that constructor would be
>>      allocated with NVM/DRAM in mind
>>    * FIELD: when declared on a field, instantiations of the class type
>>      that are immediately assigned to that field would be allocated
>>      with NVM/DRAM in mind
>>    * TYPE: when declared on a class, instantiations of that class would
>>      be allocated with NVM/DRAM in mind
>>
>>
>>
>> ----------------------------------------------------------------------
>> -------- Check out the vibrant tech community on one of the world's
>> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>
>>
>> _______________________________________________
>> Jikesrvm-researchers mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________
> Jikesrvm-researchers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Jikesrvm-researchers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jikesrvm-researchers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers