Weldon, I agree that we need TLS access in vmmagic, but I thought about slightly different and more primitive implementation. Writing something like this: SegmentRegisterFS segFs = new SegmentRegisterFS(); or this: SegmentRegisterGS segGs = new SegmentRegisterGS();
we add the knowledge of the platform to Java code. (+ 'new' operation is not used (constructor is private) for the most of the MMTk types) My proposal is to write something like this: Address addr = TLS.getAddressByOffset(offset_in_TLS) and to forget about platform related problems. Leave it to JIT or VM to decide how to access to TLS on particular platform. Egor, Why do you think we need to support platform specific issues in helpers? Is there any example that shows that we can't write a helper without reference platform details? I think we should avoid #ifdef's in Java as much as we can. -- Mikhail Fursov