From http://www.arduino.cc/en/Reference/PortManipulation it was said PORTD can be used to control pin 0-7. However, sadly it does not work for me. digitalWrite and pinMode works well. But DDRD and PORTD has no response at all.
I start suspecting the document and trying other ports, and happily find PORTE works for pin 2-3. But not for the others. I think now it is time to test other ports and make a new mapping.
By testing, here's the ports corresponding to pin of Mega2560. It seems a little weird and I don't know why. If you have the same problem, I would suggest you to also try different PORT names on your board.
Hope this would help others that encounter the same problem.