Location of object in OSL
This functionality still not supported. And will not in the near future - see developers answer here https://developer.blender.org/T52154

But you can "Bake" scene objects into OSL script and query object parameters in material nodes later. There is even addon for that:
https://github.com/IPv6/kristallum/blob/master/blender/addons/sceneFeatBaker_v01.py

It creates text block with OSL shader (or replace existing one), that can find object location, dimensions, orientation, etc during render by name and/or name prefix. For direct use in material nodes