Japanese ​shares extended their rally for a ​second session on Wednesday, as investors bought beaten-down stocks, ​and worries eased about global oil supplies amid the Middle East conflict.