Merge "TBAA, separate RuntimeInfo and ShadowFrame." into ics-mr1-plus-art
diff --git a/src/compiler_llvm/backend_types.h b/src/compiler_llvm/backend_types.h
index f7449a5..24703b8 100644
--- a/src/compiler_llvm/backend_types.h
+++ b/src/compiler_llvm/backend_types.h
@@ -64,6 +64,7 @@
   kTBAAHeapStatic,
   kTBAAJRuntime,
   kTBAARuntimeInfo,
+  kTBAAShadowFrame,
   kTBAAConstJObject,
   MAX_TBAA_SPECIAL_TYPE
 };
diff --git a/src/compiler_llvm/dalvik_reg.cc b/src/compiler_llvm/dalvik_reg.cc
index 6f7e908..ab5cc40 100644
--- a/src/compiler_llvm/dalvik_reg.cc
+++ b/src/compiler_llvm/dalvik_reg.cc
@@ -249,7 +249,7 @@
   if (jty == kObject) {
     DCHECK_NE(reg_shadow_frame_, static_cast<llvm::Value*>(NULL))
       << "Didn't allocate shadow frame entry.";
-    irb_.CreateStore(value, reg_shadow_frame_, kTBAARuntimeInfo);
+    irb_.CreateStore(value, reg_shadow_frame_, kTBAAShadowFrame);
   }
 }
 
diff --git a/src/compiler_llvm/jni_compiler.cc b/src/compiler_llvm/jni_compiler.cc
index 357d50d..4b9fb05 100644
--- a/src/compiler_llvm/jni_compiler.cc
+++ b/src/compiler_llvm/jni_compiler.cc
@@ -120,19 +120,19 @@
     irb_.CreatePtrDisp(shadow_frame_,
                        irb_.getPtrEquivInt(ShadowFrame::MethodOffset()),
                        irb_.getJObjectTy()->getPointerTo());
-  irb_.CreateStore(method_object_addr, method_field_addr, kTBAARuntimeInfo);
+  irb_.CreateStore(method_object_addr, method_field_addr, kTBAAShadowFrame);
 
   // Store the dex pc
   irb_.StoreToObjectOffset(shadow_frame_,
                            ShadowFrame::DexPCOffset(),
                            irb_.getInt32(0),
-                           kTBAARuntimeInfo);
+                           kTBAAShadowFrame);
 
   // Store the number of the pointer slots
   irb_.StoreToObjectOffset(shadow_frame_,
                            ShadowFrame::NumberOfReferencesOffset(),
                            irb_.getInt32(sirt_size),
-                           kTBAARuntimeInfo);
+                           kTBAAShadowFrame);
 
   // Push the shadow frame
   llvm::Value* shadow_frame_upcast = irb_.CreateConstGEP2_32(shadow_frame_, 0, 0);
@@ -176,7 +176,7 @@
   // Store the "this object or class object" to SIRT
   gep_index[2] = irb_.getInt32(sirt_member_index++);
   llvm::Value* sirt_field_addr = irb_.CreateGEP(shadow_frame_, gep_index);
-  irb_.CreateStore(this_object_or_class_object, sirt_field_addr, kTBAARuntimeInfo);
+  irb_.CreateStore(this_object_or_class_object, sirt_field_addr, kTBAAShadowFrame);
   // Push the "this object or class object" to out args
   args.push_back(irb_.CreateBitCast(sirt_field_addr, irb_.getJObjectTy()));
   // Store arguments to SIRT, and push back to args
@@ -185,7 +185,7 @@
       // Store the reference type arguments to SIRT
       gep_index[2] = irb_.getInt32(sirt_member_index++);
       llvm::Value* sirt_field_addr = irb_.CreateGEP(shadow_frame_, gep_index);
