I have an analogy here for anyone still confused about this part - over
which
Oracle were clearly trying to cause confusion.
Consider the Bible.
It has a very clear structure to it - a series of books
identified by name and
arranged in a consistent sequence, each of which
contains a number of chapters,
each of which contains a number of verses.
You could store any normal
edition of the Bible - or analogous texts - in the
following Java
class:
class Bible {
public String[] bookNames;
public String[][][] verses;
};
This simply means that we
have an array of books which is an array of
chapters which is an array of
verses, and each book has a name.
If we now refer to a particular verse as,
for example, "John 11:35", that is what
we would call a "symbolic reference".
After parsing the string to extract the
book name ("John"), we need to search
the bookNames array to discover
which index in the "book" level of the array
corresponds to that named
chapter. This is what is referred to as "resolving"
the reference.
Once we have the index into the book level, we also need to
follow the index
into the chapter level, and then the index into the verse
level of the arrays.
We have numeric references here, so this is not a
symbolic
reference, but what we call an "indirect reference". We have to
"indirect"
through several levels of the table before we find the data we are
looking for.
Indirect references are very common and have been
hardware-supported in
ordinary CPUs at least since the late 1970s (6502, 68000
both released before
1980).
After all that, we are given a pointer to a
String object, which - hopefully -
contains "Jesus wept.", at least for a
standard Bible. This short text is the
"actual data" or "actual field
data".
The pointer to that String object, once obtained, can be stored
elsewhere as a
"direct reference". A priest could make a new array with a
series of these
pointers as a passage to read during his sermon - analogous to
a bookmark.
The text is not duplicated, we just have a much more direct method
of getting
there.
However, the priest can't give such a reference directly
to the congregation for
them to read along - the verses will probably be on
different pages in a
different printing, or maybe the verses themselves are
slightly different if
someone has a different edition of the Bible. But the
indexes of books,
chapters and verses will be the same, so the priest can hand
out either the
symbolic reference as above, or an indirect reference as defined
below:
class BiblePassage {
int book, chapter,
firstVerse, lastVerse;
}
Google's contention is simply
that Dalvik uses only this form of reference after
dexopt has run, and that
dexopt is not run while the application it is
operating on is
running.
So symbolic references exist before dexopt is run, but not
afterwards - they
have all been resolved into direct and indirect references.
And while the
application is running, only direct and indirect references are
in use at the VM
level, not symbolic references.
Hope this is now clearer. [ Reply to This | Parent | # ]
|