blob: 91826cf6715d347b9e6e9352adb9c4b69b9e2efd [file] [log] [blame]
Vladimir Markodc151b22015-10-15 18:02:30 +01001/*
2 * Copyright (C) 2015 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#include "sharpening.h"
18
Vladimir Markodb8e62d2016-03-30 16:30:21 +010019#include "base/casts.h"
Andreas Gampe542451c2016-07-26 09:02:02 -070020#include "base/enums.h"
Vladimir Markocac5a7e2016-02-22 10:39:50 +000021#include "class_linker.h"
Vladimir Markodc151b22015-10-15 18:02:30 +010022#include "code_generator.h"
Vladimir Marko3a21e382016-09-02 12:38:38 +010023#include "driver/compiler_options.h"
Vladimir Markocac5a7e2016-02-22 10:39:50 +000024#include "driver/dex_compilation_unit.h"
Vladimir Markodc151b22015-10-15 18:02:30 +010025#include "utils/dex_cache_arrays_layout-inl.h"
26#include "driver/compiler_driver.h"
Vladimir Markocac5a7e2016-02-22 10:39:50 +000027#include "gc/heap.h"
28#include "gc/space/image_space.h"
29#include "handle_scope-inl.h"
30#include "mirror/dex_cache.h"
31#include "mirror/string.h"
Vladimir Markodc151b22015-10-15 18:02:30 +010032#include "nodes.h"
Vladimir Markod1eaf0d2015-10-29 12:18:29 +000033#include "runtime.h"
Mathieu Chartier0795f232016-09-27 18:43:30 -070034#include "scoped_thread_state_change-inl.h"
Vladimir Markodc151b22015-10-15 18:02:30 +010035
36namespace art {
37
38void HSharpening::Run() {
39 // We don't care about the order of the blocks here.
40 for (HBasicBlock* block : graph_->GetReversePostOrder()) {
41 for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) {
42 HInstruction* instruction = it.Current();
43 if (instruction->IsInvokeStaticOrDirect()) {
44 ProcessInvokeStaticOrDirect(instruction->AsInvokeStaticOrDirect());
Vladimir Markodbb7f5b2016-03-30 13:23:58 +010045 } else if (instruction->IsLoadClass()) {
46 ProcessLoadClass(instruction->AsLoadClass());
Vladimir Markocac5a7e2016-02-22 10:39:50 +000047 } else if (instruction->IsLoadString()) {
48 ProcessLoadString(instruction->AsLoadString());
Vladimir Markodc151b22015-10-15 18:02:30 +010049 }
50 // TODO: Move the sharpening of invoke-virtual/-interface/-super from HGraphBuilder
51 // here. Rewrite it to avoid the CompilerDriver's reliance on verifier data
52 // because we know the type better when inlining.
Vladimir Markodc151b22015-10-15 18:02:30 +010053 }
54 }
55}
56
57void HSharpening::ProcessInvokeStaticOrDirect(HInvokeStaticOrDirect* invoke) {
58 if (invoke->IsStringInit()) {
59 // Not using the dex cache arrays. But we could still try to use a better dispatch...
60 // TODO: Use direct_method and direct_code for the appropriate StringFactory method.
61 return;
62 }
63
Nicolas Geoffray5e4e11e2016-09-22 13:17:41 +010064 HGraph* outer_graph = codegen_->GetGraph();
65 ArtMethod* compiling_method = graph_->GetArtMethod();
Vladimir Markodc151b22015-10-15 18:02:30 +010066
67 HInvokeStaticOrDirect::MethodLoadKind method_load_kind;
68 HInvokeStaticOrDirect::CodePtrLocation code_ptr_location;
69 uint64_t method_load_data = 0u;
70 uint64_t direct_code_ptr = 0u;
71
Nicolas Geoffray5e4e11e2016-09-22 13:17:41 +010072 if (invoke->GetResolvedMethod() == outer_graph->GetArtMethod()) {
73 DCHECK(outer_graph->GetArtMethod() != nullptr);
Vladimir Markodc151b22015-10-15 18:02:30 +010074 method_load_kind = HInvokeStaticOrDirect::MethodLoadKind::kRecursive;
75 code_ptr_location = HInvokeStaticOrDirect::CodePtrLocation::kCallSelf;
76 } else {
Nicolas Geoffray5e4e11e2016-09-22 13:17:41 +010077 uintptr_t direct_code, direct_method;
78 {
79 ScopedObjectAccess soa(Thread::Current());
80 compiler_driver_->GetCodeAndMethodForDirectCall(
81 (compiling_method == nullptr) ? nullptr : compiling_method->GetDeclaringClass(),
82 invoke->GetResolvedMethod(),
83 &direct_code,
84 &direct_method);
85 }
Vladimir Markodc151b22015-10-15 18:02:30 +010086 if (direct_method != 0u) { // Should we use a direct pointer to the method?
Vladimir Markod1eaf0d2015-10-29 12:18:29 +000087 // Note: For JIT, kDirectAddressWithFixup doesn't make sense at all and while
88 // kDirectAddress would be fine for image methods, we don't support it at the moment.
Calin Juravleffc87072016-04-20 14:22:09 +010089 DCHECK(!Runtime::Current()->UseJitCompilation());
Vladimir Markodc151b22015-10-15 18:02:30 +010090 if (direct_method != static_cast<uintptr_t>(-1)) { // Is the method pointer known now?
91 method_load_kind = HInvokeStaticOrDirect::MethodLoadKind::kDirectAddress;
92 method_load_data = direct_method;
93 } else { // The direct pointer will be known at link time.
94 method_load_kind = HInvokeStaticOrDirect::MethodLoadKind::kDirectAddressWithFixup;
95 }
96 } else { // Use dex cache.
Nicolas Geoffray5e4e11e2016-09-22 13:17:41 +010097 if (!Runtime::Current()->UseJitCompilation()) {
98 // Use PC-relative access to the dex cache arrays.
Vladimir Markodc151b22015-10-15 18:02:30 +010099 method_load_kind = HInvokeStaticOrDirect::MethodLoadKind::kDexCachePcRelative;
Vladimir Markod1eaf0d2015-10-29 12:18:29 +0000100 DexCacheArraysLayout layout(GetInstructionSetPointerSize(codegen_->GetInstructionSet()),
101 &graph_->GetDexFile());
Nicolas Geoffray5e4e11e2016-09-22 13:17:41 +0100102 method_load_data = layout.MethodOffset(invoke->GetDexMethodIndex());
Vladimir Markodc151b22015-10-15 18:02:30 +0100103 } else { // We must go through the ArtMethod's pointer to resolved methods.
104 method_load_kind = HInvokeStaticOrDirect::MethodLoadKind::kDexCacheViaMethod;
105 }
106 }
107 if (direct_code != 0u) { // Should we use a direct pointer to the code?
Vladimir Markod1eaf0d2015-10-29 12:18:29 +0000108 // Note: For JIT, kCallPCRelative and kCallDirectWithFixup don't make sense at all and
109 // while kCallDirect would be fine for image methods, we don't support it at the moment.
Calin Juravleffc87072016-04-20 14:22:09 +0100110 DCHECK(!Runtime::Current()->UseJitCompilation());
Nicolas Geoffray5e4e11e2016-09-22 13:17:41 +0100111 const DexFile* dex_file_of_callee = invoke->GetTargetMethod().dex_file;
Vladimir Markodc151b22015-10-15 18:02:30 +0100112 if (direct_code != static_cast<uintptr_t>(-1)) { // Is the code pointer known now?
113 code_ptr_location = HInvokeStaticOrDirect::CodePtrLocation::kCallDirect;
114 direct_code_ptr = direct_code;
Nicolas Geoffray5e4e11e2016-09-22 13:17:41 +0100115 } else if (ContainsElement(compiler_driver_->GetDexFilesForOatFile(), dex_file_of_callee)) {
Vladimir Markodc151b22015-10-15 18:02:30 +0100116 // Use PC-relative calls for invokes within a multi-dex oat file.
Vladimir Markodc151b22015-10-15 18:02:30 +0100117 code_ptr_location = HInvokeStaticOrDirect::CodePtrLocation::kCallPCRelative;
118 } else { // The direct pointer will be known at link time.
119 // NOTE: This is used for app->boot calls when compiling an app against
120 // a relocatable but not yet relocated image.
121 code_ptr_location = HInvokeStaticOrDirect::CodePtrLocation::kCallDirectWithFixup;
122 }
123 } else { // We must use the code pointer from the ArtMethod.
124 code_ptr_location = HInvokeStaticOrDirect::CodePtrLocation::kCallArtMethod;
125 }
126 }
127
128 if (graph_->IsDebuggable()) {
129 // For debuggable apps always use the code pointer from ArtMethod
130 // so that we don't circumvent instrumentation stubs if installed.
131 code_ptr_location = HInvokeStaticOrDirect::CodePtrLocation::kCallArtMethod;
132 }
133
134 HInvokeStaticOrDirect::DispatchInfo desired_dispatch_info = {
135 method_load_kind, code_ptr_location, method_load_data, direct_code_ptr
136 };
137 HInvokeStaticOrDirect::DispatchInfo dispatch_info =
Nicolas Geoffray5e4e11e2016-09-22 13:17:41 +0100138 codegen_->GetSupportedInvokeStaticOrDirectDispatch(desired_dispatch_info, invoke);
Vladimir Markodc151b22015-10-15 18:02:30 +0100139 invoke->SetDispatchInfo(dispatch_info);
140}
141
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100142void HSharpening::ProcessLoadClass(HLoadClass* load_class) {
Nicolas Geoffray56876342016-12-16 16:09:08 +0000143 ScopedObjectAccess soa(Thread::Current());
144 StackHandleScope<1> hs(soa.Self());
145 Runtime* runtime = Runtime::Current();
146 ClassLinker* class_linker = runtime->GetClassLinker();
147 const DexFile& dex_file = load_class->GetDexFile();
148 dex::TypeIndex type_index = load_class->GetTypeIndex();
149 Handle<mirror::DexCache> dex_cache = IsSameDexFile(dex_file, *compilation_unit_.GetDexFile())
150 ? compilation_unit_.GetDexCache()
151 : hs.NewHandle(class_linker->FindDexCache(soa.Self(), dex_file));
152 mirror::Class* cls = dex_cache->GetResolvedType(type_index);
153 SharpenClass(load_class, cls, handles_, codegen_, compiler_driver_);
154}
155
156void HSharpening::SharpenClass(HLoadClass* load_class,
157 mirror::Class* klass,
158 VariableSizedHandleScope* handles,
159 CodeGenerator* codegen,
160 CompilerDriver* compiler_driver) {
161 ScopedAssertNoThreadSuspension sants("Sharpening class in compiler");
Mathieu Chartier4a4a6012016-09-16 14:16:42 -0700162 DCHECK(load_class->GetLoadKind() == HLoadClass::LoadKind::kDexCacheViaMethod ||
163 load_class->GetLoadKind() == HLoadClass::LoadKind::kReferrersClass)
164 << load_class->GetLoadKind();
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100165 DCHECK(!load_class->IsInDexCache()) << "HLoadClass should not be optimized before sharpening.";
Mathieu Chartier4a4a6012016-09-16 14:16:42 -0700166 DCHECK(!load_class->IsInBootImage()) << "HLoadClass should not be optimized before sharpening.";
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100167
168 const DexFile& dex_file = load_class->GetDexFile();
Andreas Gampea5b09a62016-11-17 15:21:22 -0800169 dex::TypeIndex type_index = load_class->GetTypeIndex();
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100170
171 bool is_in_dex_cache = false;
Mathieu Chartier31b12e32016-09-02 17:11:57 -0700172 bool is_in_boot_image = false;
Nicolas Geoffray22384ae2016-12-12 22:33:36 +0000173 HLoadClass::LoadKind desired_load_kind = static_cast<HLoadClass::LoadKind>(-1);
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100174 uint64_t address = 0u; // Class or dex cache element address.
Nicolas Geoffray56876342016-12-16 16:09:08 +0000175 Runtime* runtime = Runtime::Current();
176 if (codegen->GetCompilerOptions().IsBootImage()) {
177 // Compiling boot image. Check if the class is a boot image class.
178 DCHECK(!runtime->UseJitCompilation());
179 if (!compiler_driver->GetSupportBootImageFixup()) {
180 // MIPS64 or compiler_driver_test. Do not sharpen.
181 desired_load_kind = HLoadClass::LoadKind::kDexCacheViaMethod;
182 } else if ((klass != nullptr) && compiler_driver->IsImageClass(
183 dex_file.StringDataByIdx(dex_file.GetTypeId(type_index).descriptor_idx_))) {
184 is_in_boot_image = true;
185 is_in_dex_cache = true;
186 desired_load_kind = codegen->GetCompilerOptions().GetCompilePic()
187 ? HLoadClass::LoadKind::kBootImageLinkTimePcRelative
188 : HLoadClass::LoadKind::kBootImageLinkTimeAddress;
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100189 } else {
Nicolas Geoffray56876342016-12-16 16:09:08 +0000190 // Not a boot image class. We must go through the dex cache.
191 DCHECK(ContainsElement(compiler_driver->GetDexFilesForOatFile(), &dex_file));
192 desired_load_kind = HLoadClass::LoadKind::kDexCachePcRelative;
193 }
194 } else {
195 is_in_boot_image = (klass != nullptr) && runtime->GetHeap()->ObjectIsInBootImageSpace(klass);
196 if (runtime->UseJitCompilation()) {
197 // TODO: Make sure we don't set the "compile PIC" flag for JIT as that's bogus.
198 // DCHECK(!codegen_->GetCompilerOptions().GetCompilePic());
199 is_in_dex_cache = (klass != nullptr);
200 if (is_in_boot_image) {
201 // TODO: Use direct pointers for all non-moving spaces, not just boot image. Bug: 29530787
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100202 desired_load_kind = HLoadClass::LoadKind::kBootImageAddress;
203 address = reinterpret_cast64<uint64_t>(klass);
Nicolas Geoffray56876342016-12-16 16:09:08 +0000204 } else if (is_in_dex_cache) {
205 desired_load_kind = HLoadClass::LoadKind::kJitTableAddress;
206 // We store in the address field the location of the stack reference maintained
207 // by the handle. We do this now so that the code generation does not need to figure
208 // out which class loader to use.
209 address = reinterpret_cast<uint64_t>(handles->NewHandle(klass).GetReference());
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100210 } else {
Nicolas Geoffray56876342016-12-16 16:09:08 +0000211 // Class not loaded yet. This happens when the dex code requesting
212 // this `HLoadClass` hasn't been executed in the interpreter.
213 // Fallback to the dex cache.
214 // TODO(ngeoffray): Generate HDeoptimize instead.
215 desired_load_kind = HLoadClass::LoadKind::kDexCacheViaMethod;
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100216 }
Nicolas Geoffray56876342016-12-16 16:09:08 +0000217 } else if (is_in_boot_image && !codegen->GetCompilerOptions().GetCompilePic()) {
218 // AOT app compilation. Check if the class is in the boot image.
219 desired_load_kind = HLoadClass::LoadKind::kBootImageAddress;
220 address = reinterpret_cast64<uint64_t>(klass);
221 } else {
222 // Not JIT and either the klass is not in boot image or we are compiling in PIC mode.
223 // Use PC-relative load from the dex cache if the dex file belongs
224 // to the oat file that we're currently compiling.
225 desired_load_kind =
226 ContainsElement(compiler_driver->GetDexFilesForOatFile(), &load_class->GetDexFile())
227 ? HLoadClass::LoadKind::kDexCachePcRelative
228 : HLoadClass::LoadKind::kDexCacheViaMethod;
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100229 }
230 }
Nicolas Geoffray22384ae2016-12-12 22:33:36 +0000231 DCHECK_NE(desired_load_kind, static_cast<HLoadClass::LoadKind>(-1));
Mathieu Chartier4a4a6012016-09-16 14:16:42 -0700232
Mathieu Chartier31b12e32016-09-02 17:11:57 -0700233 if (is_in_boot_image) {
234 load_class->MarkInBootImage();
235 }
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100236
Mathieu Chartier4a4a6012016-09-16 14:16:42 -0700237 if (load_class->NeedsAccessCheck()) {
238 // We need to call the runtime anyway, so we simply get the class as that call's return value.
239 return;
240 }
241
242 if (load_class->GetLoadKind() == HLoadClass::LoadKind::kReferrersClass) {
243 // Loading from the ArtMethod* is the most efficient retrieval in code size.
244 // TODO: This may not actually be true for all architectures and
245 // locations of target classes. The additional register pressure
246 // for using the ArtMethod* should be considered.
247 return;
248 }
249
250 if (is_in_dex_cache) {
251 load_class->MarkInDexCache();
252 }
253
Nicolas Geoffray56876342016-12-16 16:09:08 +0000254 HLoadClass::LoadKind load_kind = codegen->GetSupportedLoadClassKind(desired_load_kind);
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100255 switch (load_kind) {
256 case HLoadClass::LoadKind::kBootImageLinkTimeAddress:
257 case HLoadClass::LoadKind::kBootImageLinkTimePcRelative:
258 case HLoadClass::LoadKind::kDexCacheViaMethod:
259 load_class->SetLoadKindWithTypeReference(load_kind, dex_file, type_index);
260 break;
261 case HLoadClass::LoadKind::kBootImageAddress:
Nicolas Geoffray22384ae2016-12-12 22:33:36 +0000262 case HLoadClass::LoadKind::kJitTableAddress:
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100263 DCHECK_NE(address, 0u);
264 load_class->SetLoadKindWithAddress(load_kind, address);
265 break;
266 case HLoadClass::LoadKind::kDexCachePcRelative: {
Nicolas Geoffray56876342016-12-16 16:09:08 +0000267 PointerSize pointer_size = InstructionSetPointerSize(codegen->GetInstructionSet());
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100268 DexCacheArraysLayout layout(pointer_size, &dex_file);
269 size_t element_index = layout.TypeOffset(type_index);
270 load_class->SetLoadKindWithDexCacheReference(load_kind, dex_file, element_index);
271 break;
272 }
273 default:
274 LOG(FATAL) << "Unexpected load kind: " << load_kind;
275 UNREACHABLE();
276 }
277}
278
Vladimir Markocac5a7e2016-02-22 10:39:50 +0000279void HSharpening::ProcessLoadString(HLoadString* load_string) {
280 DCHECK_EQ(load_string->GetLoadKind(), HLoadString::LoadKind::kDexCacheViaMethod);
281 DCHECK(!load_string->IsInDexCache());
282
283 const DexFile& dex_file = load_string->GetDexFile();
Andreas Gampe8a0128a2016-11-28 07:38:35 -0800284 dex::StringIndex string_index = load_string->GetStringIndex();
Vladimir Markocac5a7e2016-02-22 10:39:50 +0000285
Christina Wadsworthbf44e0e2016-08-18 10:37:42 -0700286 HLoadString::LoadKind desired_load_kind = HLoadString::LoadKind::kDexCacheViaMethod;
Vladimir Markocac5a7e2016-02-22 10:39:50 +0000287 uint64_t address = 0u; // String or dex cache element address.
288 {
289 Runtime* runtime = Runtime::Current();
290 ClassLinker* class_linker = runtime->GetClassLinker();
291 ScopedObjectAccess soa(Thread::Current());
292 StackHandleScope<1> hs(soa.Self());
293 Handle<mirror::DexCache> dex_cache = IsSameDexFile(dex_file, *compilation_unit_.GetDexFile())
294 ? compilation_unit_.GetDexCache()
295 : hs.NewHandle(class_linker->FindDexCache(soa.Self(), dex_file));
296
Vladimir Markoaad75c62016-10-03 08:46:48 +0000297 if (codegen_->GetCompilerOptions().IsBootImage()) {
Nicolas Geoffray132d8362016-11-16 09:19:42 +0000298 // Compiling boot image. Resolve the string and allocate it if needed, to ensure
299 // the string will be added to the boot image.
Calin Juravleffc87072016-04-20 14:22:09 +0100300 DCHECK(!runtime->UseJitCompilation());
Vladimir Markocac5a7e2016-02-22 10:39:50 +0000301 mirror::String* string = class_linker->ResolveString(dex_file, string_index, dex_cache);
302 CHECK(string != nullptr);
Vladimir Marko95026872016-09-09 09:16:31 +0000303 if (compiler_driver_->GetSupportBootImageFixup()) {
304 DCHECK(ContainsElement(compiler_driver_->GetDexFilesForOatFile(), &dex_file));
305 desired_load_kind = codegen_->GetCompilerOptions().GetCompilePic()
306 ? HLoadString::LoadKind::kBootImageLinkTimePcRelative
307 : HLoadString::LoadKind::kBootImageLinkTimeAddress;
308 } else {
309 // MIPS64 or compiler_driver_test. Do not sharpen.
310 DCHECK_EQ(desired_load_kind, HLoadString::LoadKind::kDexCacheViaMethod);
311 }
Calin Juravleffc87072016-04-20 14:22:09 +0100312 } else if (runtime->UseJitCompilation()) {
Vladimir Markodb8e62d2016-03-30 16:30:21 +0100313 // TODO: Make sure we don't set the "compile PIC" flag for JIT as that's bogus.
Christina Wadsworth5a5d0fa2016-08-19 14:38:01 -0700314 // DCHECK(!codegen_->GetCompilerOptions().GetCompilePic());
Nicolas Geoffray132d8362016-11-16 09:19:42 +0000315 mirror::String* string = class_linker->LookupString(dex_file, string_index, dex_cache);
316 if (string != nullptr) {
317 if (runtime->GetHeap()->ObjectIsInBootImageSpace(string)) {
318 desired_load_kind = HLoadString::LoadKind::kBootImageAddress;
319 address = reinterpret_cast64<uint64_t>(string);
320 } else {
321 desired_load_kind = HLoadString::LoadKind::kJitTableAddress;
322 }
Vladimir Markodb8e62d2016-03-30 16:30:21 +0100323 }
Vladimir Markocac5a7e2016-02-22 10:39:50 +0000324 } else {
Vladimir Markodb8e62d2016-03-30 16:30:21 +0100325 // AOT app compilation. Try to lookup the string without allocating if not found.
Vladimir Markocac5a7e2016-02-22 10:39:50 +0000326 mirror::String* string = class_linker->LookupString(dex_file, string_index, dex_cache);
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100327 if (string != nullptr &&
328 runtime->GetHeap()->ObjectIsInBootImageSpace(string) &&
329 !codegen_->GetCompilerOptions().GetCompilePic()) {
330 desired_load_kind = HLoadString::LoadKind::kBootImageAddress;
331 address = reinterpret_cast64<uint64_t>(string);
Vladimir Markoaad75c62016-10-03 08:46:48 +0000332 } else {
Vladimir Marko1bc4b172016-10-24 16:53:39 +0000333 desired_load_kind = HLoadString::LoadKind::kBssEntry;
Vladimir Markocac5a7e2016-02-22 10:39:50 +0000334 }
335 }
336 }
Vladimir Markocac5a7e2016-02-22 10:39:50 +0000337
338 HLoadString::LoadKind load_kind = codegen_->GetSupportedLoadStringKind(desired_load_kind);
339 switch (load_kind) {
340 case HLoadString::LoadKind::kBootImageLinkTimeAddress:
341 case HLoadString::LoadKind::kBootImageLinkTimePcRelative:
Vladimir Markoaad75c62016-10-03 08:46:48 +0000342 case HLoadString::LoadKind::kBssEntry:
Vladimir Markocac5a7e2016-02-22 10:39:50 +0000343 case HLoadString::LoadKind::kDexCacheViaMethod:
Nicolas Geoffray132d8362016-11-16 09:19:42 +0000344 case HLoadString::LoadKind::kJitTableAddress:
Vladimir Markocac5a7e2016-02-22 10:39:50 +0000345 load_string->SetLoadKindWithStringReference(load_kind, dex_file, string_index);
346 break;
347 case HLoadString::LoadKind::kBootImageAddress:
Vladimir Markocac5a7e2016-02-22 10:39:50 +0000348 DCHECK_NE(address, 0u);
349 load_string->SetLoadKindWithAddress(load_kind, address);
350 break;
Vladimir Markocac5a7e2016-02-22 10:39:50 +0000351 }
352}
353
Vladimir Markodc151b22015-10-15 18:02:30 +0100354} // namespace art