[art] Factor out encoding ClassLoaderContext components

These factored out utility functions are useful to encode a partial
class loader context. The end goal here is to serialize the correct
classloader contexts from the runtime and send those to DexLoadReporter
so that we don't depend on divergent behavior.

Test: m test-art-host-gtest-class_loader_context_test

Change-Id: I81a32ad7cc4aba7147ed191ccf12c9839386a9cc
2 files changed