Skip to content

Commit

Permalink
Bug 1437862 part 1 - Clean up register allocation in generateArgument…
Browse files Browse the repository at this point in the history
…sChecks. r=nbp

--HG--
extra : rebase_source : a44f4b54571d2030d96ef6af7dae330da5282f62
  • Loading branch information
jandem committed Feb 20, 2018
1 parent 92e6d42 commit 10f36f5
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 29 deletions.
5 changes: 1 addition & 4 deletions js/src/jit/CodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5077,9 +5077,6 @@ CodeGenerator::visitCallDirectEval(LCallDirectEval* lir)
void
CodeGenerator::generateArgumentsChecks(bool bailout)
{
// Registers safe for use before generatePrologue().
static const uint32_t EntryTempMask = Registers::TempMask & ~(1 << OsrFrameReg.code());

// This function can be used the normal way to check the argument types,
// before entering the function and bailout when arguments don't match.
// For debug purpose, this is can also be used to force/check that the
Expand All @@ -5089,7 +5086,7 @@ CodeGenerator::generateArgumentsChecks(bool bailout)
MResumePoint* rp = mir.entryResumePoint();

// No registers are allocated yet, so it's safe to grab anything.
Register temp = AllocatableGeneralRegisterSet(EntryTempMask).getAny();
Register temp = AllocatableGeneralRegisterSet(GeneralRegisterSet::All()).getAny();

const CompileInfo& info = gen->info();

Expand Down
6 changes: 0 additions & 6 deletions js/src/jit/arm/Architecture-arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,6 @@ class Registers
(1 << Registers::lr) |
(1 << Registers::pc);

// Registers that can be allocated without being saved, generally.
static const SetType TempMask = VolatileMask & ~NonAllocatableMask;

// Registers returned from a JS -> JS call.
static const SetType JSCallMask =
(1 << Registers::r2) |
Expand Down Expand Up @@ -362,9 +359,6 @@ class FloatRegisters
(1ULL << s30) |
(1ULL << s31);

// Registers that can be allocated without being saved, generally.
static const SetType TempMask = VolatileMask & ~NonAllocatableMask;

static const SetType AllocatableMask = AllMask & ~NonAllocatableMask;
};

Expand Down
6 changes: 0 additions & 6 deletions js/src/jit/arm64/Architecture-arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,6 @@ class Registers {
(1 << Registers::lr) |
(1 << Registers::sp);

// Registers that can be allocated without being saved, generally.
static const SetType TempMask = VolatileMask & ~NonAllocatableMask;

static const SetType WrapperMask = VolatileMask;

// Registers returned from a JS -> JS call.
Expand Down Expand Up @@ -283,9 +280,6 @@ class FloatRegisters
// d31 is the ScratchFloatReg.
static const SetType NonAllocatableMask = (SetType(1) << FloatRegisters::d31) * SpreadCoefficient;

// Registers that can be allocated without being saved, generally.
static const SetType TempMask = VolatileMask & ~NonAllocatableMask;

static const SetType AllocatableMask = AllMask & ~NonAllocatableMask;
union RegisterContent {
float s;
Expand Down
3 changes: 0 additions & 3 deletions js/src/jit/mips-shared/Architecture-mips-shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ class Registers
(1 << Registers::sp) |
(1 << Registers::ra);

// Registers that can be allocated without being saved, generally.
static const SetType TempMask = VolatileMask & ~NonAllocatableMask;

// Registers returned from a JS -> JS call.
static const SetType JSCallMask;

Expand Down
3 changes: 0 additions & 3 deletions js/src/jit/mips32/Architecture-mips32.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ class FloatRegisters : public FloatRegistersMIPSShared
((SetType(1) << (FloatRegisters::f16 >> 1)) |
(SetType(1) << (FloatRegisters::f18 >> 1))) * ((1 << TotalSingle) + 1);

// Registers that can be allocated without being saved, generally.
static const SetType TempMask = VolatileMask & ~NonAllocatableMask;

static const SetType AllocatableMask = AllMask & ~NonAllocatableMask;
};

Expand Down
3 changes: 0 additions & 3 deletions js/src/jit/mips64/Architecture-mips64.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ class FloatRegisters : public FloatRegistersMIPSShared
(1U << FloatRegisters::f23)
) * Spread;

// Registers that can be allocated without being saved, generally.
static const SetType TempMask = VolatileMask & ~NonAllocatableMask;

static const SetType AllocatableMask = AllMask & ~NonAllocatableMask;
};

Expand Down
1 change: 0 additions & 1 deletion js/src/jit/none/Architecture-none.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class Registers
static const SetType NonVolatileMask = 0;
static const SetType NonAllocatableMask = 0;
static const SetType AllocatableMask = 0;
static const SetType TempMask = 0;
static const SetType JSCallMask = 0;
static const SetType CallMask = 0;
};
Expand Down
3 changes: 0 additions & 3 deletions js/src/jit/x86-shared/Architecture-x86-shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@ class Registers {
AllMask & ~VolatileMask & ~(1 << X86Encoding::rsp);

static const SetType AllocatableMask = AllMask & ~NonAllocatableMask;

// Registers that can be allocated without being saved, generally.
static const SetType TempMask = VolatileMask & ~NonAllocatableMask;
};

typedef Registers::SetType PackedRegisterMask;
Expand Down

0 comments on commit 10f36f5

Please sign in to comment.