From: João S. <joa...@is...> - 2012-06-25 22:18:40
|
Greetings, I have added a word-sized field to the miscellaneous header of objects and would like to store object references in it. Unfortunately, the GC does not scan this field, which means the referenced objects are not kept alive. Is there a way I could overcome this problem or should I abandon the idea entirely? Thank you. João Silva |
From: Steve B. <Ste...@an...> - 2012-06-25 23:39:59
|
Hi João, Your idea sounds OK. The GC word won't be scanned because it not part of the object. I'm not sure exactly what you're doing, but you may be able to make things work via a simple hack to TraceLocal.scanObject() to explicitly trace your hidden field before (or after) the normal scan takes place (pass your pointer as an argument to the processEdge() method on the trace object). Try it out with a simple BaseBase system before testing it with production. --Steve On 26/06/2012, at 8:18 AM, João Silva wrote: > Greetings, > > I have added a word-sized field to the miscellaneous header of objects > and would like to store object references in it. > > Unfortunately, the GC does not scan this field, which means the > referenced objects are not kept alive. > > Is there a way I could overcome this problem or should I abandon the > idea entirely? > > Thank you. > > João Silva > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Jikesrvm-researchers mailing list > Jik...@li... > https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers |
From: Sam G. <sg...@cs...> - 2012-06-26 00:49:37
|
Hi Joao, We had to do something similar for one of our projects. Here's what we did: We added a method to ObjectModel (MMTk/ext/vm/jikesrvm/org/jikesrvm/mm/mmtk/ObjectModel.java) to trace the extra word (which is called the "forwarding word" in our project): /** * Trace forwarding word in object header * * @param object The object whose forwarding word to trace * @param trace The trace to use */ @Inline public void traceForwardingWord(ObjectReference object, TraceLocal trace) { Address slot = object.toAddress().plus(MiscHeader.FORWARDING_WORD_OFFSET); trace.processEdge(object, slot); } We called this method at the end of scanObject in org.mmtk.plan.TraceLocal: protected void scanObject(ObjectReference object) { if (specializedScan >= 0) { VM.scanning.specializedScanObject(specializedScan, this, object); } else { VM.scanning.scanObject(this, object); } VM.objectModel.traceForwardingWord(object, this); } Maybe Steve can comment on whether that strategy is good, from an MMTk achitecture standpoint. -Sam On Mon, Jun 25, 2012 at 7:39 PM, Steve Blackburn <Ste...@an... > wrote: > Hi João, > > Your idea sounds OK. The GC word won't be scanned because it not part of > the object. I'm not sure exactly what you're doing, but you may be able > to make things work via a simple hack to TraceLocal.scanObject() to > explicitly trace your hidden field before (or after) the normal scan takes > place (pass your pointer as an argument to the processEdge() method on the > trace object). Try it out with a simple BaseBase system before testing it > with production. > > --Steve > > > On 26/06/2012, at 8:18 AM, João Silva wrote: > > > Greetings, > > > > I have added a word-sized field to the miscellaneous header of objects > > and would like to store object references in it. > > > > Unfortunately, the GC does not scan this field, which means the > > referenced objects are not kept alive. > > > > Is there a way I could overcome this problem or should I abandon the > > idea entirely? > > > > Thank you. > > > > João Silva > > > > > ------------------------------------------------------------------------------ > > Live Security Virtual Conference > > Exclusive live event will cover all the ways today's security and > > threat landscape has changed and how IT managers can respond. Discussions > > will include endpoint security, mobile security and the latest in malware > > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > _______________________________________________ > > Jikesrvm-researchers mailing list > > Jik...@li... > > https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Jikesrvm-researchers mailing list > Jik...@li... > https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers > -- Samuel Z. Guyer Assistant Professor Dept of Computer Science Tufts University |
From: Steve B. <Ste...@an...> - 2012-06-26 01:09:37
|
Hi Sam, That's pretty much exactly what I had in mind. :-) Whether it is the best strategy, I can't say, but it seems like a reasonable place to start! --Steve On 26/06/2012, at 10:49 AM, Sam Guyer wrote: > Hi Joao, > > We had to do something similar for one of our projects. Here's what we did: > > We added a method to ObjectModel (MMTk/ext/vm/jikesrvm/org/jikesrvm/mm/mmtk/ObjectModel.java) to trace the extra word (which is called the "forwarding word" in our project): > > /** > * Trace forwarding word in object header > * > * @param object The object whose forwarding word to trace > * @param trace The trace to use > */ > @Inline > public void traceForwardingWord(ObjectReference object, TraceLocal trace) { > Address slot = object.toAddress().plus(MiscHeader.FORWARDING_WORD_OFFSET); > trace.processEdge(object, slot); > } > > We called this method at the end of scanObject in org.mmtk.plan.TraceLocal: > > protected void scanObject(ObjectReference object) { > if (specializedScan >= 0) { > VM.scanning.specializedScanObject(specializedScan, this, object); > } else { > VM.scanning.scanObject(this, object); > } > VM.objectModel.traceForwardingWord(object, this); > } > > Maybe Steve can comment on whether that strategy is good, from an MMTk achitecture standpoint. > > -Sam > > On Mon, Jun 25, 2012 at 7:39 PM, Steve Blackburn <Ste...@an...> wrote: > Hi João, > > Your idea sounds OK. The GC word won't be scanned because it not part of the object. I'm not sure exactly what you're doing, but you may be able to make things work via a simple hack to TraceLocal.scanObject() to explicitly trace your hidden field before (or after) the normal scan takes place (pass your pointer as an argument to the processEdge() method on the trace object). Try it out with a simple BaseBase system before testing it with production. > > --Steve > > > On 26/06/2012, at 8:18 AM, João Silva wrote: > > > Greetings, > > > > I have added a word-sized field to the miscellaneous header of objects > > and would like to store object references in it. > > > > Unfortunately, the GC does not scan this field, which means the > > referenced objects are not kept alive. > > > > Is there a way I could overcome this problem or should I abandon the > > idea entirely? > > > > Thank you. > > > > João Silva > > > > ------------------------------------------------------------------------------ > > Live Security Virtual Conference > > Exclusive live event will cover all the ways today's security and > > threat landscape has changed and how IT managers can respond. Discussions > > will include endpoint security, mobile security and the latest in malware > > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > _______________________________________________ > > Jikesrvm-researchers mailing list > > Jik...@li... > > https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Jikesrvm-researchers mailing list > Jik...@li... > https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers > > > > -- > Samuel Z. Guyer > Assistant Professor > Dept of Computer Science > Tufts University > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ > Jikesrvm-researchers mailing list > Jik...@li... > https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers |
From: João S. <joa...@is...> - 2012-06-26 01:22:25
|
Hi Steve and Sam, It does seem a bit hacky, but it will do just fine for me. Thanks a lot. --João On 26-06-2012 02:09, Steve Blackburn wrote: > Hi Sam, > > That's pretty much exactly what I had in mind. :-) Whether it is > the best strategy, I can't say, but it seems like a reasonable place > to start! > > --Steve > > On 26/06/2012, at 10:49 AM, Sam Guyer wrote: > >> Hi Joao, >> >> We had to do something similar for one of our projects. Here's what >> we did: >> >> We added a method to ObjectModel >> (MMTk/ext/vm/jikesrvm/org/jikesrvm/mm/mmtk/ObjectModel.java) to trace >> the extra word (which is called the "forwarding word" in our project): >> >> /** >> * Trace forwarding word in object header >> * >> * @param object The object whose forwarding word to trace >> * @param trace The trace to use >> */ >> @Inline >> public void traceForwardingWord(ObjectReference object, TraceLocal >> trace) { >> Address slot = >> object.toAddress().plus(MiscHeader.FORWARDING_WORD_OFFSET); >> trace.processEdge(object, slot); >> } >> >> We called this method at the end of scanObject in >> org.mmtk.plan.TraceLocal: >> >> protected void scanObject(ObjectReference object) { >> if (specializedScan >= 0) { >> VM.scanning.specializedScanObject(specializedScan, this, object); >> } else { >> VM.scanning.scanObject(this, object); >> } >> VM.objectModel.traceForwardingWord(object, this); >> } >> >> Maybe Steve can comment on whether that strategy is good, from an >> MMTk achitecture standpoint. >> >> -Sam >> >> On Mon, Jun 25, 2012 at 7:39 PM, Steve Blackburn >> <Ste...@an... <mailto:Ste...@an...>> wrote: >> >> Hi João, >> >> Your idea sounds OK. The GC word won't be scanned because it >> not part of the object. I'm not sure exactly what you're doing, >> but you may be able to make things work via a simple hack to >> TraceLocal.scanObject() to explicitly trace your hidden field >> before (or after) the normal scan takes place (pass your pointer >> as an argument to the processEdge() method on the trace object). >> Try it out with a simple BaseBase system before testing it with >> production. >> >> --Steve >> >> >> On 26/06/2012, at 8:18 AM, João Silva wrote: >> >> > Greetings, >> > >> > I have added a word-sized field to the miscellaneous header of >> objects >> > and would like to store object references in it. >> > >> > Unfortunately, the GC does not scan this field, which means the >> > referenced objects are not kept alive. >> > >> > Is there a way I could overcome this problem or should I >> abandon the >> > idea entirely? >> > >> > Thank you. >> > >> > João Silva >> > >> > >> ------------------------------------------------------------------------------ >> > Live Security Virtual Conference >> > Exclusive live event will cover all the ways today's security and >> > threat landscape has changed and how IT managers can respond. >> Discussions >> > will include endpoint security, mobile security and the latest >> in malware >> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> > _______________________________________________ >> > Jikesrvm-researchers mailing list >> > Jik...@li... >> <mailto:Jik...@li...> >> > https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. >> Discussions >> will include endpoint security, mobile security and the latest in >> malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Jikesrvm-researchers mailing list >> Jik...@li... >> <mailto:Jik...@li...> >> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers >> >> >> >> >> -- >> Samuel Z. Guyer >> Assistant Professor >> Dept of Computer Science >> Tufts University >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. >> Discussions >> will include endpoint security, mobile security and the latest in >> malware >> threats. >> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ >> Jikesrvm-researchers mailing list >> Jik...@li... >> <mailto:Jik...@li...> >> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > > _______________________________________________ > Jikesrvm-researchers mailing list > Jik...@li... > https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers |
From: Robin G. <rob...@gm...> - 2012-06-26 01:52:21
|
I guess your other approach would be to add an additional offset to the GC map of every object. You would then need to disable all of the scanning optimizations, as they have pervasive assumptions that the minimum offset is the first field of a scalar. This is by far the least impact approach. cheers, Robin On 26/06/12 11:22, João Silva wrote: > Hi Steve and Sam, > > It does seem a bit hacky, but it will do just fine for me. > > Thanks a lot. > > --João > > On 26-06-2012 02:09, Steve Blackburn wrote: >> Hi Sam, >> >> That's pretty much exactly what I had in mind. :-) Whether it is >> the best strategy, I can't say, but it seems like a reasonable place >> to start! >> >> --Steve >> >> On 26/06/2012, at 10:49 AM, Sam Guyer wrote: >> >>> Hi Joao, >>> >>> We had to do something similar for one of our projects. Here's what >>> we did: >>> >>> We added a method to ObjectModel >>> (MMTk/ext/vm/jikesrvm/org/jikesrvm/mm/mmtk/ObjectModel.java) to >>> trace the extra word (which is called the "forwarding word" in our >>> project): >>> >>> /** >>> >>> * Trace forwarding word in object header >>> >>> * >>> >>> * @param object The object whose forwarding word to trace >>> >>> * @param trace The trace to use >>> >>> */ >>> >>> @Inline >>> >>> public void traceForwardingWord(ObjectReference object, TraceLocal >>> trace) { >>> Address slot = >>> object.toAddress().plus(MiscHeader.FORWARDING_WORD_OFFSET); >>> >>> trace.processEdge(object, slot); >>> >>> } >>> >>> We called this method at the end of scanObject in >>> org.mmtk.plan.TraceLocal: >>> >>> protected void scanObject(ObjectReference object) { >>> if (specializedScan >= 0) { >>> VM.scanning.specializedScanObject(specializedScan, this, object); >>> } else { >>> VM.scanning.scanObject(this, object); >>> } >>> VM.objectModel.traceForwardingWord(object, this); >>> } >>> >>> Maybe Steve can comment on whether that strategy is good, from an >>> MMTk achitecture standpoint. >>> >>> -Sam >>> >>> On Mon, Jun 25, 2012 at 7:39 PM, Steve Blackburn >>> <Ste...@an... <mailto:Ste...@an...>> wrote: >>> >>> Hi João, >>> >>> Your idea sounds OK. The GC word won't be scanned because it >>> not part of the object. I'm not sure exactly what you're >>> doing, but you may be able to make things work via a simple hack >>> to TraceLocal.scanObject() to explicitly trace your hidden field >>> before (or after) the normal scan takes place (pass your pointer >>> as an argument to the processEdge() method on the trace object). >>> Try it out with a simple BaseBase system before testing it >>> with production. >>> >>> --Steve >>> >>> >>> On 26/06/2012, at 8:18 AM, João Silva wrote: >>> >>> > Greetings, >>> > >>> > I have added a word-sized field to the miscellaneous header of >>> objects >>> > and would like to store object references in it. >>> > >>> > Unfortunately, the GC does not scan this field, which means the >>> > referenced objects are not kept alive. >>> > >>> > Is there a way I could overcome this problem or should I >>> abandon the >>> > idea entirely? >>> > >>> > Thank you. >>> > >>> > João Silva >>> > >>> > >>> ------------------------------------------------------------------------------ >>> > Live Security Virtual Conference >>> > Exclusive live event will cover all the ways today's security and >>> > threat landscape has changed and how IT managers can respond. >>> Discussions >>> > will include endpoint security, mobile security and the latest >>> in malware >>> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> > _______________________________________________ >>> > Jikesrvm-researchers mailing list >>> > Jik...@li... >>> <mailto:Jik...@li...> >>> > https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers >>> >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. >>> Discussions >>> will include endpoint security, mobile security and the latest >>> in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> Jikesrvm-researchers mailing list >>> Jik...@li... >>> <mailto:Jik...@li...> >>> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers >>> >>> >>> >>> >>> -- >>> Samuel Z. Guyer >>> Assistant Professor >>> Dept of Computer Science >>> Tufts University >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. >>> Discussions >>> will include endpoint security, mobile security and the latest in >>> malware >>> threats. >>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ >>> Jikesrvm-researchers mailing list >>> Jik...@li... >>> <mailto:Jik...@li...> >>> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers >> >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> >> >> _______________________________________________ >> Jikesrvm-researchers mailing list >> Jik...@li... >> https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers > > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > > _______________________________________________ > Jikesrvm-researchers mailing list > Jik...@li... > https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers |