« Return to Thread: [rvm-research] to utilize methods in syscall

Re: [rvm-research] to utilize methods in syscall

by lltong :: Rate this Message:

Reply to Author | View in Thread

Thanks daniel,
Could you tell me it is where that the spaces are set up?
I mean, which class take in charge of initializing the attributes of spaces?
Thanks.

Daniel Frampton wrote:

> The spaces are set up at boot-image build time (running in a host
> JVM), as is all of the static initialization of MMTk classes. SysCalls
> are not meaningful at this stage.
>
> If you want to do something special with this memory, it might make sense to:
>
> 1. Reserve it at bootimage build time by creating a fixed size space
> 2. Call your routine to initialize this memory at boot time. This
> could be from C or Java code.
>
> Cheers,
> Daniel.
>
> On Fri, Jun 19, 2009 at 2:08 PM, Liangliang Tong<lltong@...> wrote:
>  
>> Dear Robin,
>>
>> Thanks for your reply.
>> I am just taking sysMalloc as an example, the actual method I called is
>> another custom allocation function implemented by myself. This function
>> applies special characteristics to the allocated memory chunk, which I
>> hope to use as a nursery space. Rawpagespace does not help.
>> In this case, what am I supposed to do in order to achieve my target?
>> Thanks.
>>
>> Regards,
>> Liangliang
>>
>> Robin Garner wrote:
>>    
>>> Liangliang Tong wrote:
>>>
>>>      
>>>> Dear all,
>>>>
>>>> In org.mmtk.plan.generational.Gen.java, I want to modify the vmRequest
>>>> to request for an explicit region of memory, like the following:
>>>>    private static final VMRequest vmRequest =
>>>> VMRequest.create(sysCall.sysMalloc(1 << 20),  Extent.fromIntSignExtend(1
>>>> << 20));
>>>> correspondingly I add a new import statement:
>>>>  import static org.jikesrvm.runtime.SysCall.sysCall;
>>>>
>>>> Yet when I complied the generational copy plan, it prompts these errors:
>>>> compile-mmtk:
>>>>     [javac] Compiling 1 source file to
>>>> /home/lltong/jikesrvm/target/mmtk/classes
>>>>     [javac]
>>>> /home/lltong/jikesrvm/MMTk/src/org/mmtk/plan/crgenerational/CRGen.java:33:
>>>> package org.jikesrvm.runtime does not exist
>>>>     [javac] import static org.jikesrvm.runtime.SysCall.sysCall;
>>>>     [javac]                                   ^
>>>>     [javac]
>>>> /home/lltong/jikesrvm/MMTk/src/org/mmtk/plan/crgenerational/CRGen.java:33:
>>>> static import only from classes and interfaces
>>>>     [javac] import static org.jikesrvm.runtime.SysCall.sysCall;
>>>>     [javac] ^
>>>>     [javac]
>>>> /home/lltong/jikesrvm/MMTk/src/org/mmtk/plan/crgenerational/CRGen.java:91:
>>>> cannot find symbol
>>>>     [javac] symbol  : variable sysCall
>>>>     [javac] location: class org.mmtk.plan.crgenerational.CRGen
>>>>
>>>> Why should this happen? Thanks in advance.
>>>>
>>>>
>>>>
>>>>        
>>> Hi Liangliang,
>>>
>>> As far as I can see, you are trying to request a 1MB chunk of memory,
>>> and you don't care where in the heap it is.  Is this right ?
>>>
>>>
>>> MMTk uses the 'Space' class to abstract over various ways to allocate
>>> memory.  If you simply want a 1MB chunk of raw memory, then you can do
>>>
>>>   RawPageSpace mySpace = new RawPageSpace("mySpace", Integer.MAX_VALUE,
>>> VMRequest.create());
>>>   Address chunkAddr = mySpace.acquire(1<<(20-LOG_BYTES_IN_PAGE));
>>>
>>> If you're using memory as storage for your collector, you should
>>> probably allocate it in the existing metaDataSpace.  If you're
>>> allocating it to give to the mutator, you should probably define a new
>>> space for it.
>>>
>>> Note that a VMRequest is simply a way to communicate your virtual memory
>>> layout requirements to the Space class, and passing it a chunk of
>>> 'malloc'ed memory doesn't make a great deal of sense.  In fact MMTk
>>> itself generally takes the place of 'malloc' in the virtual machine.
>>>
>>>
>>> The reason you can't directly call sysMalloc from MMTk is that MMTk
>>> separates itself from JikesRVM (and its various other host environments)
>>> via the org.mmtk.vm package (the VM interface).  In order to call a new
>>> method on the JikesRVM side of the fence you need to:
>>>
>>> - Choose an interface class to host the method (eg org.mmtk.vm.Memory)
>>> - Add an abstract method to the interface class
>>> - Add a concrete method to the implementation on the VM side of the
>>> fence (for JikesRVM that is org.jikesrvm.mm.mmtk, in the
>>> MMTk/ext/vm/jikesrvm directory)
>>>
>>> but I think it would generally be a bad idea for you to allocate memory
>>> for JikesRVM using sysMalloc.
>>>
>>> Regards,
>>> Robin
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Crystal Reports - New Free Runtime and 30 Day Trial
>>> Check out the new simplified licensing option that enables unlimited
>>> royalty-free distribution of the report engine for externally facing
>>> server and web deployment.
>>> http://p.sf.net/sfu/businessobjects
>>> _______________________________________________
>>> Jikesrvm-researchers mailing list
>>> Jikesrvm-researchers@...
>>> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers
>>>
>>>
>>>      
>> --
>> Regards,
>> Liangliang Tong
>>
>>
>> ------------------------------------------------------------------------------
>> Crystal Reports - New Free Runtime and 30 Day Trial
>> Check out the new simplified licensing option that enables unlimited
>> royalty-free distribution of the report engine for externally facing
>> server and web deployment.
>> http://p.sf.net/sfu/businessobjects
>> _______________________________________________
>> Jikesrvm-researchers mailing list
>> Jikesrvm-researchers@...
>> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers
>>
>>    
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Jikesrvm-researchers mailing list
> Jikesrvm-researchers@...
> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers
>
>  


--
Regards,
Liangliang Tong


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Jikesrvm-researchers mailing list
Jikesrvm-researchers@...
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers

 « Return to Thread: [rvm-research] to utilize methods in syscall