diff options
author | Dan Bornstein <danfuzz@android.com> | 2011-03-11 12:58:05 -0800 |
---|---|---|
committer | Dan Bornstein <danfuzz@android.com> | 2011-03-11 16:30:30 -0800 |
commit | a9c49df6714b3a37b7a7d0522932e622be2b35ac (patch) | |
tree | ec5a1abdb2e5253099ec97d81ae47de32d6e5d9b /vm/Globals.h | |
parent | c3bdf1cc467ef4ac876b697ed1bcfe3e420f0ae2 (diff) | |
download | android_dalvik-a9c49df6714b3a37b7a7d0522932e622be2b35ac.tar.gz android_dalvik-a9c49df6714b3a37b7a7d0522932e622be2b35ac.tar.bz2 android_dalvik-a9c49df6714b3a37b7a7d0522932e622be2b35ac.zip |
Clean up how primitive types are handled.
The PrimitiveType enum got "promoted" to libdex, and I added a
few helper functions there. I also quashed the idea that there
is some sort of canonical ordering of the enumerated values.
In the vm (per se), I made PrimitiveType uses where it had assumed
an ordering instead switch(). This mostly made things much simpler.
I also split out the array of type classes in Globals.h into
individual ClassObject*s. This mostly made things simpler, but the gc
got a tiny bit of extra cruft because of it.
Finally, I made it so that the type classes get created explicitly
during vm startup, instead of happening implicitly the first time
they're accessed. This both simplified the code and, in particular,
made it so that the type classes didn't have to be declared volatile.
There are still a couple of related items that could stand to be
cleaned up, but I think what's here is enough for one patch.
Change-Id: Id14a6dfdb200abce9f30911c330ba32d9c2a4c3f
Diffstat (limited to 'vm/Globals.h')
-rw-r--r-- | vm/Globals.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/vm/Globals.h b/vm/Globals.h index 28cd17317..813373cc5 100644 --- a/vm/Globals.h +++ b/vm/Globals.h @@ -306,6 +306,17 @@ struct DvmGlobals { ClassObject* exVerifyError; ClassObject* exVirtualMachineError; + /* synthetic classes representing primitive types */ + ClassObject* typeVoid; + ClassObject* typeBoolean; + ClassObject* typeByte; + ClassObject* typeShort; + ClassObject* typeChar; + ClassObject* typeInt; + ClassObject* typeLong; + ClassObject* typeFloat; + ClassObject* typeDouble; + /* synthetic classes for arrays of primitives */ ClassObject* classArrayBoolean; ClassObject* classArrayChar; @@ -399,11 +410,6 @@ struct DvmGlobals { int offJavaNioBuffer_effectiveDirectAddress; /* - * VM-synthesized primitive classes, for arrays and reflection - */ - ClassObject* volatile primitiveClass[PRIM_MAX]; - - /* * Thread list. This always has at least one element in it (main), * and main is always the first entry. * |