TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 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 "runtime_support_builder.h" |
| 18 | |
Ian Rogers | 1d54e73 | 2013-05-02 21:10:01 -0700 | [diff] [blame] | 19 | #include "gc/accounting/card_table.h" |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 20 | #include "ir_builder.h" |
TDYa127 | b08ed12 | 2012-06-05 23:51:19 -0700 | [diff] [blame] | 21 | #include "monitor.h" |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 22 | #include "mirror/object.h" |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 23 | #include "thread.h" |
| 24 | |
Brian Carlstrom | 37d4879 | 2013-03-22 14:14:45 -0700 | [diff] [blame] | 25 | #include <llvm/IR/DerivedTypes.h> |
| 26 | #include <llvm/IR/Function.h> |
| 27 | #include <llvm/IR/Module.h> |
| 28 | #include <llvm/IR/Type.h> |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 29 | |
| 30 | using namespace llvm; |
| 31 | |
| 32 | namespace art { |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 33 | namespace llvm { |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 34 | |
| 35 | using namespace runtime_support; |
| 36 | |
| 37 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 38 | RuntimeSupportBuilder::RuntimeSupportBuilder(::llvm::LLVMContext& context, |
| 39 | ::llvm::Module& module, |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 40 | IRBuilder& irb) |
Brian Carlstrom | 2ce745c | 2013-07-17 17:44:30 -0700 | [diff] [blame] | 41 | : context_(context), module_(module), irb_(irb) { |
TDYa127 | 83bb662 | 2012-04-17 02:20:34 -0700 | [diff] [blame] | 42 | memset(target_runtime_support_func_, 0, sizeof(target_runtime_support_func_)); |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 43 | #define GET_RUNTIME_SUPPORT_FUNC_DECL(ID, NAME) \ |
| 44 | do { \ |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 45 | ::llvm::Function* fn = module_.getFunction(#NAME); \ |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 46 | DCHECK_NE(fn, (void*)NULL) << "Function not found: " << #NAME; \ |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 47 | runtime_support_func_decls_[runtime_support::ID] = fn; \ |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 48 | } while (0); |
| 49 | |
Brian Carlstrom | 51c2467 | 2013-07-11 16:00:56 -0700 | [diff] [blame] | 50 | #include "runtime_support_llvm_func_list.h" |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 51 | RUNTIME_SUPPORT_FUNC_LIST(GET_RUNTIME_SUPPORT_FUNC_DECL) |
| 52 | #undef RUNTIME_SUPPORT_FUNC_LIST |
| 53 | #undef GET_RUNTIME_SUPPORT_FUNC_DECL |
| 54 | } |
| 55 | |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 56 | |
| 57 | /* Thread */ |
| 58 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 59 | ::llvm::Value* RuntimeSupportBuilder::EmitGetCurrentThread() { |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 60 | Function* func = GetRuntimeSupportFunction(runtime_support::GetCurrentThread); |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 61 | CallInst* call_inst = irb_.CreateCall(func); |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 62 | call_inst->setOnlyReadsMemory(); |
| 63 | irb_.SetTBAA(call_inst, kTBAAConstJObject); |
| 64 | return call_inst; |
| 65 | } |
| 66 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 67 | ::llvm::Value* RuntimeSupportBuilder::EmitLoadFromThreadOffset(int64_t offset, ::llvm::Type* type, |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 68 | TBAASpecialType s_ty) { |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 69 | Value* thread = EmitGetCurrentThread(); |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 70 | return irb_.LoadFromObjectOffset(thread, offset, type, s_ty); |
| 71 | } |
| 72 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 73 | void RuntimeSupportBuilder::EmitStoreToThreadOffset(int64_t offset, ::llvm::Value* value, |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 74 | TBAASpecialType s_ty) { |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 75 | Value* thread = EmitGetCurrentThread(); |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 76 | irb_.StoreToObjectOffset(thread, offset, value, s_ty); |
| 77 | } |
| 78 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 79 | ::llvm::Value* RuntimeSupportBuilder::EmitSetCurrentThread(::llvm::Value* thread) { |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 80 | Function* func = GetRuntimeSupportFunction(runtime_support::SetCurrentThread); |
TDYa127 | c147826 | 2012-06-20 20:22:27 -0700 | [diff] [blame] | 81 | return irb_.CreateCall(func, thread); |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 82 | } |
| 83 | |
| 84 | |
| 85 | /* ShadowFrame */ |
| 86 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 87 | ::llvm::Value* RuntimeSupportBuilder::EmitPushShadowFrame(::llvm::Value* new_shadow_frame, |
| 88 | ::llvm::Value* method, |
TDYa127 | ce4cc0d | 2012-11-18 16:59:53 -0800 | [diff] [blame] | 89 | uint32_t num_vregs) { |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 90 | Value* old_shadow_frame = EmitLoadFromThreadOffset(Thread::TopShadowFrameOffset().Int32Value(), |
| 91 | irb_.getArtFrameTy()->getPointerTo(), |
| 92 | kTBAARuntimeInfo); |
| 93 | EmitStoreToThreadOffset(Thread::TopShadowFrameOffset().Int32Value(), |
| 94 | new_shadow_frame, |
| 95 | kTBAARuntimeInfo); |
| 96 | |
| 97 | // Store the method pointer |
| 98 | irb_.StoreToObjectOffset(new_shadow_frame, |
| 99 | ShadowFrame::MethodOffset(), |
| 100 | method, |
| 101 | kTBAAShadowFrame); |
| 102 | |
Ian Rogers | 5438ad8 | 2012-10-15 17:22:44 -0700 | [diff] [blame] | 103 | // Store the number of vregs |
| 104 | irb_.StoreToObjectOffset(new_shadow_frame, |
| 105 | ShadowFrame::NumberOfVRegsOffset(), |
TDYa127 | ce4cc0d | 2012-11-18 16:59:53 -0800 | [diff] [blame] | 106 | irb_.getInt32(num_vregs), |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 107 | kTBAAShadowFrame); |
| 108 | |
| 109 | // Store the link to previous shadow frame |
| 110 | irb_.StoreToObjectOffset(new_shadow_frame, |
| 111 | ShadowFrame::LinkOffset(), |
| 112 | old_shadow_frame, |
| 113 | kTBAAShadowFrame); |
| 114 | |
| 115 | return old_shadow_frame; |
| 116 | } |
| 117 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 118 | ::llvm::Value* |
| 119 | RuntimeSupportBuilder::EmitPushShadowFrameNoInline(::llvm::Value* new_shadow_frame, |
| 120 | ::llvm::Value* method, |
TDYa127 | ce4cc0d | 2012-11-18 16:59:53 -0800 | [diff] [blame] | 121 | uint32_t num_vregs) { |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 122 | Function* func = GetRuntimeSupportFunction(runtime_support::PushShadowFrame); |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 123 | ::llvm::CallInst* call_inst = |
TDYa127 | ce4cc0d | 2012-11-18 16:59:53 -0800 | [diff] [blame] | 124 | irb_.CreateCall4(func, |
TDYa127 | f54f3ac | 2012-10-16 22:39:00 -0700 | [diff] [blame] | 125 | EmitGetCurrentThread(), |
| 126 | new_shadow_frame, |
| 127 | method, |
TDYa127 | ce4cc0d | 2012-11-18 16:59:53 -0800 | [diff] [blame] | 128 | irb_.getInt32(num_vregs)); |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 129 | irb_.SetTBAA(call_inst, kTBAARuntimeInfo); |
| 130 | return call_inst; |
| 131 | } |
| 132 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 133 | void RuntimeSupportBuilder::EmitPopShadowFrame(::llvm::Value* old_shadow_frame) { |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 134 | // Store old shadow frame to TopShadowFrame |
| 135 | EmitStoreToThreadOffset(Thread::TopShadowFrameOffset().Int32Value(), |
| 136 | old_shadow_frame, |
| 137 | kTBAARuntimeInfo); |
| 138 | } |
| 139 | |
| 140 | |
TDYa127 | 823433d | 2012-09-26 16:03:51 -0700 | [diff] [blame] | 141 | /* Exception */ |
| 142 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 143 | ::llvm::Value* RuntimeSupportBuilder::EmitGetAndClearException() { |
TDYa127 | 823433d | 2012-09-26 16:03:51 -0700 | [diff] [blame] | 144 | Function* slow_func = GetRuntimeSupportFunction(runtime_support::GetAndClearException); |
| 145 | return irb_.CreateCall(slow_func, EmitGetCurrentThread()); |
| 146 | } |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 147 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 148 | ::llvm::Value* RuntimeSupportBuilder::EmitIsExceptionPending() { |
Jeff Hao | a8fd2d5 | 2013-01-17 23:10:27 +0000 | [diff] [blame] | 149 | Value* exception = EmitLoadFromThreadOffset(Thread::ExceptionOffset().Int32Value(), |
| 150 | irb_.getJObjectTy(), |
| 151 | kTBAARuntimeInfo); |
| 152 | // If exception not null |
| 153 | return irb_.CreateIsNotNull(exception); |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 154 | } |
| 155 | |
TDYa127 | 823433d | 2012-09-26 16:03:51 -0700 | [diff] [blame] | 156 | |
| 157 | /* Suspend */ |
| 158 | |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 159 | void RuntimeSupportBuilder::EmitTestSuspend() { |
| 160 | Function* slow_func = GetRuntimeSupportFunction(runtime_support::TestSuspend); |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 161 | CallInst* call_inst = irb_.CreateCall(slow_func, EmitGetCurrentThread()); |
TDYa127 | ce4cc0d | 2012-11-18 16:59:53 -0800 | [diff] [blame] | 162 | irb_.SetTBAA(call_inst, kTBAAJRuntime); |
TDYa127 | de479be | 2012-05-31 08:03:26 -0700 | [diff] [blame] | 163 | } |
| 164 | |
| 165 | |
TDYa127 | b08ed12 | 2012-06-05 23:51:19 -0700 | [diff] [blame] | 166 | /* Monitor */ |
| 167 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 168 | void RuntimeSupportBuilder::EmitLockObject(::llvm::Value* object) { |
Sebastien Hertz | 50a1abf | 2013-02-18 14:36:41 +0100 | [diff] [blame] | 169 | Value* monitor = |
| 170 | irb_.LoadFromObjectOffset(object, |
| 171 | mirror::Object::MonitorOffset().Int32Value(), |
| 172 | irb_.getJIntTy(), |
| 173 | kTBAARuntimeInfo); |
| 174 | |
| 175 | Value* real_monitor = |
| 176 | irb_.CreateAnd(monitor, ~(LW_HASH_STATE_MASK << LW_HASH_STATE_SHIFT)); |
| 177 | |
| 178 | // Is thin lock, unheld and not recursively acquired. |
| 179 | Value* unheld = irb_.CreateICmpEQ(real_monitor, irb_.getInt32(0)); |
| 180 | |
| 181 | Function* parent_func = irb_.GetInsertBlock()->getParent(); |
| 182 | BasicBlock* bb_fast = BasicBlock::Create(context_, "lock_fast", parent_func); |
| 183 | BasicBlock* bb_slow = BasicBlock::Create(context_, "lock_slow", parent_func); |
| 184 | BasicBlock* bb_cont = BasicBlock::Create(context_, "lock_cont", parent_func); |
| 185 | irb_.CreateCondBr(unheld, bb_fast, bb_slow, kLikely); |
| 186 | |
| 187 | irb_.SetInsertPoint(bb_fast); |
| 188 | |
| 189 | // Calculate new monitor: new = old | (lock_id << LW_LOCK_OWNER_SHIFT) |
| 190 | Value* lock_id = |
| 191 | EmitLoadFromThreadOffset(Thread::ThinLockIdOffset().Int32Value(), |
| 192 | irb_.getInt32Ty(), kTBAARuntimeInfo); |
| 193 | |
| 194 | Value* owner = irb_.CreateShl(lock_id, LW_LOCK_OWNER_SHIFT); |
| 195 | Value* new_monitor = irb_.CreateOr(monitor, owner); |
| 196 | |
| 197 | // Atomically update monitor. |
| 198 | Value* old_monitor = |
| 199 | irb_.CompareExchangeObjectOffset(object, |
| 200 | mirror::Object::MonitorOffset().Int32Value(), |
| 201 | monitor, new_monitor, kTBAARuntimeInfo); |
| 202 | |
| 203 | Value* retry_slow_path = irb_.CreateICmpEQ(old_monitor, monitor); |
| 204 | irb_.CreateCondBr(retry_slow_path, bb_cont, bb_slow, kLikely); |
| 205 | |
| 206 | irb_.SetInsertPoint(bb_slow); |
TDYa127 | b08ed12 | 2012-06-05 23:51:19 -0700 | [diff] [blame] | 207 | Function* slow_func = GetRuntimeSupportFunction(runtime_support::LockObject); |
| 208 | irb_.CreateCall2(slow_func, object, EmitGetCurrentThread()); |
Sebastien Hertz | 50a1abf | 2013-02-18 14:36:41 +0100 | [diff] [blame] | 209 | irb_.CreateBr(bb_cont); |
| 210 | |
| 211 | irb_.SetInsertPoint(bb_cont); |
TDYa127 | b08ed12 | 2012-06-05 23:51:19 -0700 | [diff] [blame] | 212 | } |
| 213 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 214 | void RuntimeSupportBuilder::EmitUnlockObject(::llvm::Value* object) { |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 215 | Value* lock_id = |
TDYa127 | b08ed12 | 2012-06-05 23:51:19 -0700 | [diff] [blame] | 216 | EmitLoadFromThreadOffset(Thread::ThinLockIdOffset().Int32Value(), |
| 217 | irb_.getJIntTy(), |
| 218 | kTBAARuntimeInfo); |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 219 | Value* monitor = |
TDYa127 | b08ed12 | 2012-06-05 23:51:19 -0700 | [diff] [blame] | 220 | irb_.LoadFromObjectOffset(object, |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 221 | mirror::Object::MonitorOffset().Int32Value(), |
TDYa127 | b08ed12 | 2012-06-05 23:51:19 -0700 | [diff] [blame] | 222 | irb_.getJIntTy(), |
| 223 | kTBAARuntimeInfo); |
| 224 | |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 225 | Value* my_monitor = irb_.CreateShl(lock_id, LW_LOCK_OWNER_SHIFT); |
| 226 | Value* hash_state = irb_.CreateAnd(monitor, (LW_HASH_STATE_MASK << LW_HASH_STATE_SHIFT)); |
| 227 | Value* real_monitor = irb_.CreateAnd(monitor, ~(LW_HASH_STATE_MASK << LW_HASH_STATE_SHIFT)); |
TDYa127 | b08ed12 | 2012-06-05 23:51:19 -0700 | [diff] [blame] | 228 | |
| 229 | // Is thin lock, held by us and not recursively acquired |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 230 | Value* is_fast_path = irb_.CreateICmpEQ(real_monitor, my_monitor); |
TDYa127 | b08ed12 | 2012-06-05 23:51:19 -0700 | [diff] [blame] | 231 | |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 232 | Function* parent_func = irb_.GetInsertBlock()->getParent(); |
TDYa127 | b08ed12 | 2012-06-05 23:51:19 -0700 | [diff] [blame] | 233 | BasicBlock* bb_fast = BasicBlock::Create(context_, "unlock_fast", parent_func); |
| 234 | BasicBlock* bb_slow = BasicBlock::Create(context_, "unlock_slow", parent_func); |
| 235 | BasicBlock* bb_cont = BasicBlock::Create(context_, "unlock_cont", parent_func); |
| 236 | irb_.CreateCondBr(is_fast_path, bb_fast, bb_slow, kLikely); |
| 237 | |
| 238 | irb_.SetInsertPoint(bb_fast); |
| 239 | // Set all bits to zero (except hash state) |
| 240 | irb_.StoreToObjectOffset(object, |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame] | 241 | mirror::Object::MonitorOffset().Int32Value(), |
TDYa127 | b08ed12 | 2012-06-05 23:51:19 -0700 | [diff] [blame] | 242 | hash_state, |
| 243 | kTBAARuntimeInfo); |
| 244 | irb_.CreateBr(bb_cont); |
| 245 | |
| 246 | irb_.SetInsertPoint(bb_slow); |
| 247 | Function* slow_func = GetRuntimeSupportFunction(runtime_support::UnlockObject); |
| 248 | irb_.CreateCall2(slow_func, object, EmitGetCurrentThread()); |
| 249 | irb_.CreateBr(bb_cont); |
| 250 | |
| 251 | irb_.SetInsertPoint(bb_cont); |
| 252 | } |
| 253 | |
| 254 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 255 | void RuntimeSupportBuilder::EmitMarkGCCard(::llvm::Value* value, ::llvm::Value* target_addr) { |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 256 | Function* parent_func = irb_.GetInsertBlock()->getParent(); |
| 257 | BasicBlock* bb_mark_gc_card = BasicBlock::Create(context_, "mark_gc_card", parent_func); |
| 258 | BasicBlock* bb_cont = BasicBlock::Create(context_, "mark_gc_card_cont", parent_func); |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 259 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 260 | ::llvm::Value* not_null = irb_.CreateIsNotNull(value); |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 261 | irb_.CreateCondBr(not_null, bb_mark_gc_card, bb_cont); |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 262 | |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 263 | irb_.SetInsertPoint(bb_mark_gc_card); |
| 264 | Value* card_table = EmitLoadFromThreadOffset(Thread::CardTableOffset().Int32Value(), |
| 265 | irb_.getInt8Ty()->getPointerTo(), |
| 266 | kTBAAConstJObject); |
| 267 | Value* target_addr_int = irb_.CreatePtrToInt(target_addr, irb_.getPtrEquivIntTy()); |
Ian Rogers | 1d54e73 | 2013-05-02 21:10:01 -0700 | [diff] [blame] | 268 | Value* card_no = irb_.CreateLShr(target_addr_int, |
| 269 | irb_.getPtrEquivInt(gc::accounting::CardTable::kCardShift)); |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 270 | Value* card_table_entry = irb_.CreateGEP(card_table, card_no); |
Ian Rogers | 1d54e73 | 2013-05-02 21:10:01 -0700 | [diff] [blame] | 271 | irb_.CreateStore(irb_.getInt8(gc::accounting::CardTable::kCardDirty), card_table_entry, |
| 272 | kTBAARuntimeInfo); |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 273 | irb_.CreateBr(bb_cont); |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 274 | |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 275 | irb_.SetInsertPoint(bb_cont); |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 276 | } |
| 277 | |
TDYa127 | 9a12945 | 2012-07-19 03:10:08 -0700 | [diff] [blame] | 278 | |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 279 | } // namespace llvm |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 280 | } // namespace art |