blob: 1214d3ca00d7e5e36a66860235244a5a8bfa150b [file] [log] [blame]
Brian Carlstrom9ea1cb12011-08-24 23:18:18 -07001// Copyright 2011 Google Inc. All Rights Reserved.
2
3#ifndef ART_SRC_COMPILER_H_
4#define ART_SRC_COMPILER_H_
5
6#include "dex_file.h"
7#include "object.h"
8
9namespace art {
10
11class Compiler {
12 public:
Brian Carlstrom8a487412011-08-29 20:08:52 -070013 // Compile all Methods of all the Classes of all the DexFiles that are part of a ClassLoader.
14 void CompileAll(const ClassLoader* class_loader);
15
16 // Compile a single Method
17 void CompileOne(Method* method);
Brian Carlstrom9ea1cb12011-08-24 23:18:18 -070018
19 private:
20 // Attempt to resolve all type, methods, fields, and strings
21 // referenced from code in the dex file following PathClassLoader
22 // ordering semantics.
23 void Resolve(const ClassLoader* class_loader);
24 void ResolveDexFile(const ClassLoader* class_loader, const DexFile& dex_file);
25
Brian Carlstrom83db7722011-08-26 17:32:56 -070026 void Compile(const ClassLoader* class_loader);
Brian Carlstrom9ea1cb12011-08-24 23:18:18 -070027 void CompileDexFile(const ClassLoader* class_loader, const DexFile& dex_file);
28 void CompileClass(Class* klass);
29 void CompileMethod(Method* klass);
Brian Carlstrom83db7722011-08-26 17:32:56 -070030
31 // After compiling, walk all the DexCaches and set the code and
Brian Carlstrom9cc262e2011-08-28 12:45:30 -070032 // method pointers of CodeAndDirectMethods entries in the DexCaches.
33 void SetCodeAndDirectMethods(const ClassLoader* class_loader);
Brian Carlstrom8a487412011-08-29 20:08:52 -070034 void SetCodeAndDirectMethodsDexFile(const DexFile& dex_file);
Brian Carlstrom9ea1cb12011-08-24 23:18:18 -070035};
36
37} // namespace art
38
39#endif // ART_SRC_COMPILER_H_