MCPcopy Create free account
hub / github.com/apache/impala / getObject

Method getObject

be/src/codegen/llvm-codegen-object-cache.cc:54–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54std::unique_ptr<llvm::MemoryBuffer> CodeGenObjectCache::getObject(const llvm::Module* M) {
55 DCHECK(M != nullptr);
56 // Return a copy of the cached object containing the compiled module with the specified
57 // ID. If the ID doesn't match the one in the cached object, a warning is logged for
58 // further investigation.
59 const string& module_id = M->getModuleIdentifier();
60 std::lock_guard<std::mutex> l(mutex_);
61 if (module_id == key_) {
62 LOG(INFO) << "Object for module id " << module_id << " loaded from cache with size "
63 << cached_obj_->getMemBufferRef().getBufferSize() << " bytes";
64 return llvm::MemoryBuffer::getMemBufferCopy(
65 cached_obj_->getMemBufferRef().getBuffer());
66 } else if (!key_.empty()) {
67 stringstream ss;
68 ss << "Object for module id " << module_id << " can't be loaded from cache."
69 << " Existing module id is " << key_;
70 DCHECK(false) << ss.str();
71 LOG(WARNING) << ss.str();
72 }
73 return nullptr;
74}
75
76size_t CodeGenObjectCache::objSize() {
77 size_t sz = sizeof(CodeGenObjectCache);

Callers 2

nextMethod · 0.80
readColumnValueMethod · 0.80

Calls 2

emptyMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected