Hi Joel,
I'm currently trying to get up to speed with the codebase (I can read C++, but I'm not familiar with its idioms) and I'm wondering if it might be a good introduction to look into implementing arrays which store non-nullable types (e, g, Scala's AnyVals) without boxing them. (They will be boxed as soon as they are accessed.)
Considering the current architecture and the existing functionality, how hard would that task be?
From a data flow POV, one would need to know/compute the physical size of such a type in memory as the input and create a specialized array representation as the output. But I'm not sure whether unboxing those things into arrays will cause issues with the GC.
Thanks and bye,
Simon
PS: I'm currently compiling/testing Scala the way you described. :-)
--
You received this message because you are subscribed to the Google Groups "Avian" group.
To unsubscribe from this group and stop receiving emails from it, send an email to avian+un...@googlegroups.com.
To post to this group, send email to av...@googlegroups.com.
Visit this group at http://groups.google.com/group/avian?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Avian" group.
To unsubscribe from this group and stop receiving emails from it, send an email to avian+unsubscribe@googlegroups.com.
The easy way to get around that is to mark such types as always ineligable
for value type optimization; i.e. if a classloader can't provide a class
early enough for the compiler to decide whether it's a value type or not,
then it will be considered a reference type no matter what from then on,
even if it would otherwise qualify as a value type. This is enough of a
corner case that I think a conservative approach is reasonable. 99.99% of
the time, if a classloader can't find a class the first time the VM asks
for it, it will never find it.
Okay, this email is already way too long. I just wanted to let you know
I'm still thinking about this stuff and hope to start writing some code
soon.
BTW, I started working on invokedynamic support this past weekend. I was
hoping it would be pretty quick and easy, but it looks like the interface
with the VM for doing MethodHandle transformations is pretty complicated
and not well-documented, so I'll need to do more research to understand it
all.
I was stuck a long time because I didn't saw the
assert(t, classArrayElementSize(t, objectClass(t, array)) == BytesPerWord);
in objectArrayBody and was wondering why it didn't work. :-)
I'm still struggling with not having a nice readable stacktrace (and some missing frames in the debugger), but I'm starting to understand the language a lot better now.
Any hints/suggestions? Anything I'm missing?
* Just a note - makeArray, initArray, etc. are actually generated from types.def. You'll either have to modify that, modify the generator code (src/tools/type-generator), or find another approach.
* I'm not sure if the GC understands arrays with elements that are more than a word. This might require modifying some interfaces. (not that that should discourage you)
I think if there is a way to tell the GC that the array doesn't contain any references (like arrays of primitive types), that would be enough for now (let's ignore value types with reference members for now ...).
Anyway ... I'm still trying to figure out why the code seg faults ... it looks like as if the instructions generated in compile.cpp are not entirely correct in my code.