The world’s biggest oil companies are benefiting from the high commodity prices that have been a drag on the rest of the economy.