summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2016-06-21 15:12:24 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-06-21 15:12:24 +0000
commitf6d4f6e0e61977777b7a9ca18b75bcd26e98e9f9 (patch)
treeb647b68165992bc4f26287f564a18f6ce68a8082 /compiler/optimizing/code_generator.h
parent2150d94b5a399dd7d52e1309da2e3bf80d1a5517 (diff)
parentdbb7f5bef10138ade0fb202da1d61f562b2df649 (diff)
Merge "Improve HLoadClass code generation."
Diffstat (limited to 'compiler/optimizing/code_generator.h')
-rw-r--r--compiler/optimizing/code_generator.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h
index 82a54d2ed1..81c1a7fe16 100644
--- a/compiler/optimizing/code_generator.h
+++ b/compiler/optimizing/code_generator.h
@@ -449,10 +449,15 @@ class CodeGenerator : public DeletableArenaObject<kArenaAllocCodeGenerator> {
SlowPathCode* slow_path) = 0;
// Check if the desired_string_load_kind is supported. If it is, return it,
- // otherwise return a fall-back info that should be used instead.
+ // otherwise return a fall-back kind that should be used instead.
virtual HLoadString::LoadKind GetSupportedLoadStringKind(
HLoadString::LoadKind desired_string_load_kind) = 0;
+ // Check if the desired_class_load_kind is supported. If it is, return it,
+ // otherwise return a fall-back kind that should be used instead.
+ virtual HLoadClass::LoadKind GetSupportedLoadClassKind(
+ HLoadClass::LoadKind desired_class_load_kind) = 0;
+
// Check if the desired_dispatch_info is supported. If it is, return it,
// otherwise return a fall-back info that should be used instead.
virtual HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch(
@@ -496,6 +501,20 @@ class CodeGenerator : public DeletableArenaObject<kArenaAllocCodeGenerator> {
LabelType label;
};
+ // Type patch info used for recording locations of required linker patches and
+ // target types. The actual type address can be absolute or PC-relative.
+ // TODO: Consider merging with MethodPatchInfo and StringPatchInfo - all these
+ // classes contain the dex file, some index and the label.
+ template <typename LabelType>
+ struct TypePatchInfo {
+ TypePatchInfo(const DexFile& df, uint32_t index)
+ : dex_file(df), type_index(index), label() { }
+
+ const DexFile& dex_file;
+ uint32_t type_index;
+ LabelType label;
+ };
+
CodeGenerator(HGraph* graph,
size_t number_of_core_registers,
size_t number_of_fpu_registers,