summaryrefslogtreecommitdiffstats
path: root/src/compiler
Commit message (Collapse)AuthorAgeFilesLines
* Create separate Android.mk for main build targetsBrian Carlstrom2013-07-12125-55124/+0
| | | | | | | | | | 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
* Fixes for portable buildBrian Carlstrom2013-07-121-2/+2
| | | | Change-Id: I29d6a9fb7f8ec134128329d974acf6b6534e25f1
* resolved conflicts for merge of 51c2467e to dalvik-devBrian Carlstrom2013-07-1234-1199/+4059
|\ | | | | | | Change-Id: Ia7a8785d3220df6feeb999bc70f6d1917cad8d75
| * libart-compiler cleanupBrian Carlstrom2013-07-1134-1199/+4059
| | | | | | | | | | | | | | | | | | | | | | | | - Move compile-time code to src/compiler and libart-compiler OatWriter, ImageWriter, ElfWriter, ElfFixup, ElfStripper, stub generation - Move ClassReference and MethodReference to remove MethodVerifier dependency on CompilerDriver - Move runtime_support_llvm.cc out of src/compiler and next to runtime_support.cc - Change dex2oat and gtests to directly depend on libart-compiler - Move non-common definitions from Android.common.mk to more specific makefiles - Add LOCAL_ADDITIONAL_DEPENDENCIES on appropriate makefiles Change-Id: I897027e69945914128f21f317a92caf9255bc600
* | Adds missing dataflow flag for invoke-interface.Sebastien Hertz2013-07-112-4/+4
| | | | | | | | | | | | | | | | Adds missing DF_NULL_CHK_OUT0 flag in dataflow attributes of invoke-interface and invoke-interface-range instructions. This is used by null check elimination pass. Change-Id: I41e6ff414b3d74a16d1e020fa8988a30b7431afa
* | am c6444052: Update class_initializer_black_list for masterBrian Carlstrom2013-07-101-0/+131
|\| | | | | | | | | * commit 'c64440528822281a7889aba9cebf96baa4235b87': Update class_initializer_black_list for master
| * Update class_initializer_black_list for masterBrian Carlstrom2013-07-101-0/+131
| | | | | | | | Change-Id: Id8c69cc349290ba7d255ea214f8d1b51d3ce062a
* | Preparing SSA support for SEA IR: reaching definitions.Dragos Sbirlea2013-07-036-101/+1216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the following: - Downward-exposed uses. - Reaching definitions. - Better .dot generation. Per file: sea_ir/sea.*: Downward exposed definitions and reaching definitions code. dex_instruction.*: Wrapper function added to expose the vA register, which is later used by dataflow analysis. sea_ir/instruction_tools.*: These tools provide info needed by dataflow analysis that is dependent on dex format. dex/frontend.cc: Formatting issues fixed. sea_ir/*.*: All files pass cpplint validation. *.mk: Support for new files added in this CL. Change-Id: Ic510e7fb55aebcde99a121304ee7e841a3307358
* | Merge "Constructor barrier support in DEX-to-DEX compiler." into dalvik-devSebastien Hertz2013-07-031-1/+45
|\ \ | |/ |/|
| * Constructor barrier support in DEX-to-DEX compiler.Sebastien Hertz2013-07-011-1/+45
| | | | | | | | | | | | | | | | | | | | | | Bug: 9307738 Some constructors require a barrier before returning. This CL introduces the RETURN-VOID-BARRIER instruction. The DEX-to-DEX compiler replaces all RETURN-VOID instructions where a barrier is required by this instruction. The interpreter and the verifier are updated to support this new instruction. Change-Id: If31979b4027bc12157b933eda9fcbd5270edd202
* | Add StandardCharsets to the class_initializer_black_listBrian Carlstrom2013-07-011-0/+1
|/ | | | Change-Id: Id13a58fc6da8a2c39f47bcee14a743c88fc899b7
* Merge "Remove unused Thread parameter from ↵Sebastien Hertz2013-06-271-1/+1
|\ | | | | | | ThrowArithmeticExceptionDivideByZero." into dalvik-dev
| * Remove unused Thread parameter from ThrowArithmeticExceptionDivideByZero.Sebastien Hertz2013-06-261-1/+1
| | | | | | | | | | | | | | The "Thread* self" parameter of ThrowArithmeticExceptionDivideByZero is unused. This CL removes it and updates all call sites. Change-Id: I5cff86e97dd82dd07f4c174a3d8fbcf980da4aea
* | Added support for SEA IR.Dragos Sbirlea2013-06-257-2/+387
|/ | | | | | | | | | | | | | | - Modified makefile to take the existance of SEA_IR_ART file to mean "switch to sea ir mode". - Switching SEA IR mode on leads to the new compiler being fed the fibonacci methods only, if they are used as input. - Added partial support for the control flow subgraph of the SEA IR (instruction nodes and region nodes for conditional and unconditional branches). Change-Id: I29020b8e2df5a00fde75715c3683cc25038589f4 Conflicts: src/compiler/driver/compiler_driver.cc
* Quickening support.Sebastien Hertz2013-06-243-11/+320
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds quickening support for methods which are interpreted at runtime. This CL introduces a DEX-to-DEX compiler. A method is now compiled in one of the two following modes: - Native compilation: the method is compiled by the Quick or Portable backends. At runtime, the generated native target-dependent code is executed. - DEX-to-DEX compilation: the method is executed by the interpreter at runtime. Its DEX code is compiled so some instructions can be replaced by special instructions only valid at runtime. No native code is generated. The quickening adds special instructions to improve runtime performance. They are "-quick" versions of the following instructions: - iget/iput - iget-wide/iput-wide - iget-object/iput-object - invoke-virtual/range. These special instructions cannot be treated by the verifier since they lose the field/method index referencing the field/method being accessed/invoked. To prevent this, the DEX-to-DEX compiler is run only on methods of preverified classes (without verification error at compilation time). The DEX-to-DEX compiler implements quickening support using the CompilerDriver interface like the native compiler does (Quick or Portable backends). To replace instructions, the DEX-to-DEX compiler must be able to modify the mmapped DEX file. Since it can be read-only protected, the DEX-to-DEX compiler must be able to temporarily change its protection to read-write mmapped file. To achieve this, this CL adds support for changing DEX file protection with DexFile::EnableWrite and DexFile::DisableWrite methods. Besides, it also adds a dedicated lock (DexFile::modification_lock) to ensure thread-safety and avoid concurrent DEX file protection change (from a parallel DEX-to-DEX compiler on the same DEX file). Change-Id: Iaafd103b9766810d7fc94a2c424a8fafba66e26a
* GC clean up.Ian Rogers2013-06-216-16/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Greater use of directories and namespaces. Fix bugs that cause verify options to fail. Address numerous other issues: GC barrier wait occurring holding locks: GC barrier waits occur when we wait for threads to run the check point function on themselves. This is happening with the heap bitmap and mutator lock held meaning that a thread that tries to take either lock exclusively will block waiting on a thread that is waiting. If this thread is the thread we're waiting to run the check point then the VM will deadlock. This deadlock occurred unnoticed as the call to check for wait safety was removed in: https://googleplex-android-review.googlesource.com/#/c/249423/1. NewTimingLogger: Existing timing log states when a split ends but not when it begins. This isn't good for systrace, in the context of GC it means that races between mutators and the GC are hard to discover what phase the GC is in, we know what phase it just finished and derive but that's not ideal. Support for only 1 discontinuous space: Code special cases continuous and large object space, rather than assuming we can have a collection of both. Sorted atomic stacks: Used to improve verification performance. Simplify their use and add extra checks. Simplify mod-union table abstractions. Reduce use of std::strings and their associated overhead in hot code. Make time units of fields explicit. Reduce confusion that IsAllocSpace is really IsDlMallocSpace. Make GetTotalMemory (exposed via System) equal to the footprint (as in Dalvik) rather than the max memory footprint. Change-Id: Ie87067140fa4499b15edab691fe6565d79599812
* Don't always slow-path array casts/instance-of.Ian Rogers2013-06-201-1/+1
| | | | | | | Recent changes to IsAbstract for arrays pushed us in to always generating slow-paths. Change-Id: I52fb50953949f337243961a308eabf0d684eacf3
* Merge "Move image class computation to the CompilerDriver" into dalvik-devBrian Carlstrom2013-06-142-17/+287
|\
| * Move image class computation to the CompilerDriverBrian Carlstrom2013-06-142-17/+287
| | | | | | | | Change-Id: Ia51cdc199cdeaf409755ab8da23323e204ce041e
* | Merge "No access check support." into dalvik-devSebastien Hertz2013-06-141-12/+12
|\ \ | |/ |/|
| * No access check support.Sebastien Hertz2013-06-131-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds support to disable access check when a method is preverified (at compilation time) and we know we don't need to do any access check. The interpreter has now two modes of execution: with or without access check. This is realized by using a template function. A new runtime access flag kAccPreverified is added onto each method belonging to a preverified class. If this flag is set, we enter the interpreter in "no access check" mode. Otherwise, we enter the interpreter in "with access check" mode. Change-Id: Ic34163421d5b0aca3d1bce22ef7c095dcf465a18
* | Merge "Avoid null-checks in blocks following an explicit check." into dalvik-devIan Rogers2013-06-131-1/+22
|\ \
| * | Avoid null-checks in blocks following an explicit check.Ian Rogers2013-06-131-1/+22
| |/ | | | | | | Change-Id: Ie23f8f23808be3cc335d0a8775c35ddf0c131a6c
* / Mark instructions that produce non-null object arguments as non-null.Ian Rogers2013-06-131-4/+4
|/ | | | | | | Improve null-check elimination by marking instructions that can't produce a non-null object as non-null. Reduces the size of ThinkFree by 16kb (0.05%). Change-Id: I43148b55a4896081fe3da37a3345814b55fa9b82
* am 7675e16b: Rename art-cache to dalvik-cacheBrian Carlstrom2013-06-111-1/+1
|\ | | | | | | | | * commit '7675e16bcae06c0fe258aad89b3d511037dec399': Rename art-cache to dalvik-cache
| * Rename art-cache to dalvik-cacheBrian Carlstrom2013-06-101-1/+1
| | | | | | | | Change-Id: I294995066aecc29fbd739c3e9e6f60934f743064
* | Merge "Simplify CanAssumeTypeIsPresentInDexCache." into dalvik-devIan Rogers2013-06-071-14/+9
|\ \
| * | Simplify CanAssumeTypeIsPresentInDexCache.Ian Rogers2013-06-071-14/+9
| | | | | | | | | | | | | | | | | | Only use ScopedObjectAccess to check correct dex cache semantics. Change-Id: Ia4d3475368f92736c8a705b1b9a13175fc0af413
* | | Merge "Tweaks to check-cast codegen." into dalvik-devIan Rogers2013-06-071-21/+20
|\ \ \
| * | | Tweaks to check-cast codegen.Ian Rogers2013-06-071-21/+20
| |/ / | | | | | | | | | | | | | | | | | | | | | Re-use declaringClass from method when possible. Don't test class against abstract classes. On ARM, push load of helper routine to after fast-path filter. Change-Id: I6740b38ca3c463c97338cbf7096939be9b1c8335
* / / Created compiled stubs in image.Jeff Hao2013-06-075-0/+528
|/ / | | | | | | | | | | | | | | | | Saves class linker from having to set code pointers when loading from an image. Added stubs for quick and portable resolution trampolines, and interpreter-to-interpreter and interpreter-to-quick entry points. Also added sizing stats output for oat writer. Change-Id: I3905fae81047742c23d1cf0ca001db798db971b1
* | Faster instance-of for final classes.Ian Rogers2013-06-054-27/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | If a class is final and not and array we can generate a 1/0 based on class equality. Use a method's declaring class if it matches the instance-of class (common in Java equals methods). Don't do a class pointer comparison in the case of an abstract or interface class, just go straight into the slow-path. Fix performance bug where peep-hole verifier pass didn't merge into the fall-through line if the next instruction wasn't interesting. Change-Id: Idb47ec6acebfd25a344ed74adaacba02fafc7df2
* | Unresolved types aren't assignable from Object.Ian Rogers2013-06-051-5/+5
| | | | | | | | | | | | Also, don't eliminate check-cast if an access check is required. Change-Id: Ibb864e01917a93f77db4cf6eb53461c5c7cb0162
* | Don't apply instance-of peephole when vDest == vSrc.Ian Rogers2013-06-053-4/+40
| | | | | | | | | | | | | | | | | | | | Bug: 9284898. Also statistic to show check-cast ellision use. Fix bug where the check-cast ellision was using wrong dex pc. Avoid a use of DecodedInstruction. Other formatting clean-up. Change-Id: Ibf67941a24148b615896d0be6f2f29ce5034e53a
* | Stage 2 of cast elision opt.Dragos Sbirlea2013-06-043-5/+15
| | | | | | | | | | | | NO code is generated for check-casts where we can statically determine the type is correct (through the instaceof-ifeq pattern). Change-Id: I4935375d7ffd4e7d4ff0aaad900c1a4de9deefaa
* | Perf tweaks to compiling and oat writing.Ian Rogers2013-06-0442-665/+677
| | | | | | | | | | | | | | | | | | | | | | Make hot quick compiler routines inlinable. Remove computation/use of SSA strings. Use vector insert when writing to the end of a vector in the output stream, to avoid a memset followed by a memcpy. Generating boot.oat/art these changes improve performance by around 2.5%. Change-Id: I3d0bdb01333efe8f0eda4bdf97225e0b307f934d
* | Tune ArenaBitVector::Iterator::Next.Ian Rogers2013-06-032-38/+27
| | | | | | | | | | | | | | | | Hot routine: 1) move to header file so that fields may be moved to registers, 2) remove search for bits in word with a CTZ. Change-Id: I960ee811234c3a65d11f0af55ed15c4444f486ae
* | Allow type based sharpening for imprecise references.Ian Rogers2013-06-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | When a reference is imprecise we may still be able to devirtualize if the method that is dispatched upon may not be overridden (ie final). Some other tidying of the devirtualization code. For boot this increases the frequency of type based devirtualization by a little more than 0.01%. Change-Id: I050efbcc78c6b89135a6432bd7c2e946d8efbab4
* | Merge "Don't mark instanceof as a safepoint." into dalvik-devIan Rogers2013-06-011-5/+3
|\ \
| * | Don't mark instanceof as a safepoint.Ian Rogers2013-05-311-5/+3
| | | | | | | | | | | | | | | | | | Instanceof can't throw an exception and so needn't be marked as a safepoint. Change-Id: I3970197db7c58a79baa58f5f675d59e9157060da
* | | Verifier improvements.Ian Rogers2013-05-312-6/+14
|/ / | | | | | | | | | | | | | | | | | | Make type hierarchy for unresolved and unitialized types explicit. Tidy and comment code. Add DexFile::FindStringId that takes UTF-16 to avoid unnecessary UTF-8 conversions during image writing. Explicitly disable RTTI that causes problems in debug builds. Change-Id: I701f1c3be8be5854fcabf5ec39e9f9c5d388aab0
* | Merge "More profiler driven tweaks." into dalvik-devIan Rogers2013-05-315-3/+7
|\ \
| * | More profiler driven tweaks.Ian Rogers2013-05-315-3/+7
| | | | | | | | | | | | | | | | | | | | | Make more code inlinable by moving to header files. Use reserve on std::vectors to avoid reallocation. Change-Id: I1bf67d32dd58ff5c06dec73a247fadc3de593e91
* | | Compiler: type inference bug.buzbee2013-05-302-12/+11
|/ / | | | | | | | | | | | | | | | | The recent MIR-level select optimization failed to properly manage the type information of the new kMirOpSelect node, resulting in a type inference mismatch that trigered a reduction of optimization level (should not have affected correctness). Change-Id: I4e104050674c8667b9dff15a401ab230a46e7968
* | Profiler directed clean-up of dex2oat.Ian Rogers2013-05-306-28/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix bad usage of std::string in: the verifier and compiler driver method arguments, causing unnecessary boxing and allocations; in creating a symbol for the dex compilation unit, that is only used in portable builds; in pattern matching for intrinsics by name. Make class linker dex and classes locks reader/writer to allow concurrent dex cache or class querying. Refactor ComputeCompilingMethodsClass to pass in a dex cache hint, to avoid taking any locks when the dex file of the compiling method matches that of the field or method being resolved. Make the RegType's HasClass method virtual to avoid frequent virtual method dispatch. Make RegTypeCache GetFromId inlinable. Various other bits of whitespace and formatting clean-up. Change-Id: Id152e1e5a6fed2961dad0b612b7aa0c48001ef94
* | Build fix.Ian Rogers2013-05-291-0/+1
| | | | | | | | | | | | | | | | MIPS build exposed a latest bug in DexFile's binary search code. Portable build always requires a dex cache when using verifier based sharpening. Change-Id: I235c033d7eba0272b264f5dbda209ff5cd7cce93
* | Enable devirtualization for abstract and sub-class methods.Ian Rogers2013-05-246-162/+307
|/ | | | | | | | | | | | | | | | | | | | | | | | | | If we know the type of a receiver in the verifier we record devirtualization data. Currently we only use this data to avoid virtual method dispatch when we know the receiver of a method isn't a sub-class. This change allows devirtualization of virtual and interface methods when we know the receiver's type and the method the we'd find via dispatch is either known within boot or has a reference from the current dex file. Pass the receiver through to the method resolution trampoline as devirtualization may mean the dex method index needs to be made more accurate for the receiver. Tidy up method devirtualization and related statistics. Push the devirtualization map lookup into a less common case to avoid taking its lock. Make MethodReference a struct rather than a typedef of a pair, so the members can have more meaningful names than first and second. Rough statistics show that we devirtualize using this change around 2.5% of the time, whilst some apps like GMS core devirtualize over 3.4% of the time. Change-Id: Ieed3471dbedfc4cc881d652631b67176bb37d394
* Refactor ElfWriter and introduce ElfWriterQuickBrian Carlstrom2013-05-211-4/+15
| | | | Change-Id: I3eaa1fa1085bb4d28fe342a7420272720e48274b
* Various GCC 3.6 and clang build fixes.Ian Rogers2013-05-207-3/+7
| | | | | | | | | | | Remove #error in common_test.h that fires with clang build and replace with runtime error. Fix bit rot caused by not compiling with Wthread-safety. Fix clang build issues in compiler relating to missing header file definitions in object files. Other minor build and tidying issues. Change-Id: Ife829ab0664581936155be524de46e6181c750b0
* Merge "Rename abstract method code_ to entry_point_from_compiled_code_." ↵Jeff Hao2013-05-136-10/+10
|\ | | | | | | into dalvik-dev