mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 11:15:34 +00:00
Bug 1271022 - use Vector::podResizeToFit in wasm::Module (r=bbouvier)
MozReview-Commit-ID: Booqdgl1QFT --HG-- extra : rebase_source : 444f3453ce6cecacac47e6b67621fa74bf90e313
This commit is contained in:
parent
df166c688f
commit
54c2332e47
@ -932,6 +932,13 @@ ModuleGenerator::finish(CacheableCharsVector&& prettyFuncNames,
|
||||
if (!finishStaticLinkData(module_->code.get(), module_->codeBytes, link.get()))
|
||||
return false;
|
||||
|
||||
// These Vectors can get large and the excess capacity can be significant,
|
||||
// so realloc them down to size.
|
||||
module_->heapAccesses.podResizeToFit();
|
||||
module_->codeRanges.podResizeToFit();
|
||||
module_->callSites.podResizeToFit();
|
||||
module_->callThunks.podResizeToFit();
|
||||
|
||||
*module = Move(module_);
|
||||
*linkData = Move(link);
|
||||
*exportMap = Move(exportMap_);
|
||||
|
@ -293,6 +293,14 @@ class CodeRange
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace wasm
|
||||
} // namespace js
|
||||
namespace mozilla {
|
||||
template <> struct IsPod<js::wasm::CodeRange> : TrueType {};
|
||||
}
|
||||
namespace js {
|
||||
namespace wasm {
|
||||
|
||||
typedef Vector<CodeRange, 0, SystemAllocPolicy> CodeRangeVector;
|
||||
|
||||
// A CallThunk describes the offset and target of thunks so that they may be
|
||||
@ -314,6 +322,14 @@ struct CallThunk
|
||||
|
||||
typedef Vector<CallThunk, 0, SystemAllocPolicy> CallThunkVector;
|
||||
|
||||
} // namespace wasm
|
||||
} // namespace js
|
||||
namespace mozilla {
|
||||
template <> struct IsPod<js::wasm::CallThunk> : TrueType {};
|
||||
}
|
||||
namespace js {
|
||||
namespace wasm {
|
||||
|
||||
// CacheableChars is used to cacheably store UniqueChars.
|
||||
|
||||
struct CacheableChars : UniqueChars
|
||||
|
@ -466,6 +466,15 @@ class CallSiteAndTarget : public CallSite
|
||||
uint32_t targetIndex() const { MOZ_ASSERT(isInternal()); return targetIndex_; }
|
||||
};
|
||||
|
||||
} // namespace wasm
|
||||
} // namespace js
|
||||
namespace mozilla {
|
||||
template <> struct IsPod<js::wasm::CallSite> : TrueType {};
|
||||
template <> struct IsPod<js::wasm::CallSiteAndTarget> : TrueType {};
|
||||
}
|
||||
namespace js {
|
||||
namespace wasm {
|
||||
|
||||
typedef Vector<CallSite, 0, SystemAllocPolicy> CallSiteVector;
|
||||
typedef Vector<CallSiteAndTarget, 0, SystemAllocPolicy> CallSiteAndTargetVector;
|
||||
|
||||
@ -568,6 +577,14 @@ class HeapAccess {
|
||||
};
|
||||
#endif
|
||||
|
||||
} // namespace wasm
|
||||
} // namespace js
|
||||
namespace mozilla {
|
||||
template <> struct IsPod<js::wasm::HeapAccess> : TrueType {};
|
||||
}
|
||||
namespace js {
|
||||
namespace wasm {
|
||||
|
||||
typedef Vector<HeapAccess, 0, SystemAllocPolicy> HeapAccessVector;
|
||||
|
||||
// A wasm::SymbolicAddress represents a pointer to a well-known function or
|
||||
|
Loading…
Reference in New Issue
Block a user