-      irb_.CreateStore(arg_iter, sirt_field_addr, kTBAARuntimeInfo);
+      irb_.CreateStore(arg_iter, sirt_field_addr, kTBAAShadowFrame);
       // Note null is placed in the SIRT but the jobject passed to the native code must be null
       // (not a pointer into the SIRT as with regular references).
       llvm::Value* equal_null = irb_.CreateICmpEQ(arg_iter, irb_.getJNull());
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index de0e1ea..b3ae1a6 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -262,7 +262,7 @@
   llvm::ConstantAggregateZero* zero_initializer =
     llvm::ConstantAggregateZero::get(shadow_frame_type);
 
-  irb_.CreateStore(zero_initializer, shadow_frame_, kTBAARuntimeInfo);
+  irb_.CreateStore(zero_initializer, shadow_frame_, kTBAAShadowFrame);
 
   // Get method object
   llvm::Value* method_object_addr = EmitLoadMethodObjectAddr();
@@ -271,13 +271,13 @@
   irb_.StoreToObjectOffset(shadow_frame_,
                            ShadowFrame::MethodOffset(),
                            method_object_addr,
-                           kTBAARuntimeInfo);
+                           kTBAAShadowFrame);
 
   // Store the number of the pointer slots
   irb_.StoreToObjectOffset(shadow_frame_,
                            ShadowFrame::NumberOfReferencesOffset(),
                            irb_.getJInt(sirt_size),
-                           kTBAARuntimeInfo);
+                           kTBAAShadowFrame);
 
   // Push the shadow frame
   llvm::Value* shadow_frame_upcast =
@@ -3918,7 +3918,7 @@
   irb_.StoreToObjectOffset(shadow_frame_,
                            ShadowFrame::DexPCOffset(),
                            irb_.getInt32(dex_pc),
-                           kTBAARuntimeInfo);
+                           kTBAAShadowFrame);
 }
 
 
diff --git a/src/compiler_llvm/runtime_support_builder.cc b/src/compiler_llvm/runtime_support_builder.cc
index 0350031..c5a44ab 100644
--- a/src/compiler_llvm/runtime_support_builder.cc
+++ b/src/compiler_llvm/runtime_support_builder.cc
@@ -88,7 +88,7 @@
     irb_.StoreToObjectOffset(new_shadow_frame,
                              ShadowFrame::LinkOffset(),
                              old_shadow_frame,
-                             kTBAARuntimeInfo);
+                             kTBAAShadowFrame);
     irb_.StoreToObjectOffset(thread,
                              Thread::TopShadowFrameOffset().Int32Value(),
                              new_shadow_frame,
@@ -113,7 +113,7 @@
     Value* old_shadow_frame = irb_.LoadFromObjectOffset(new_shadow_frame,
                                                         ShadowFrame::LinkOffset(),
                                                         irb_.getJObjectTy(),
-                                                        kTBAARuntimeInfo);
+                                                        kTBAAShadowFrame);
     irb_.StoreToObjectOffset(thread,
                              Thread::TopShadowFrameOffset().Int32Value(),
                              old_shadow_frame,
diff --git a/src/compiler_llvm/tbaa_info.cc b/src/compiler_llvm/tbaa_info.cc
index 913760b..03ef525 100644
--- a/src/compiler_llvm/tbaa_info.cc
+++ b/src/compiler_llvm/tbaa_info.cc
@@ -49,6 +49,7 @@
     case kTBAAHeapStatic:   spec_ty = GenTBAANode("HeapStatic", GetRootType()); break;
     case kTBAAJRuntime:     spec_ty = GenTBAANode("JRuntime", GetRootType()); break;
     case kTBAARuntimeInfo:  spec_ty = GenTBAANode("RuntimeInfo", GetRootType()); break;
+    case kTBAAShadowFrame:  spec_ty = GenTBAANode("ShadowFrame", GetRootType()); break;
     case kTBAAConstJObject: spec_ty = GenTBAANode("ConstJObject", GetRootType(), true); break;
     default:
       LOG(FATAL) << "Unknown TBAA special type: " << sty_id;