OSDN Git Service

Delete routines on demand.
authorNicolas Capens <capn@google.com>
Thu, 26 Jun 2014 17:59:15 +0000 (13:59 -0400)
committerNicolas Capens <nicolascapens@google.com>
Thu, 26 Jun 2014 18:02:06 +0000 (18:02 +0000)
BUG=15907357

Change-Id: I1aebdaa2aa17a88c7de6b181662fb86617b3dc55
Reviewed-on: https://swiftshader-review.googlesource.com/1145
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
src/Reactor/RoutineManager.cpp

index 441db8d..27239d9 100644 (file)
@@ -15,6 +15,7 @@
 #include "llvm/Function.h"
 #include "../Common/Memory.hpp"
 #include "../Common/Thread.hpp"
+#include "../Common/Debug.hpp"
 
 namespace sw
 {
@@ -34,13 +35,12 @@ namespace sw
 
        void RoutineManager::AllocateGOT()
        {
-               // FIXME: ASSERT(false);
+               UNIMPLEMENTED();
        }
 
        uint8_t *RoutineManager::allocateStub(const GlobalValue *function, unsigned stubSize, unsigned alignment)
        {
-               // FIXME: ASSERT(false);
-
+               UNIMPLEMENTED();
                return 0;
        }
 
@@ -78,37 +78,42 @@ namespace sw
 
        uint8_t *RoutineManager::startExceptionTable(const llvm::Function* F, uintptr_t &ActualSize)
        {
-               // FIXME: ASSERT(false);
-
+               UNIMPLEMENTED();
                return 0;
        }
 
        void RoutineManager::endExceptionTable(const llvm::Function *F, uint8_t *TableStart, uint8_t *TableEnd, uint8_t* FrameRegister) 
        {
-               // FIXME: ASSERT(false);
+               UNIMPLEMENTED();
        }
     
        uint8_t *RoutineManager::getGOTBase() const
        {
+               ASSERT(!HasGOT);
                return 0;
        }
 
        uint8_t *RoutineManager::allocateSpace(intptr_t Size, unsigned Alignment)
        {
+               UNIMPLEMENTED();
                return 0;
        }
 
        uint8_t *RoutineManager::allocateGlobal(uintptr_t Size, unsigned Alignment)
        {
+               UNIMPLEMENTED();
                return 0;
        }
 
        void RoutineManager::deallocateFunctionBody(void *Body)
        {
+               delete routine;
+               routine = 0;
        }
 
        void RoutineManager::deallocateExceptionTable(void *ET)
        {
+               UNIMPLEMENTED();
        }
 
        void RoutineManager::setMemoryWritable()
@@ -122,6 +127,7 @@ namespace sw
 
        void RoutineManager::setPoisonMemory(bool poison)
        {
+               UNIMPLEMENTED();
        }
 
        Routine *RoutineManager::acquireRoutine(void *entry)