summaryrefslogtreecommitdiff
path: root/runtime/compiler_callbacks.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/compiler_callbacks.h')
-rw-r--r--runtime/compiler_callbacks.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/runtime/compiler_callbacks.h b/runtime/compiler_callbacks.h
index 6855dcdb2b..279d5ab764 100644
--- a/runtime/compiler_callbacks.h
+++ b/runtime/compiler_callbacks.h
@@ -42,6 +42,7 @@ class CompilerCallbacks {
public:
enum class CallbackMode { // private
kCompileBootImage,
+ kCompileCoreImage,
kCompileApp
};
@@ -67,8 +68,15 @@ class CompilerCallbacks {
virtual void SetDoesClassUnloading(bool does_class_unloading ATTRIBUTE_UNUSED,
CompilerDriver* compiler_driver ATTRIBUTE_UNUSED) {}
+ // Returns true if the compiler is compiling a boot image.
+ // Note that core image (a minimal boot image for testing) is also considered a boot image.
bool IsBootImage() {
- return mode_ == CallbackMode::kCompileBootImage;
+ return mode_ == CallbackMode::kCompileBootImage || mode_ == CallbackMode::kCompileCoreImage;
+ }
+
+ // Returns true if the compiler is compiling a core image (a minimal boot image for testing).
+ bool IsCoreImage() {
+ return mode_ == CallbackMode::kCompileCoreImage;
}
virtual void UpdateClassState(ClassReference ref ATTRIBUTE_UNUSED,