Hm, I don't think this is the right approach. And didn't we decide that we delay
this for now, because visualization is way more important?

Anyway, here's what I'd suggest:

1. Put the stuff in src/compiler/division-by-constant.{cc,h}
2. Rename to DivisionByConstant, MultiplierAndShift is not very useful name.
3. Add unit tests first, before writing the actual implementation (right now we
only assume that it's correct, at least for the code paths not used in
Crankshaft).
4. I would not even touch the existing code in the MacroAssemblers, but instead
add a TODO, that TruncatingDiv should be removed once Turbofan replaces
Crankshaft to a certain degree (i.e. I don't think this optimization is really
required once all asm.js code runs through Turbofan).
5. Use stuff inside the MachineOperatorReducer, again with tests to cover the
basics. Maybe add stress tests to cover everything.

Thinking more about it, we could even encapsulate everything inside the
MachineOperatorReducer, because it's local to it and still properly test it
(avoids duplication of tests). But then again, we should probably delay working
on this, I dunno.

https://codereview.chromium.org/532003004/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to