blob: e779646a220392d90067852228fc1f870216c428 [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 Carlstrombffb1552011-08-25 12:23:53 -070013 // Compile the DexFiles on a classpath. Returns a ClassLoader for
14 // the path used by the classes that were compiled. This ClassLoader
15 // can be used with FindClass to lookup a compiled class by name.
16 const ClassLoader* Compile(std::vector<const DexFile*> class_path);
Brian Carlstrom9ea1cb12011-08-24 23:18:18 -070017
18 private:
19 // Attempt to resolve all type, methods, fields, and strings
20 // referenced from code in the dex file following PathClassLoader
21 // ordering semantics.
22 void Resolve(const ClassLoader* class_loader);
23 void ResolveDexFile(const ClassLoader* class_loader, const DexFile& dex_file);
24
25 void CompileDexFile(const ClassLoader* class_loader, const DexFile& dex_file);
26 void CompileClass(Class* klass);
27 void CompileMethod(Method* klass);
28};
29
30} // namespace art
31
32#endif // ART_SRC_COMPILER_H_