Mad butter

Squashed commit of the following:

commit ee9d5399ddad3ac62215d19d065436a2f0b812c9
Author: Elliott Hughes <enh@google.com>
Date:   Wed Dec 19 15:45:18 2012 -0800

    Change NewDirectByteBuffer to allow NULL if capacity == 0.

    Also make the diagnostics more uniform.

    Bug: 7892060
    Change-Id: Ib3ca0d6241a5958d2c8681337b1883fc3d74cb54

commit a4f40c5bca5607f6a16c0e891f23e88a4189a11c
Author: You Kim <you.kim72@gmail.com>
Date:   Wed Dec 19 14:25:21 2012 +0900

    Optimize dvmHash Loops.

    pHashTable->tableSize is working as volatile variable & is evaluated on every iteration.
    Help compiler to define tableSize as local(Register) variable.

    Change-Id: Iecdea3ecb810319d461ff3924ef21fd6c2d69d1e

commit 9f09c7ee176bc81df4bf1cfa5a1f110df6d7784e
Author: You Kim <you.kim72@gmail.com>
Date:   Mon Dec 17 03:14:01 2012 +0900

    Remove possilbe leaks in dalvik.

    Add missing free() calls.

    Change-Id: Id602b84ba8f15fef1851f37e3d5aac214ac67de1

commit fa875c6d117536491caf806382c0dcdaa4ee82e3
Author: You Kim <you.kim72@gmail.com>
Date:   Mon Dec 17 02:36:44 2012 +0900

    Reclaiming attribute obj after pthread_create

    call pthread_attr_destroy in order to reclaim attribute object.

    Change-Id: I2592903ef67101a7c656a3ab0ad243a9716298b5

commit 6e01837707549c38aa185cbae8b4ae1a40505b18
Author: jwilson <jwilson@squareup.com>
Date:   Mon Dec 17 13:16:33 2012 -0500

    Fail if the new index is out of range.

    We were silently truncating, which made an obvious problem
    into a non-obvious one.

    Bug: http://code.google.com/p/android/issues/detail?id=40409
    Change-Id: I15576357c72ac0e98cf85c0a1d289fd5009468f9

commit e2aa91f59ac9ff75840e3e89d149d44b4b5ecabd
Author: Elliott Hughes <enh@google.com>
Date:   Mon Dec 17 09:21:54 2012 -0800

    Remove dead code.

    Change-Id: I56c27c510c8fc0ba2d8e691c788b433dce250f7a

commit fb4c3e1c54637dda72a689f3269cd139f7d8bb90
Author: Elliott Hughes <enh@google.com>
Date:   Fri Dec 14 17:27:24 2012 -0800

    Fix handling of annotations whose classes are missing at runtime.

    Bug: http://code.google.com/p/android/issues/detail?id=39854
    Change-Id: I3089b693ff3084b093f991f991ac9273dea7356d

commit 5d8472779d90cabba781e9be01952024132f69b4
Author: You Kim <you.kim72@gmail.com>
Date:   Tue Dec 18 00:14:07 2012 +0900

    Possible leak in dvmAllocRegion

    In error case mmapped ptr 'base' is not munmapped.

    Change-Id: I9e43841371fee6b7c092fe9a8922ae82e78805ed

commit 071cb91170af2151607dede17724a0111a784548
Author: You Kim <you.kim72@gmail.com>
Date:   Thu Nov 22 23:51:38 2012 +0900

    Optimize opcodes to avoid bubble in pipeline.

    Possible bubbles between fetch(ldr) and extract(and)
    Excute subsequent instruction(s) inbetween the bubble by reordering instruction.

    Change-Id: I76d89ed6bc4ca44673231375cc529fdbfd5a8030

commit f07612fa32bb15b4334bd2492327d7969bffeb84
Author: Elliott Hughes <enh@google.com>
Date:   Mon Dec 10 14:51:07 2012 -0800

    ExceptionInInitializerError should wrap only non Error exceptions.

    Backport from dalvik-dev, due to customer demand.

    Bug: http://code.google.com/p/android/issues/detail?id=41196
    Change-Id: I53ef57e54983f2173546463ac78e265ff5dd3284

commit 9c91431cd66a62eb03c8290b4025d1fcc533845e
Author: Elliott Hughes <enh@google.com>
Date:   Thu Dec 6 15:24:32 2012 -0800

    Remove dvmFindInterfaceMethodInCache2.

    We can just use dvmFindInterfaceMethodInCache directly.

    Change-Id: I2f3a660262ba7a39c05689df160ebdd2e7ec38a5

Change-Id: I04825dc697f5bc3da363a094fcc0387e652e111d