summaryrefslogtreecommitdiff
path: root/src/compiler
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-07-12Fixes for portable build Brian Carlstrom
Change-Id: I29d6a9fb7f8ec134128329d974acf6b6534e25f1
2013-07-12resolved conflicts for merge of 51c2467e to dalvik-dev Brian Carlstrom
Change-Id: Ia7a8785d3220df6feeb999bc70f6d1917cad8d75
2013-07-11libart-compiler cleanup Brian Carlstrom
- 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
2013-07-11Adds missing dataflow flag for invoke-interface. Sebastien Hertz
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
2013-07-10am c6444052: Update class_initializer_black_list for master Brian Carlstrom
* commit 'c64440528822281a7889aba9cebf96baa4235b87': Update class_initializer_black_list for master
2013-07-10Update class_initializer_black_list for master Brian Carlstrom
Change-Id: Id8c69cc349290ba7d255ea214f8d1b51d3ce062a
2013-07-03Preparing SSA support for SEA IR: reaching definitions. Dragos Sbirlea
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
2013-07-03Merge "Constructor barrier support in DEX-to-DEX compiler." into dalvik-dev Sebastien Hertz
2013-07-01Add StandardCharsets to the class_initializer_black_list Brian Carlstrom
Change-Id: Id13a58fc6da8a2c39f47bcee14a743c88fc899b7
2013-07-01Constructor barrier support in DEX-to-DEX compiler. Sebastien Hertz
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
2013-06-27Merge "Remove unused Thread parameter from ↵ Sebastien Hertz
ThrowArithmeticExceptionDivideByZero." into dalvik-dev
2013-06-26Remove unused Thread parameter from ThrowArithmeticExceptionDivideByZero. Sebastien Hertz
The "Thread* self" parameter of ThrowArithmeticExceptionDivideByZero is unused. This CL removes it and updates all call sites. Change-Id: I5cff86e97dd82dd07f4c174a3d8fbcf980da4aea
2013-06-25Added support for SEA IR. Dragos Sbirlea
- 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
2013-06-24Quickening support. Sebastien Hertz
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
2013-06-21GC clean up. Ian Rogers
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
2013-06-20Don't always slow-path array casts/instance-of. Ian Rogers
Recent changes to IsAbstract for arrays pushed us in to always generating slow-paths. Change-Id: I52fb50953949f337243961a308eabf0d684eacf3
2013-06-14Merge "Move image class computation to the CompilerDriver" into dalvik-dev Brian Carlstrom
2013-06-14Move image class computation to the CompilerDriver Brian Carlstrom
Change-Id: Ia51cdc199cdeaf409755ab8da23323e204ce041e
2013-06-14Merge "No access check support." into dalvik-dev Sebastien Hertz
2013-06-13Merge "Avoid null-checks in blocks following an explicit check." into dalvik-dev Ian Rogers
2013-06-13Avoid null-checks in blocks following an explicit check. Ian Rogers
Change-Id: Ie23f8f23808be3cc335d0a8775c35ddf0c131a6c
2013-06-13Mark instructions that produce non-null object arguments as non-null. Ian Rogers
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
2013-06-13No access check support. Sebastien Hertz
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
2013-06-11am 7675e16b: Rename art-cache to dalvik-cache Brian Carlstrom
* commit '7675e16bcae06c0fe258aad89b3d511037dec399': Rename art-cache to dalvik-cache
2013-06-10Rename art-cache to dalvik-cache Brian Carlstrom
Change-Id: I294995066aecc29fbd739c3e9e6f60934f743064
2013-06-07Merge "Simplify CanAssumeTypeIsPresentInDexCache." into dalvik-dev Ian Rogers
2013-06-07Merge "Tweaks to check-cast codegen." into dalvik-dev Ian Rogers
2013-06-07Tweaks to check-cast codegen. Ian Rogers
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
2013-06-07Simplify CanAssumeTypeIsPresentInDexCache. Ian Rogers
Only use ScopedObjectAccess to check correct dex cache semantics. Change-Id: Ia4d3475368f92736c8a705b1b9a13175fc0af413
2013-06-07Created compiled stubs in image. Jeff Hao
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
2013-06-05Faster instance-of for final classes. Ian Rogers
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
2013-06-05Unresolved types aren't assignable from Object. Ian Rogers
Also, don't eliminate check-cast if an access check is required. Change-Id: Ibb864e01917a93f77db4cf6eb53461c5c7cb0162
2013-06-05Don't apply instance-of peephole when vDest == vSrc. Ian Rogers
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
2013-06-04Stage 2 of cast elision opt. Dragos Sbirlea
NO code is generated for check-casts where we can statically determine the type is correct (through the instaceof-ifeq pattern). Change-Id: I4935375d7ffd4e7d4ff0aaad900c1a4de9deefaa
2013-06-04Perf tweaks to compiling and oat writing. Ian Rogers
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
2013-06-03Tune ArenaBitVector::Iterator::Next. Ian Rogers
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
2013-06-01Allow type based sharpening for imprecise references. Ian Rogers
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
2013-06-01Merge "Don't mark instanceof as a safepoint." into dalvik-dev Ian Rogers
2013-05-31Verifier improvements. Ian Rogers
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
2013-05-31Don't mark instanceof as a safepoint. Ian Rogers
Instanceof can't throw an exception and so needn't be marked as a safepoint. Change-Id: I3970197db7c58a79baa58f5f675d59e9157060da
2013-05-31Merge "More profiler driven tweaks." into dalvik-dev Ian Rogers
2013-05-31More profiler driven tweaks. Ian Rogers
Make more code inlinable by moving to header files. Use reserve on std::vectors to avoid reallocation. Change-Id: I1bf67d32dd58ff5c06dec73a247fadc3de593e91
2013-05-30Compiler: type inference bug. buzbee
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
2013-05-30Profiler directed clean-up of dex2oat. Ian Rogers
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
2013-05-29Build fix. Ian Rogers
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
2013-05-24Enable devirtualization for abstract and sub-class methods. Ian Rogers
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
2013-05-21Refactor ElfWriter and introduce ElfWriterQuick Brian Carlstrom
Change-Id: I3eaa1fa1085bb4d28fe342a7420272720e48274b
2013-05-20Various GCC 3.6 and clang build fixes. Ian Rogers
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
2013-05-13Merge "Rename abstract method code_ to entry_point_from_compiled_code_." ↵ Jeff Hao
into dalvik-dev