src/share/vm/shark/sharkMemoryManager.hpp

Print this page




  52  public:
  53   void set_entry_for_function(const llvm::Function* function,
  54                               SharkEntry*           entry) {
  55     _entry_map[function] = entry;
  56   }
  57   SharkEntry* get_entry_for_function(const llvm::Function* function) {
  58     return _entry_map[function];
  59   }
  60 
  61  public:
  62   void AllocateGOT();
  63   unsigned char* getGOTBase() const;
  64   unsigned char* allocateStub(const llvm::GlobalValue* F,
  65                               unsigned StubSize,
  66                               unsigned Alignment);
  67   unsigned char* startFunctionBody(const llvm::Function* F,
  68                                    uintptr_t& ActualSize);
  69   void endFunctionBody(const llvm::Function* F,
  70                        unsigned char* FunctionStart,
  71                        unsigned char* FunctionEnd);
  72   unsigned char* startExceptionTable(const llvm::Function* F,
  73                                      uintptr_t& ActualSize);
  74   void endExceptionTable(const llvm::Function* F,
  75                          unsigned char* TableStart,
  76                          unsigned char* TableEnd,
  77                          unsigned char* FrameRegister);
  78   void *getPointerToNamedFunction(const std::string &Name, bool AbortOnFailure = true);
  79   uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID);
  80   uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID);
  81   void setPoisonMemory(bool);
  82   uint8_t* allocateGlobal(uintptr_t, unsigned int);
  83   void setMemoryWritable();
  84   void setMemoryExecutable();
  85   void deallocateExceptionTable(void *ptr);
  86   void deallocateFunctionBody(void *ptr);
  87   unsigned char *allocateSpace(intptr_t Size,
  88                                unsigned int Alignment);

















  89 };
  90 
  91 #endif // SHARE_VM_SHARK_SHARKMEMORYMANAGER_HPP


  52  public:
  53   void set_entry_for_function(const llvm::Function* function,
  54                               SharkEntry*           entry) {
  55     _entry_map[function] = entry;
  56   }
  57   SharkEntry* get_entry_for_function(const llvm::Function* function) {
  58     return _entry_map[function];
  59   }
  60 
  61  public:
  62   void AllocateGOT();
  63   unsigned char* getGOTBase() const;
  64   unsigned char* allocateStub(const llvm::GlobalValue* F,
  65                               unsigned StubSize,
  66                               unsigned Alignment);
  67   unsigned char* startFunctionBody(const llvm::Function* F,
  68                                    uintptr_t& ActualSize);
  69   void endFunctionBody(const llvm::Function* F,
  70                        unsigned char* FunctionStart,
  71                        unsigned char* FunctionEnd);
  72 





  73   void *getPointerToNamedFunction(const std::string &Name, bool AbortOnFailure = true);


  74   void setPoisonMemory(bool);
  75   uint8_t* allocateGlobal(uintptr_t, unsigned int);
  76   void setMemoryWritable();
  77   void setMemoryExecutable();

  78   void deallocateFunctionBody(void *ptr);
  79   unsigned char *allocateSpace(intptr_t Size,
  80                                unsigned int Alignment);
  81 
  82 #if SHARK_LLVM_VERSION <= 32
  83 uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID);
  84 uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID);
  85 unsigned char* startExceptionTable(const llvm::Function* F,
  86                                    uintptr_t& ActualSize);
  87 void deallocateExceptionTable(void *ptr);
  88 void endExceptionTable(const llvm::Function* F,
  89                        unsigned char* TableStart,
  90                        unsigned char* TableEnd,
  91                        unsigned char* FrameRegister);
  92 #else
  93 uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, llvm::StringRef SectionName);
  94 uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, llvm::StringRef SectionName, bool IsReadOnly);
  95 bool finalizeMemory(std::string *ErrMsg = 0);
  96 #endif
  97 
  98 };
  99 
 100 #endif // SHARE_VM_SHARK_SHARKMEMORYMANAGER_HPP