Bug 1237508 - Odin: remove function index from Export (r=bbouvier)

--HG--
extra : commitid : K2SmBG63HZB
extra : rebase_source : 2d0a2bf772406092d0aea3e1524735b2e5a54d95
This commit is contained in:
Luke Wagner 2016-01-08 12:33:53 -06:00
Родитель 8788ebb50d
Коммит b66e3e5581
3 изменённых файлов: 7 добавлений и 8 удалений

Просмотреть файл

@ -49,6 +49,7 @@ ModuleGenerator::ModuleGenerator(ExclusiveContext* cx)
freeTasks_(cx),
funcBytes_(0),
funcEntryOffsets_(cx),
exportFuncIndices_(cx),
activeFunc_(nullptr),
finishedFuncs_(false)
{
@ -313,13 +314,14 @@ ModuleGenerator::defineImport(uint32_t index, ProfilingOffsets interpExit, Profi
bool
ModuleGenerator::declareExport(MallocSig&& sig, uint32_t funcIndex)
{
return exports_.emplaceBack(Move(sig), funcIndex);
return exports_.emplaceBack(Move(sig)) &&
exportFuncIndices_.append(funcIndex);
}
uint32_t
ModuleGenerator::exportFuncIndex(uint32_t index) const
{
return exports_[index].funcIndex();
return exportFuncIndices_[index];
}
const MallocSig&

Просмотреть файл

@ -54,6 +54,7 @@ typedef Vector<SlowFunction> SlowFunctionVector;
class MOZ_STACK_CLASS ModuleGenerator
{
typedef Vector<uint32_t> FuncOffsetVector;
typedef Vector<uint32_t> FuncIndexVector;
struct SigHashPolicy
{
@ -93,6 +94,7 @@ class MOZ_STACK_CLASS ModuleGenerator
// Function compilation
uint32_t funcBytes_;
FuncOffsetVector funcEntryOffsets_;
FuncIndexVector exportFuncIndices_;
DebugOnly<FunctionGenerator*> activeFunc_;
DebugOnly<bool> finishedFuncs_;

Просмотреть файл

@ -103,16 +103,14 @@ class Export
{
MallocSig sig_;
struct CacheablePod {
uint32_t funcIndex_;
uint32_t stubOffset_;
} pod;
public:
Export() = default;
Export(MallocSig&& sig, uint32_t funcIndex)
explicit Export(MallocSig&& sig)
: sig_(Move(sig))
{
pod.funcIndex_ = funcIndex;
pod.stubOffset_ = UINT32_MAX;
}
Export(Export&& rhs)
@ -125,9 +123,6 @@ class Export
pod.stubOffset_ = stubOffset;
}
uint32_t funcIndex() const {
return pod.funcIndex_;
}
uint32_t stubOffset() const {
return pod.stubOffset_;
}