[vmkit-commits] [vmkit] r180290 - Added AddressAttemptObjectReference implementation.

Peter Senna Tschudin peter.senna at gmail.com
Thu Apr 25 09:49:52 PDT 2013


Author: peter.senna
Date: Thu Apr 25 11:48:16 2013
New Revision: 180290

URL: http://llvm.org/viewvc/llvm-project?rev=180290&view=rev
Log:
Added AddressAttemptObjectReference implementation.
(cherry picked from commit d549d47f8f80fed8b90eec95898ec4b619bec1ec)

Modified:
    vmkit/trunk/mmtk/magic/LowerMagic.cpp

Modified: vmkit/trunk/mmtk/magic/LowerMagic.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/magic/LowerMagic.cpp?rev=180290&r1=180289&r2=180290&view=diff
==============================================================================
--- vmkit/trunk/mmtk/magic/LowerMagic.cpp (original)
+++ vmkit/trunk/mmtk/magic/LowerMagic.cpp Thu Apr 25 11:48:16 2013
@@ -119,8 +119,8 @@ static const char* AddressPrepareWordAtO
 //static const char* AddressAttemptIntAtOffsetMethod;
 static const char* AddressAttemptWordMethod;
 static const char* AddressAttemptWordAtOffsetMethod;
-//static const char* AddressAttemptObjectReferenceMethod;
-//static const char* AddressAttemptObjectReferenceAtOffsetMethod;
+static const char* AddressAttemptObjectReferenceMethod;
+static const char* AddressAttemptObjectReferenceAtOffsetMethod;
 //static const char* AddressAttemptAddressMethod;
 //static const char* AddressAttemptAddressAtOffsetMethod;
 
@@ -257,6 +257,7 @@ static void initialiseFunctions(Module*
     AddressToWordMethod = "JnJVM_org_vmmagic_unboxed_Address_toWord__";
     AddressPrepareWordMethod = "JnJVM_org_vmmagic_unboxed_Address_prepareWord__";
     AddressAttemptWordAtOffsetMethod = "JnJVM_org_vmmagic_unboxed_Address_attempt__Lorg_vmmagic_unboxed_Word_2Lorg_vmmagic_unboxed_Word_2Lorg_vmmagic_unboxed_Offset_2";
+    AddressAttemptObjectReferenceAtOffsetMethod = "JnJVM_org_vmmagic_unboxed_Address_attempt__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Offset_2";
     AddressPrepareWordAtOffsetMethod = "JnJVM_org_vmmagic_unboxed_Address_prepareWord__Lorg_vmmagic_unboxed_Offset_2";
     AddressLoadWordAtOffsetMethod = "JnJVM_org_vmmagic_unboxed_Address_loadWord__Lorg_vmmagic_unboxed_Offset_2";
     AddressStoreWordAtOffsetMethod = "JnJVM_org_vmmagic_unboxed_Address_store__Lorg_vmmagic_unboxed_Word_2Lorg_vmmagic_unboxed_Offset_2";
@@ -269,6 +270,7 @@ static void initialiseFunctions(Module*
     AddressLoadObjectReferenceAtOffsetMethod = "JnJVM_org_vmmagic_unboxed_Address_loadObjectReference__Lorg_vmmagic_unboxed_Offset_2";
     AddressLEMethod = "JnJVM_org_vmmagic_unboxed_Address_LE__Lorg_vmmagic_unboxed_Address_2";
     AddressAttemptWordMethod = "JnJVM_org_vmmagic_unboxed_Address_attempt__Lorg_vmmagic_unboxed_Word_2Lorg_vmmagic_unboxed_Word_2";
+    AddressAttemptObjectReferenceMethod = "JnJVM_org_vmmagic_unboxed_Address_attempt__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2";
     AddressNEMethod = "JnJVM_org_vmmagic_unboxed_Address_NE__Lorg_vmmagic_unboxed_Address_2";
     AddressToLongMethod = "JnJVM_org_vmmagic_unboxed_Address_toLong__";
     AddressMinusExtentMethod = "JnJVM_org_vmmagic_unboxed_Address_minus__Lorg_vmmagic_unboxed_Extent_2";
@@ -596,7 +598,8 @@ bool LowerMagic::runOnFunction(Function&
             	Val = new BitCastInst(Val, FCur->getReturnType(), "", CI);
             	CI->replaceAllUsesWith(Val);
               CI->eraseFromParent();
-            } else if (!strcmp(FCur->getName().data(), AddressAttemptWordAtOffsetMethod)) {
+            } else if (!strcmp(FCur->getName().data(), AddressAttemptWordAtOffsetMethod) ||
+            		        !strcmp(FCur->getName().data(), AddressAttemptObjectReferenceAtOffsetMethod)) {
               Value* Ptr = Call.getArgument(0);
               Value* Old = Call.getArgument(1);
               Value* Val = Call.getArgument(2);
@@ -617,7 +620,8 @@ bool LowerMagic::runOnFunction(Function&
 
               CI->replaceAllUsesWith(res);
               CI->eraseFromParent();
-            } else if (!strcmp(FCur->getName().data(), AddressAttemptWordMethod)) {
+            } else if (!strcmp(FCur->getName().data(), AddressAttemptWordMethod) ||
+            		        !strcmp(FCur->getName().data(), AddressAttemptObjectReferenceMethod)) {
               Value* Ptr = Call.getArgument(0);
               Value* Old = Call.getArgument(1);
               Value* Val = Call.getArgument(2);
@@ -983,12 +987,6 @@ bool LowerMagic::runOnFunction(Function&
             } else if (!strcmp(FCur->getName().data(), ObjectReferenceToAddressMethod)) {
               Value* Val = Call.getArgument(0);
               Val = new PtrToIntInst(Val, pointerSizeType, "", CI);
-
-              /*
-               * REMOVE ObjectReferenceToAddress offset !!!
-               */
-
-
               Constant* M = ConstantInt::get(pointerSizeType, gcHeader::hiddenHeaderSize());
               Val = BinaryOperator::CreateSub(Val, M, "", CI);
               Val = new IntToPtrInst(Val, FCur->getReturnType(), "", CI);





More information about the vmkit-commits mailing list