compiler_driver.h revision a5b09a67034e57a6e10231dd4bd92f4cb50b824c
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ART_COMPILER_DRIVER_COMPILER_DRIVER_H_
18#define ART_COMPILER_DRIVER_COMPILER_DRIVER_H_
19
20#include <set>
21#include <string>
22#include <unordered_set>
23#include <vector>
24
25#include "arch/instruction_set.h"
26#include "base/arena_allocator.h"
27#include "base/array_ref.h"
28#include "base/bit_utils.h"
29#include "base/mutex.h"
30#include "base/timing_logger.h"
31#include "class_reference.h"
32#include "compiler.h"
33#include "dex_file.h"
34#include "dex_file_types.h"
35#include "driver/compiled_method_storage.h"
36#include "jit/offline_profiling_info.h"
37#include "invoke_type.h"
38#include "method_reference.h"
39#include "mirror/class.h"  // For mirror::Class::Status.
40#include "os.h"
41#include "runtime.h"
42#include "safe_map.h"
43#include "thread_pool.h"
44#include "utils/dex_cache_arrays_layout.h"
45
46namespace art {
47
48namespace mirror {
49class DexCache;
50}  // namespace mirror
51
52namespace verifier {
53class MethodVerifier;
54class VerifierDeps;
55class VerifierDepsTest;
56}  // namespace verifier
57
58class BitVector;
59class CompiledClass;
60class CompiledMethod;
61class CompilerOptions;
62class DexCompilationUnit;
63struct InlineIGetIPutData;
64class InstructionSetFeatures;
65class ParallelCompilationManager;
66class ScopedObjectAccess;
67template <class Allocator> class SrcMap;
68class SrcMapElem;
69using SwapSrcMap = SrcMap<SwapAllocator<SrcMapElem>>;
70template<class T> class Handle;
71class TimingLogger;
72class VerificationResults;
73class VerifiedMethod;
74
75enum EntryPointCallingConvention {
76  // ABI of invocations to a method's interpreter entry point.
77  kInterpreterAbi,
78  // ABI of calls to a method's native code, only used for native methods.
79  kJniAbi,
80  // ABI of calls to a method's quick code entry point.
81  kQuickAbi
82};
83
84class CompilerDriver {
85 public:
86  // Create a compiler targeting the requested "instruction_set".
87  // "image" should be true if image specific optimizations should be
88  // enabled.  "image_classes" lets the compiler know what classes it
89  // can assume will be in the image, with null implying all available
90  // classes.
91  CompilerDriver(const CompilerOptions* compiler_options,
92                 VerificationResults* verification_results,
93                 Compiler::Kind compiler_kind,
94                 InstructionSet instruction_set,
95                 const InstructionSetFeatures* instruction_set_features,
96                 std::unordered_set<std::string>* image_classes,
97                 std::unordered_set<std::string>* compiled_classes,
98                 std::unordered_set<std::string>* compiled_methods,
99                 size_t thread_count,
100                 bool dump_stats,
101                 bool dump_passes,
102                 CumulativeLogger* timer,
103                 int swap_fd,
104                 const ProfileCompilationInfo* profile_compilation_info);
105
106  ~CompilerDriver();
107
108  // Set dex files that will be stored in the oat file after being compiled.
109  void SetDexFilesForOatFile(const std::vector<const DexFile*>& dex_files) {
110    dex_files_for_oat_file_ = &dex_files;
111  }
112
113  // Get dex file that will be stored in the oat file after being compiled.
114  ArrayRef<const DexFile* const> GetDexFilesForOatFile() const {
115    return (dex_files_for_oat_file_ != nullptr)
116        ? ArrayRef<const DexFile* const>(*dex_files_for_oat_file_)
117        : ArrayRef<const DexFile* const>();
118  }
119
120  void CompileAll(jobject class_loader,
121                  const std::vector<const DexFile*>& dex_files,
122                  verifier::VerifierDeps* verifier_deps,
123                  TimingLogger* timings)
124      REQUIRES(!Locks::mutator_lock_, !compiled_classes_lock_, !dex_to_dex_references_lock_);
125
126  // Compile a single Method.
127  void CompileOne(Thread* self, ArtMethod* method, TimingLogger* timings)
128      REQUIRES_SHARED(Locks::mutator_lock_)
129      REQUIRES(!compiled_methods_lock_, !compiled_classes_lock_, !dex_to_dex_references_lock_);
130
131  VerificationResults* GetVerificationResults() const {
132    DCHECK(Runtime::Current()->IsAotCompiler());
133    return verification_results_;
134  }
135
136  InstructionSet GetInstructionSet() const {
137    return instruction_set_;
138  }
139
140  const InstructionSetFeatures* GetInstructionSetFeatures() const {
141    return instruction_set_features_;
142  }
143
144  const CompilerOptions& GetCompilerOptions() const {
145    return *compiler_options_;
146  }
147
148  Compiler* GetCompiler() const {
149    return compiler_.get();
150  }
151
152  const std::unordered_set<std::string>* GetImageClasses() const {
153    return image_classes_.get();
154  }
155
156  // Generate the trampolines that are invoked by unresolved direct methods.
157  std::unique_ptr<const std::vector<uint8_t>> CreateJniDlsymLookup() const;
158  std::unique_ptr<const std::vector<uint8_t>> CreateQuickGenericJniTrampoline() const;
159  std::unique_ptr<const std::vector<uint8_t>> CreateQuickImtConflictTrampoline() const;
160  std::unique_ptr<const std::vector<uint8_t>> CreateQuickResolutionTrampoline() const;
161  std::unique_ptr<const std::vector<uint8_t>> CreateQuickToInterpreterBridge() const;
162
163  CompiledClass* GetCompiledClass(ClassReference ref) const
164      REQUIRES(!compiled_classes_lock_);
165
166  CompiledMethod* GetCompiledMethod(MethodReference ref) const
167      REQUIRES(!compiled_methods_lock_);
168  size_t GetNonRelativeLinkerPatchCount() const
169      REQUIRES(!compiled_methods_lock_);
170
171  // Add a compiled method.
172  void AddCompiledMethod(const MethodReference& method_ref,
173                         CompiledMethod* const compiled_method,
174                         size_t non_relative_linker_patch_count)
175      REQUIRES(!compiled_methods_lock_);
176  // Remove and delete a compiled method.
177  void RemoveCompiledMethod(const MethodReference& method_ref) REQUIRES(!compiled_methods_lock_);
178
179  void SetRequiresConstructorBarrier(Thread* self,
180                                     const DexFile* dex_file,
181                                     uint16_t class_def_index,
182                                     bool requires)
183      REQUIRES(!requires_constructor_barrier_lock_);
184  bool RequiresConstructorBarrier(Thread* self,
185                                  const DexFile* dex_file,
186                                  uint16_t class_def_index)
187      REQUIRES(!requires_constructor_barrier_lock_);
188
189  // Are runtime access checks necessary in the compiled code?
190  bool CanAccessTypeWithoutChecks(uint32_t referrer_idx,
191                                  Handle<mirror::DexCache> dex_cache,
192                                  dex::TypeIndex type_idx)
193      REQUIRES_SHARED(Locks::mutator_lock_);
194
195  // Are runtime access and instantiable checks necessary in the code?
196  // out_is_finalizable is set to whether the type is finalizable.
197  bool CanAccessInstantiableTypeWithoutChecks(uint32_t referrer_idx,
198                                              Handle<mirror::DexCache> dex_cache,
199                                              dex::TypeIndex type_idx,
200                                              bool* out_is_finalizable)
201      REQUIRES_SHARED(Locks::mutator_lock_);
202
203  // Resolve compiling method's class. Returns null on failure.
204  mirror::Class* ResolveCompilingMethodsClass(
205      const ScopedObjectAccess& soa, Handle<mirror::DexCache> dex_cache,
206      Handle<mirror::ClassLoader> class_loader, const DexCompilationUnit* mUnit)
207      REQUIRES_SHARED(Locks::mutator_lock_);
208
209  mirror::Class* ResolveClass(
210      const ScopedObjectAccess& soa, Handle<mirror::DexCache> dex_cache,
211      Handle<mirror::ClassLoader> class_loader, dex::TypeIndex type_index,
212      const DexCompilationUnit* mUnit)
213      REQUIRES_SHARED(Locks::mutator_lock_);
214
215  // Resolve a field. Returns null on failure, including incompatible class change.
216  // NOTE: Unlike ClassLinker's ResolveField(), this method enforces is_static.
217  ArtField* ResolveField(
218      const ScopedObjectAccess& soa, Handle<mirror::DexCache> dex_cache,
219      Handle<mirror::ClassLoader> class_loader, const DexCompilationUnit* mUnit,
220      uint32_t field_idx, bool is_static)
221      REQUIRES_SHARED(Locks::mutator_lock_);
222
223  // Resolve a field with a given dex file.
224  ArtField* ResolveFieldWithDexFile(
225      const ScopedObjectAccess& soa, Handle<mirror::DexCache> dex_cache,
226      Handle<mirror::ClassLoader> class_loader, const DexFile* dex_file,
227      uint32_t field_idx, bool is_static)
228      REQUIRES_SHARED(Locks::mutator_lock_);
229
230  // Can we fast-path an IGET/IPUT access to an instance field? If yes, compute the field offset.
231  std::pair<bool, bool> IsFastInstanceField(
232      mirror::DexCache* dex_cache, mirror::Class* referrer_class,
233      ArtField* resolved_field, uint16_t field_idx)
234      REQUIRES_SHARED(Locks::mutator_lock_);
235
236  // Can we fast-path an SGET/SPUT access to a static field? If yes, compute the type index
237  // of the declaring class in the referrer's dex file.
238  std::pair<bool, bool> IsFastStaticField(mirror::DexCache* dex_cache,
239                                          mirror::Class* referrer_class,
240                                          ArtField* resolved_field,
241                                          uint16_t field_idx,
242                                          dex::TypeIndex* storage_index)
243      REQUIRES_SHARED(Locks::mutator_lock_);
244
245  // Return whether the declaring class of `resolved_method` is
246  // available to `referrer_class`. If this is true, compute the type
247  // index of the declaring class in the referrer's dex file and
248  // return it through the out argument `storage_index`; otherwise
249  // return DexFile::kDexNoIndex through `storage_index`.
250  bool IsClassOfStaticMethodAvailableToReferrer(mirror::DexCache* dex_cache,
251                                                mirror::Class* referrer_class,
252                                                ArtMethod* resolved_method,
253                                                uint16_t method_idx,
254                                                dex::TypeIndex* storage_index)
255      REQUIRES_SHARED(Locks::mutator_lock_);
256
257  // Resolve a method. Returns null on failure, including incompatible class change.
258  ArtMethod* ResolveMethod(
259      ScopedObjectAccess& soa, Handle<mirror::DexCache> dex_cache,
260      Handle<mirror::ClassLoader> class_loader, const DexCompilationUnit* mUnit,
261      uint32_t method_idx, InvokeType invoke_type, bool check_incompatible_class_change = true)
262      REQUIRES_SHARED(Locks::mutator_lock_);
263
264  void ProcessedInstanceField(bool resolved);
265  void ProcessedStaticField(bool resolved, bool local);
266
267  // Can we fast path instance field access? Computes field's offset and volatility.
268  bool ComputeInstanceFieldInfo(uint32_t field_idx, const DexCompilationUnit* mUnit, bool is_put,
269                                MemberOffset* field_offset, bool* is_volatile)
270      REQUIRES(!Locks::mutator_lock_);
271
272  ArtField* ComputeInstanceFieldInfo(uint32_t field_idx,
273                                             const DexCompilationUnit* mUnit,
274                                             bool is_put,
275                                             const ScopedObjectAccess& soa)
276      REQUIRES_SHARED(Locks::mutator_lock_);
277
278
279  const VerifiedMethod* GetVerifiedMethod(const DexFile* dex_file, uint32_t method_idx) const;
280  bool IsSafeCast(const DexCompilationUnit* mUnit, uint32_t dex_pc);
281
282  bool GetSupportBootImageFixup() const {
283    return support_boot_image_fixup_;
284  }
285
286  void SetSupportBootImageFixup(bool support_boot_image_fixup) {
287    support_boot_image_fixup_ = support_boot_image_fixup;
288  }
289
290  void SetCompilerContext(void* compiler_context) {
291    compiler_context_ = compiler_context;
292  }
293
294  void* GetCompilerContext() const {
295    return compiler_context_;
296  }
297
298  size_t GetThreadCount() const {
299    return parallel_thread_count_;
300  }
301
302  bool GetDumpStats() const {
303    return dump_stats_;
304  }
305
306  bool GetDumpPasses() const {
307    return dump_passes_;
308  }
309
310  CumulativeLogger* GetTimingsLogger() const {
311    return timings_logger_;
312  }
313
314  void SetDedupeEnabled(bool dedupe_enabled) {
315    compiled_method_storage_.SetDedupeEnabled(dedupe_enabled);
316  }
317
318  bool DedupeEnabled() const {
319    return compiled_method_storage_.DedupeEnabled();
320  }
321
322  // Checks if class specified by type_idx is one of the image_classes_
323  bool IsImageClass(const char* descriptor) const;
324
325  // Checks whether the provided class should be compiled, i.e., is in classes_to_compile_.
326  bool IsClassToCompile(const char* descriptor) const;
327
328  // Checks whether the provided method should be compiled, i.e., is in method_to_compile_.
329  bool IsMethodToCompile(const MethodReference& method_ref) const;
330
331  // Checks whether profile guided compilation is enabled and if the method should be compiled
332  // according to the profile file.
333  bool ShouldCompileBasedOnProfile(const MethodReference& method_ref) const;
334
335  // Checks whether profile guided verification is enabled and if the method should be verified
336  // according to the profile file.
337  bool ShouldVerifyClassBasedOnProfile(const DexFile& dex_file, uint16_t class_idx) const;
338
339  void RecordClassStatus(ClassReference ref, mirror::Class::Status status)
340      REQUIRES(!compiled_classes_lock_);
341
342  // Checks if the specified method has been verified without failures. Returns
343  // false if the method is not in the verification results (GetVerificationResults).
344  bool IsMethodVerifiedWithoutFailures(uint32_t method_idx,
345                                       uint16_t class_def_idx,
346                                       const DexFile& dex_file) const;
347
348  // Get memory usage during compilation.
349  std::string GetMemoryUsageString(bool extended) const;
350
351  void SetHadHardVerifierFailure() {
352    had_hard_verifier_failure_ = true;
353  }
354
355  Compiler::Kind GetCompilerKind() {
356    return compiler_kind_;
357  }
358
359  CompiledMethodStorage* GetCompiledMethodStorage() {
360    return &compiled_method_storage_;
361  }
362
363  // Can we assume that the klass is loaded?
364  bool CanAssumeClassIsLoaded(mirror::Class* klass)
365      REQUIRES_SHARED(Locks::mutator_lock_);
366
367  bool MayInline(const DexFile* inlined_from, const DexFile* inlined_into) const {
368    if (!kIsTargetBuild) {
369      return MayInlineInternal(inlined_from, inlined_into);
370    }
371    return true;
372  }
373
374  void MarkForDexToDexCompilation(Thread* self, const MethodReference& method_ref)
375      REQUIRES(!dex_to_dex_references_lock_);
376
377  const BitVector* GetCurrentDexToDexMethods() const {
378    return current_dex_to_dex_methods_;
379  }
380
381  // Compute constant code and method pointers when possible.
382  void GetCodeAndMethodForDirectCall(const mirror::Class* referrer_class,
383                                     ArtMethod* method,
384                                     /* out */ uintptr_t* direct_code,
385                                     /* out */ uintptr_t* direct_method)
386      REQUIRES_SHARED(Locks::mutator_lock_);
387
388 private:
389  // Return whether the declaring class of `resolved_member` is
390  // available to `referrer_class` for read or write access using two
391  // Boolean values returned as a pair. If is true at least for read
392  // access, compute the type index of the declaring class in the
393  // referrer's dex file and return it through the out argument
394  // `storage_index`; otherwise return DexFile::kDexNoIndex through
395  // `storage_index`.
396  template <typename ArtMember>
397  std::pair<bool, bool> IsClassOfStaticMemberAvailableToReferrer(mirror::DexCache* dex_cache,
398                                                                 mirror::Class* referrer_class,
399                                                                 ArtMember* resolved_member,
400                                                                 uint16_t member_idx,
401                                                                 dex::TypeIndex* storage_index)
402      REQUIRES_SHARED(Locks::mutator_lock_);
403
404  // Can `referrer_class` access the resolved `member`?
405  // Dispatch call to mirror::Class::CanAccessResolvedField or
406  // mirror::Class::CanAccessResolvedMember depending on the value of
407  // ArtMember.
408  template <typename ArtMember>
409  static bool CanAccessResolvedMember(mirror::Class* referrer_class,
410                                      mirror::Class* access_to,
411                                      ArtMember* member,
412                                      mirror::DexCache* dex_cache,
413                                      uint32_t field_idx)
414      REQUIRES_SHARED(Locks::mutator_lock_);
415
416  mirror::ClassLoader* GetClassLoader(const ScopedObjectAccess& soa,
417                                      const DexCompilationUnit* mUnit)
418    REQUIRES_SHARED(Locks::mutator_lock_);
419
420 private:
421  void PreCompile(jobject class_loader,
422                  const std::vector<const DexFile*>& dex_files,
423                  verifier::VerifierDeps* verifier_deps,
424                  TimingLogger* timings)
425      REQUIRES(!Locks::mutator_lock_, !compiled_classes_lock_);
426
427  void LoadImageClasses(TimingLogger* timings) REQUIRES(!Locks::mutator_lock_);
428
429  // Attempt to resolve all type, methods, fields, and strings
430  // referenced from code in the dex file following PathClassLoader
431  // ordering semantics.
432  void Resolve(jobject class_loader,
433               const std::vector<const DexFile*>& dex_files,
434               TimingLogger* timings)
435      REQUIRES(!Locks::mutator_lock_);
436  void ResolveDexFile(jobject class_loader,
437                      const DexFile& dex_file,
438                      const std::vector<const DexFile*>& dex_files,
439                      ThreadPool* thread_pool,
440                      size_t thread_count,
441                      TimingLogger* timings)
442      REQUIRES(!Locks::mutator_lock_);
443
444  void Verify(jobject class_loader,
445              const std::vector<const DexFile*>& dex_files,
446              verifier::VerifierDeps* verifier_deps,
447              TimingLogger* timings);
448
449  void VerifyDexFile(jobject class_loader,
450                     const DexFile& dex_file,
451                     const std::vector<const DexFile*>& dex_files,
452                     ThreadPool* thread_pool,
453                     size_t thread_count,
454                     TimingLogger* timings)
455      REQUIRES(!Locks::mutator_lock_);
456
457  void SetVerified(jobject class_loader,
458                   const std::vector<const DexFile*>& dex_files,
459                   TimingLogger* timings);
460  void SetVerifiedDexFile(jobject class_loader,
461                          const DexFile& dex_file,
462                          const std::vector<const DexFile*>& dex_files,
463                          ThreadPool* thread_pool,
464                          size_t thread_count,
465                          TimingLogger* timings)
466      REQUIRES(!Locks::mutator_lock_);
467
468  void InitializeClasses(jobject class_loader,
469                         const std::vector<const DexFile*>& dex_files,
470                         TimingLogger* timings)
471      REQUIRES(!Locks::mutator_lock_, !compiled_classes_lock_);
472  void InitializeClasses(jobject class_loader,
473                         const DexFile& dex_file,
474                         const std::vector<const DexFile*>& dex_files,
475                         TimingLogger* timings)
476      REQUIRES(!Locks::mutator_lock_, !compiled_classes_lock_);
477
478  void UpdateImageClasses(TimingLogger* timings) REQUIRES(!Locks::mutator_lock_);
479
480  void Compile(jobject class_loader,
481               const std::vector<const DexFile*>& dex_files,
482               TimingLogger* timings) REQUIRES(!dex_to_dex_references_lock_);
483  void CompileDexFile(jobject class_loader,
484                      const DexFile& dex_file,
485                      const std::vector<const DexFile*>& dex_files,
486                      ThreadPool* thread_pool,
487                      size_t thread_count,
488                      TimingLogger* timings)
489      REQUIRES(!Locks::mutator_lock_);
490
491  bool MayInlineInternal(const DexFile* inlined_from, const DexFile* inlined_into) const;
492
493  void InitializeThreadPools();
494  void FreeThreadPools();
495  void CheckThreadPools();
496
497  bool RequiresConstructorBarrier(const DexFile& dex_file, uint16_t class_def_idx) const;
498
499  const CompilerOptions* const compiler_options_;
500  VerificationResults* const verification_results_;
501
502  std::unique_ptr<Compiler> compiler_;
503  Compiler::Kind compiler_kind_;
504
505  const InstructionSet instruction_set_;
506  const InstructionSetFeatures* const instruction_set_features_;
507
508  // All class references that require constructor barriers. If the class reference is not in the
509  // set then the result has not yet been computed.
510  mutable ReaderWriterMutex requires_constructor_barrier_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
511  std::map<ClassReference, bool> requires_constructor_barrier_
512      GUARDED_BY(requires_constructor_barrier_lock_);
513
514  typedef SafeMap<const ClassReference, CompiledClass*> ClassTable;
515  // All class references that this compiler has compiled.
516  mutable Mutex compiled_classes_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
517  ClassTable compiled_classes_ GUARDED_BY(compiled_classes_lock_);
518
519  typedef SafeMap<const MethodReference, CompiledMethod*, MethodReferenceComparator> MethodTable;
520
521 public:
522  // Lock is public so that non-members can have lock annotations.
523  mutable Mutex compiled_methods_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
524
525 private:
526  // All method references that this compiler has compiled.
527  MethodTable compiled_methods_ GUARDED_BY(compiled_methods_lock_);
528  // Number of non-relative patches in all compiled methods. These patches need space
529  // in the .oat_patches ELF section if requested in the compiler options.
530  size_t non_relative_linker_patch_count_ GUARDED_BY(compiled_methods_lock_);
531
532  // If image_ is true, specifies the classes that will be included in the image.
533  // Note if image_classes_ is null, all classes are included in the image.
534  std::unique_ptr<std::unordered_set<std::string>> image_classes_;
535
536  // Specifies the classes that will be compiled. Note that if classes_to_compile_ is null,
537  // all classes are eligible for compilation (duplication filters etc. will still apply).
538  // This option may be restricted to the boot image, depending on a flag in the implementation.
539  std::unique_ptr<std::unordered_set<std::string>> classes_to_compile_;
540
541  // Specifies the methods that will be compiled. Note that if methods_to_compile_ is null,
542  // all methods are eligible for compilation (compilation filters etc. will still apply).
543  // This option may be restricted to the boot image, depending on a flag in the implementation.
544  std::unique_ptr<std::unordered_set<std::string>> methods_to_compile_;
545
546  bool had_hard_verifier_failure_;
547
548  // A thread pool that can (potentially) run tasks in parallel.
549  std::unique_ptr<ThreadPool> parallel_thread_pool_;
550  size_t parallel_thread_count_;
551
552  // A thread pool that guarantees running single-threaded on the main thread.
553  std::unique_ptr<ThreadPool> single_thread_pool_;
554
555  class AOTCompilationStats;
556  std::unique_ptr<AOTCompilationStats> stats_;
557
558  bool dump_stats_;
559  const bool dump_passes_;
560
561  CumulativeLogger* const timings_logger_;
562
563  typedef void (*CompilerCallbackFn)(CompilerDriver& driver);
564  typedef MutexLock* (*CompilerMutexLockFn)(CompilerDriver& driver);
565
566  void* compiler_context_;
567
568  bool support_boot_image_fixup_;
569
570  // List of dex files that will be stored in the oat file.
571  const std::vector<const DexFile*>* dex_files_for_oat_file_;
572
573  CompiledMethodStorage compiled_method_storage_;
574
575  // Info for profile guided compilation.
576  const ProfileCompilationInfo* const profile_compilation_info_;
577
578  size_t max_arena_alloc_;
579
580  // Data for delaying dex-to-dex compilation.
581  Mutex dex_to_dex_references_lock_;
582  // In the first phase, dex_to_dex_references_ collects methods for dex-to-dex compilation.
583  class DexFileMethodSet;
584  std::vector<DexFileMethodSet> dex_to_dex_references_ GUARDED_BY(dex_to_dex_references_lock_);
585  // In the second phase, current_dex_to_dex_methods_ points to the BitVector with method
586  // indexes for dex-to-dex compilation in the current dex file.
587  const BitVector* current_dex_to_dex_methods_;
588
589  friend class CompileClassVisitor;
590  friend class DexToDexDecompilerTest;
591  friend class verifier::VerifierDepsTest;
592  DISALLOW_COPY_AND_ASSIGN(CompilerDriver);
593};
594
595}  // namespace art
596
597#endif  // ART_COMPILER_DRIVER_COMPILER_DRIVER_H_
598