summaryrefslogtreecommitdiff
path: root/src/image.h
AgeCommit message (Collapse)Author
2013-07-12Create separate Android.mk for main build targets Brian Carlstrom
The runtime, compiler, dex2oat, and oatdump now are in seperate trees to prevent dependency creep. They can now be individually built without rebuilding the rest of the art projects. dalvikvm and jdwpspy were already this way. Builds in the art directory should behave as before, building everything including tests. Change-Id: Ic6b1151e5ed0f823c3dd301afd2b13eb2d8feb81
2013-04-26Removing remaining compiled stubs from image. Jeff Hao
Abstract method error stub and jni dlsym lookup stubs are gone. After this change, the image no longer needs to be executable. Change-Id: Ic75d72bf7e76e3b8ecc596e82af68ab592dde15e
2013-04-23Removed compiled resolution trampoline. Jeff Hao
Created assembly versions of resolution trampoline for portable and quick. Removed compiled version from the image. Change-Id: I183e110c4e102fb45ce6e7f4e855f8bed7986251
2013-01-30Directory restructuring of object.h Ian Rogers
Break object.h into constituent files. Reduce number of #includes in other GC header files. Introduce -inl.h files to avoid mirror files #include-ing each other. Check invariants of verifier RegTypes for all constructors. Change-Id: Iecf1171c02910ac152d52947330ef456df4043bc
2013-01-25Move .oat files to ELF format Brian Carlstrom
Generates .oat in ELF file format using MCLinker - Uses MCLinker IRBuilder to create a synthetic .o from OatWriter output. - Uses new ElfFile for prelinking to support art image optimizations. Adapted OatFile to load using dlopen, ElfFile, or memory, removing raw MemMap mechanism. Changed image code to not assume oat data will be immediately after image to allow space for ELF headers. Passes test-art and works with installd. Change-Id: Idc026eddb5de93f4b97490c405f3ed7b39589749
2012-11-27Add alignment attribute to packed. Ian Rogers
Make packed objects 4 byte aligned or else GCC becomes paranoid and assumes only byte alignment on whole objects. Change CHECK in GetCalleeSaveMethod to DCHECK to encourage inlining. Change-Id: I79f1a13752492413c919b36f4e207e637647834f
2012-10-18Update image oat checksum when patching Brian Carlstrom
Change-Id: I766d2745bc817a5cb3a36d62bc733bab43a31fe0
2012-09-05Rename GlobalSynchronization to Locks Ian Rogers
Also address some review comments in common_throws relating to ToStr<InvokeType> and exception detail messages. Change-Id: Ibf2c0f147689fa236d349bd7f01eed3c2522552b
2012-08-14Global lock levels. Ian Rogers
Introduce the notion of the mutators/GC being a shared-exclusive (aka reader-writer) lock. Introduce globally ordered locks, analysable by annotalysis, statically at compile time. Add locking attributes to methods. More subtly, remove the heap_lock_ and split between various locks that are held for smaller periods (where work doesn't get blocked). Remove buggy Dalvik style thread transitions. Make GC use CMS in all cases when concurrent is enabled. Fix bug where suspend counts rather than debug suspend counts were sent to JDWP. Move the PathClassLoader to WellKnownClasses. In debugger refactor calls to send request and possibly suspend. Break apart different VmWait thread states. Move identity hash code to a shared method. Change-Id: Icdbfc3ce3fcccd14341860ac7305d8e97b51f5c6
2012-03-05Sharpen virtual calls to final methods. Ian Rogers
Also remove unused instance resolution stub. Change-Id: I2abb988d107e98ac0148fb81464b22622a468382
2012-03-02Extra verbosity and disassembler for oatdump Ian Rogers
Disassembler for thumb2 instructions. Print outlying methods for ART files. Find oat code methods that require trampolines. Fix accounting of code and which file contains which bytes. Dump oat meta-data. Change-Id: I10f52a4841f57a3f65d61ce0d1bb71bb4eb9f595
2012-02-27Invoke static/direct dispatch change. Ian Rogers
There was a subtle race in static/direct dispatch via the code and methods table. This patch removes the table in preparation of architectures like x86 which will more aggressively sink loads. Removes unused fields, code.. Brings back resolved methods table short-cut and associated fast paths to use this (such as in Proxy). Adds a resolution method that is used as the trampoline for static and direct methods. Add source file and line number to Throwable::Dump. MethodHelper knowledge of runtime methods. Change-Id: Ieae1b74c24072e6327a5bb2cad466f04e3c46c4d
2012-01-30Fix copyright headers. Elliott Hughes
Change-Id: I5b7bc76a370238d810d78522bd5531600746700f
2012-01-26Upgrade to latest dlmalloc. Refactor Heap and related APIs to use STL like ↵ Ian Rogers
naming. We fail assertions in the existing heap code, as does Dalvik. This refactoring is to clean the heap and space APIs and to reduce duplication of data and thereby solve a failing assertion in the card table. This change also wires up clearing of soft references including before out-of-memory errors are reported. In doing this change it was made clear that mspaces are buggy (and violating invariants with the garbage collector). This change upgrades to an un-Android molested version of dlmalloc-2.8.5 and implements a version of the mspace morecore routine under ART control. run-test 061-out-of-memory is updated for current heap sizes. Change-Id: I377e83ab2a8c78afb9b1881f03356929e2c9dc64
2011-10-10Working ClassLoader Brian Carlstrom
Change-Id: Ia1122165e47f846a1d4506111849f830d9f14c1b
2011-10-07Spill possibly reference holding registers for runtime calls. Ian Rogers
Live references may be in registers when we crawl a stack for GC during a runtime call. Whilst an exception won't occur we need to save the callee save registers into the frame so the stack crawl can find their values. Create variants of the callee save method to save just the registers that are necessary. Change-Id: I6fa479bffcbc333fe846f9bd3ef2e626e0209ed9
2011-10-06Support for resolving unknown direct/static methods. Ian Rogers
If we can't resolve a method we don't know whether it is direct or static from the dex information (other than the invocation instruction). Add support for a third type of resolution stub that can discover the type of the method based on the calling method and PC of the invocation instruction. Its still unimplemented to look up the instruction and figure out if the type is static or not. Change-Id: I8b76e6ba2c946376e7fe287dbcca17bcaab0e133
2011-10-05Static and direct resolution stub. Ian Rogers
Ensure that invoke static and direct go through a stub that causes resolution and initialization. Change-Id: I872900560322817d8f4378b04ac410d9ea0b3b17
2011-10-04Make class roots an image root Brian Carlstrom
Change-Id: I1f1513bf34caa736c0dd7518a92f493b4573d776
2011-10-04Simplify command line arguments Brian Carlstrom
Change-Id: I9d6902b0c447fd8fbe5600fd36139791b2ceefb7
2011-10-03Separate oat from image Brian Carlstrom
Change-Id: If2abdb99826ead14e3465d90ba2acffd89709389
2011-09-22Class cast, fill array and interface exception support. Ian Rogers
This change uses the deliver exception mechanism to implement support for a number of runtime exceptions. It also tidies up code in the compiler and allocates a singular callee save method in the image. Also adds a fix for JNI internal test where we weren't passing Thread::Current() and that this value is now being used in generated code. Change-Id: I57eefd9afe40e92fa3a7e737f1a2ed7e1094b5c1
2011-09-16oatdump Brian Carlstrom
FROM MAKE: mm dump-boot-oat ON HOST: oatdump --dex-file=$ANDROID_PRODUCT_OUT/system/framework/core.jar --image=$ANDROID_PRODUCT_OUT/system/framework/boot.oat --strip-prefix=$ANDROID_PRODUCT_OUT oatdump --boot-dex-file=$ANDROID_PRODUCT_OUT/system/framework/core.jar --boot=$ANDROID_PRODUCT_OUT/system/framework/boot.oat --dex-file=$ANDROID_PRODUCT_OUT/system/framework/art-test-dex-HelloWorld.jar --image=$ANDROID_PRODUCT_OUT//system/framework/art-test-dex-HelloWorld.oat --strip-prefix=$ANDROID_PRODUCT_OUT ON TARGET: adb shell oatdump --dex-file=/system/framework/core.jar --image=/system/framework/boot.oat adb shell oatdumpd --boot-dex-file=/system/framework/core.jar --boot=/system/framework/boot.oat --dex-file=/system/framework/art-test-dex-HelloWorld.jar --image=/system/framework/art-test-dex-HelloWorld.oat Change-Id: Iad2ae40a9cf2dc28799ff5dc5222d50f1bc6b39f
2011-09-15Add oat file generation and tests to build Brian Carlstrom
- Currently builds boot.oat for host and target and target oat files for art tests. - Added cross compilation support via --strip-prefix option to dex2oat - Reduced output to prevent build log spam (Compiler::verbose_) - Added image roots for recovering important pointers on image load - Redid JNI stub creation and made the stub array an image root - Fixed JNI stub test by making JNI stub array executable - Fixed JNI UnregisterNative to having it reinstall the JNI stub - Fixed ARM JNI stub to generate PIC code (with irogers) - Fixed JniCompiler to generate PIC code (with irogers) - Fixed FindNativeMethod to handle recursive calls - Finished checkFieldType to use Object::InstanceOf - Fixed thread unsafe access to ClassLinker::{dex_files_,dex_caches_} - Added ResolvedMethod variant for use with Method* for context - Fixed ImageWriter to call FixupMethod - Fixed ImageWriter to rewrite JNI stub references - Improved error reporting on lack of ANDROID_DATA dir or art-cache dir - Fixed Runtime::Start to InitLibraries before creating thread peer - Implemented Space::IsCondemned to skip spaces loaded from images - Implemented artFindInterfaceMethodInCache, allowing interface invocation from managed code Change-Id: I603e97fa0ac44508ae05a2e47c1cdb4481678d7b
2011-09-12Interning image strings Brian Carlstrom
Change-Id: I7e93b3975fe43d91d00b8185b65e8e0fd67ff6f4
2011-09-06Working dex2oat and oatexec Brian Carlstrom
adb shell dex2oatd --dex-file=/system/framework/core.jar --image=/system/framework/boot.oat --base=0x50000000 "'--method=Ljava/lang/System;logI(Ljava/lang/String;)V'" "'--method=Ljava/lang/System;log(CLjava/lang/String;Ljava/lang/Throwable;)V'" adb shell dex2oatd --boot-dex-file=/system/framework/core.jar --boot=/system/framework/boot.oat --dex-file=/system/framework/art-test-dex-HelloWorld.jar --image=/system/framework/art-test-dex-HelloWorld.oat adb shell oatexecd -Xbootclasspath:/system/framework/core.jar -Xbootimage:/system/framework/boot.oat -classpath /system/framework/art-test-dex-HelloWorld.jar -Ximage:/system/framework/art-test-dex-HelloWorld.oat HelloWorld 09-05 17:58:18.912 2385 2385 I System : Hello, world! Change-Id: I53e534068584f0c3a837313e4d517a0e4a7154fc
2011-09-01Fully implement string interning. Elliott Hughes
Also, more const. Change-Id: I09cae88d677e8e6e42d0fa9b5d1093c79d225e66
2011-08-21Initialize ClassLinker from image Brian Carlstrom
Change-Id: Ibaf47b4181f7c6603a8b37e2eba8fa6509c927ed
2011-08-18Work on heap and space initialization to support image loading Brian Carlstrom
Change-Id: Icab25efa4dee17e4b6c6e97e38f63f5ab8a8a005