Hi. I'm new to v8 development, so forgive me if I misstate anything. In an effort to understand code generation better, I'm trying to implement some of the missing ARM functionality during lithium code generation. In particular, I thought implementing the integer MOD operator would be a good start. The first approach I'm taking is to simply call a stub which will evaluate the operation. Here's what I did (and then soon after I'll explain the error I'm getting):
1. Modified LCodeGen::DoModI() by removing the Abort() and replacing it with a) __mov instructions to get the operands into registers r0 and r1, and b) Instantiating GenericBinaryOpStub and then calling CallCode() on it. 2. In LChunkBuilder::DoMod() I added a "MarkAsCall()", so that the MOD is treated as a call. Note, I made several of these changes incremenatlly after observing various assertion failures, so I very well could be taking a completely incorrect approach here. Anyways, I'm now getting an assert during register allocation while splitting a live range: # # Fatal error in src/lithium-allocator.cc, line 2009 (LAllocator::FindOptimalSplitPos()) # CHECK(start_instr <= end_instr) failed # So my first question is, is this a viable approach? I suspect this isn't what we want to do, since the code size of this stub isn't small, but I just wanted to get it working, so that optimization doesn't throttle back for the whole function if an integer mod is seen. Secondly, any ideas on what I'm missing or doing incorrectly? Thanks a lot. - Shasank -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
