Commit fdfe006e authored by akos.palfi@imgtec.com's avatar akos.palfi@imgtec.com

MIPS: Clean up code stubs and ensure distinct major keys.

Port r23655 (6327324d)

BUG=
R=machenbach@chromium.org, paul.lind@imgtec.com

Review URL: https://codereview.chromium.org/541513002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23674 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 31718c55
......@@ -108,16 +108,16 @@ namespace internal {
// List of code stubs only used on MIPS platforms.
#if V8_TARGET_ARCH_MIPS
#define CODE_STUB_LIST_MIPS(V) \
V(RegExpCEntry) \
V(DirectCEntry) \
V(RestoreRegistersState) \
V(StoreRegistersState) \
V(RestoreRegistersState)
V(WriteInt32ToHeapNumber)
#elif V8_TARGET_ARCH_MIPS64
#define CODE_STUB_LIST_MIPS(V) \
V(RegExpCEntry) \
V(DirectCEntry) \
V(RestoreRegistersState) \
V(StoreRegistersState) \
V(RestoreRegistersState)
V(WriteInt32ToHeapNumber)
#else
#define CODE_STUB_LIST_MIPS(V)
#endif
......
......@@ -281,35 +281,6 @@ void PropertyHandlerCompiler::GenerateFastApiCall(
}
void ElementHandlerCompiler::GenerateLoadDictionaryElement(
MacroAssembler* masm) {
// The return address is in ra.
Label slow, miss;
Register key = LoadDescriptor::NameRegister();
Register receiver = LoadDescriptor::ReceiverRegister();
DCHECK(receiver.is(a1));
DCHECK(key.is(a2));
__ UntagAndJumpIfNotSmi(t2, key, &miss);
__ lw(t0, FieldMemOperand(receiver, JSObject::kElementsOffset));
__ LoadFromNumberDictionary(&slow, t0, key, v0, t2, a3, t1);
__ Ret();
// Slow case, key and receiver still unmodified.
__ bind(&slow);
__ IncrementCounter(
masm->isolate()->counters()->keyed_load_external_array_slow(), 1, a2, a3);
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow);
// Miss case, call the runtime.
__ bind(&miss);
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
}
void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
// Push receiver, key and value for runtime call.
__ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
......
......@@ -281,36 +281,6 @@ void PropertyHandlerCompiler::GenerateFastApiCall(
}
void ElementHandlerCompiler::GenerateLoadDictionaryElement(
MacroAssembler* masm) {
// The return address is in ra
Label slow, miss;
Register key = LoadDescriptor::NameRegister();
Register receiver = LoadDescriptor::ReceiverRegister();
DCHECK(receiver.is(a1));
DCHECK(key.is(a2));
__ UntagAndJumpIfNotSmi(a6, key, &miss);
__ ld(a4, FieldMemOperand(receiver, JSObject::kElementsOffset));
DCHECK(kSmiTagSize + kSmiShiftSize == 32);
__ LoadFromNumberDictionary(&slow, a4, key, v0, a6, a3, a5);
__ Ret();
// Slow case, key and receiver still unmodified.
__ bind(&slow);
__ IncrementCounter(
masm->isolate()->counters()->keyed_load_external_array_slow(), 1, a2, a3);
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow);
// Miss case, call the runtime.
__ bind(&miss);
TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
}
void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
// Push receiver, key and value for runtime call.
__ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
......
......@@ -609,8 +609,7 @@ static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm,
}
static void ICCompareStub_CheckInputType(MacroAssembler* masm,
Register input,
static void CompareICStub_CheckInputType(MacroAssembler* masm, Register input,
Register scratch,
CompareIC::State expected,
Label* fail) {
......@@ -631,14 +630,14 @@ static void ICCompareStub_CheckInputType(MacroAssembler* masm,
// On entry a1 and a2 are the values to be compared.
// On exit a0 is 0, positive or negative to indicate the result of
// the comparison.
void ICCompareStub::GenerateGeneric(MacroAssembler* masm) {
void CompareICStub::GenerateGeneric(MacroAssembler* masm) {
Register lhs = a1;
Register rhs = a0;
Condition cc = GetCondition();
Label miss;
ICCompareStub_CheckInputType(masm, lhs, a2, left(), &miss);
ICCompareStub_CheckInputType(masm, rhs, a3, right(), &miss);
CompareICStub_CheckInputType(masm, lhs, a2, left(), &miss);
CompareICStub_CheckInputType(masm, rhs, a3, right(), &miss);
Label slow; // Call builtin.
Label not_smis, both_loaded_as_doubles;
......@@ -3522,7 +3521,7 @@ void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) {
}
void ICCompareStub::GenerateSmis(MacroAssembler* masm) {
void CompareICStub::GenerateSmis(MacroAssembler* masm) {
DCHECK(state() == CompareIC::SMI);
Label miss;
__ Or(a2, a1, a0);
......@@ -3545,7 +3544,7 @@ void ICCompareStub::GenerateSmis(MacroAssembler* masm) {
}
void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
void CompareICStub::GenerateNumbers(MacroAssembler* masm) {
DCHECK(state() == CompareIC::NUMBER);
Label generic_stub;
......@@ -3613,7 +3612,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
__ bind(&unordered);
__ bind(&generic_stub);
ICCompareStub stub(isolate(), op(), CompareIC::GENERIC, CompareIC::GENERIC,
CompareICStub stub(isolate(), op(), CompareIC::GENERIC, CompareIC::GENERIC,
CompareIC::GENERIC);
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
......@@ -3638,7 +3637,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
}
void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) {
void CompareICStub::GenerateInternalizedStrings(MacroAssembler* masm) {
DCHECK(state() == CompareIC::INTERNALIZED_STRING);
Label miss;
......@@ -3678,7 +3677,7 @@ void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) {
}
void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) {
void CompareICStub::GenerateUniqueNames(MacroAssembler* masm) {
DCHECK(state() == CompareIC::UNIQUE_NAME);
DCHECK(GetCondition() == eq);
Label miss;
......@@ -3722,7 +3721,7 @@ void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) {
}
void ICCompareStub::GenerateStrings(MacroAssembler* masm) {
void CompareICStub::GenerateStrings(MacroAssembler* masm) {
DCHECK(state() == CompareIC::STRING);
Label miss;
......@@ -3808,7 +3807,7 @@ void ICCompareStub::GenerateStrings(MacroAssembler* masm) {
}
void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
void CompareICStub::GenerateObjects(MacroAssembler* masm) {
DCHECK(state() == CompareIC::OBJECT);
Label miss;
__ And(a2, a1, Operand(a0));
......@@ -3828,7 +3827,7 @@ void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
}
void ICCompareStub::GenerateKnownObjects(MacroAssembler* masm) {
void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) {
Label miss;
__ And(a2, a1, a0);
__ JumpIfSmi(a2, &miss);
......@@ -3845,7 +3844,7 @@ void ICCompareStub::GenerateKnownObjects(MacroAssembler* masm) {
}
void ICCompareStub::GenerateMiss(MacroAssembler* masm) {
void CompareICStub::GenerateMiss(MacroAssembler* masm) {
{
// Call the runtime system in a fresh internal frame.
ExternalReference miss =
......
......@@ -79,7 +79,7 @@ class StoreRegistersStateStub: public PlatformCodeStub {
static void GenerateAheadOfTime(Isolate* isolate);
private:
Major MajorKey() const { return StoreRegistersState; }
virtual inline Major MajorKey() const FINAL OVERRIDE;
uint32_t MinorKey() const { return 0; }
void Generate(MacroAssembler* masm);
......@@ -92,7 +92,7 @@ class RestoreRegistersStateStub: public PlatformCodeStub {
static void GenerateAheadOfTime(Isolate* isolate);
private:
Major MajorKey() const { return RestoreRegistersState; }
virtual inline Major MajorKey() const FINAL OVERRIDE;
uint32_t MinorKey() const { return 0; }
void Generate(MacroAssembler* masm);
......@@ -121,7 +121,7 @@ class WriteInt32ToHeapNumberStub : public PlatformCodeStub {
static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate);
private:
Major MajorKey() const { return WriteInt32ToHeapNumber; }
virtual inline Major MajorKey() const FINAL OVERRIDE;
void Generate(MacroAssembler* masm);
......@@ -301,7 +301,7 @@ class RecordWriteStub: public PlatformCodeStub {
kUpdateRememberedSetOnNoNeedToInformIncrementalMarker
};
Major MajorKey() const { return RecordWrite; }
virtual inline Major MajorKey() const FINAL OVERRIDE;
void Generate(MacroAssembler* masm);
void GenerateIncremental(MacroAssembler* masm, Mode mode);
......@@ -360,7 +360,7 @@ class DirectCEntryStub: public PlatformCodeStub {
void GenerateCall(MacroAssembler* masm, Register target);
private:
Major MajorKey() const { return DirectCEntry; }
virtual inline Major MajorKey() const FINAL OVERRIDE;
bool NeedsImmovableCode() { return true; }
......@@ -409,7 +409,7 @@ class NameDictionaryLookupStub: public PlatformCodeStub {
NameDictionary::kHeaderSize +
NameDictionary::kElementsStartIndex * kPointerSize;
Major MajorKey() const { return NameDictionaryLookup; }
virtual inline Major MajorKey() const FINAL OVERRIDE;
LookupMode mode() const { return LookupModeBits::decode(minor_key_); }
......
......@@ -602,8 +602,7 @@ static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm,
}
static void ICCompareStub_CheckInputType(MacroAssembler* masm,
Register input,
static void CompareICStub_CheckInputType(MacroAssembler* masm, Register input,
Register scratch,
CompareIC::State expected,
Label* fail) {
......@@ -624,14 +623,14 @@ static void ICCompareStub_CheckInputType(MacroAssembler* masm,
// On entry a1 and a2 are the values to be compared.
// On exit a0 is 0, positive or negative to indicate the result of
// the comparison.
void ICCompareStub::GenerateGeneric(MacroAssembler* masm) {
void CompareICStub::GenerateGeneric(MacroAssembler* masm) {
Register lhs = a1;
Register rhs = a0;
Condition cc = GetCondition();
Label miss;
ICCompareStub_CheckInputType(masm, lhs, a2, left(), &miss);
ICCompareStub_CheckInputType(masm, rhs, a3, right(), &miss);
CompareICStub_CheckInputType(masm, lhs, a2, left(), &miss);
CompareICStub_CheckInputType(masm, rhs, a3, right(), &miss);
Label slow; // Call builtin.
Label not_smis, both_loaded_as_doubles;
......@@ -3558,7 +3557,7 @@ void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) {
}
void ICCompareStub::GenerateSmis(MacroAssembler* masm) {
void CompareICStub::GenerateSmis(MacroAssembler* masm) {
DCHECK(state() == CompareIC::SMI);
Label miss;
__ Or(a2, a1, a0);
......@@ -3581,7 +3580,7 @@ void ICCompareStub::GenerateSmis(MacroAssembler* masm) {
}
void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
void CompareICStub::GenerateNumbers(MacroAssembler* masm) {
DCHECK(state() == CompareIC::NUMBER);
Label generic_stub;
......@@ -3649,7 +3648,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
__ bind(&unordered);
__ bind(&generic_stub);
ICCompareStub stub(isolate(), op(), CompareIC::GENERIC, CompareIC::GENERIC,
CompareICStub stub(isolate(), op(), CompareIC::GENERIC, CompareIC::GENERIC,
CompareIC::GENERIC);
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
......@@ -3674,7 +3673,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
}
void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) {
void CompareICStub::GenerateInternalizedStrings(MacroAssembler* masm) {
DCHECK(state() == CompareIC::INTERNALIZED_STRING);
Label miss;
......@@ -3714,7 +3713,7 @@ void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) {
}
void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) {
void CompareICStub::GenerateUniqueNames(MacroAssembler* masm) {
DCHECK(state() == CompareIC::UNIQUE_NAME);
DCHECK(GetCondition() == eq);
Label miss;
......@@ -3758,7 +3757,7 @@ void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) {
}
void ICCompareStub::GenerateStrings(MacroAssembler* masm) {
void CompareICStub::GenerateStrings(MacroAssembler* masm) {
DCHECK(state() == CompareIC::STRING);
Label miss;
......@@ -3844,7 +3843,7 @@ void ICCompareStub::GenerateStrings(MacroAssembler* masm) {
}
void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
void CompareICStub::GenerateObjects(MacroAssembler* masm) {
DCHECK(state() == CompareIC::OBJECT);
Label miss;
__ And(a2, a1, Operand(a0));
......@@ -3864,7 +3863,7 @@ void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
}
void ICCompareStub::GenerateKnownObjects(MacroAssembler* masm) {
void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) {
Label miss;
__ And(a2, a1, a0);
__ JumpIfSmi(a2, &miss);
......@@ -3881,7 +3880,7 @@ void ICCompareStub::GenerateKnownObjects(MacroAssembler* masm) {
}
void ICCompareStub::GenerateMiss(MacroAssembler* masm) {
void CompareICStub::GenerateMiss(MacroAssembler* masm) {
{
// Call the runtime system in a fresh internal frame.
ExternalReference miss =
......
......@@ -79,7 +79,7 @@ class StoreRegistersStateStub: public PlatformCodeStub {
static void GenerateAheadOfTime(Isolate* isolate);
private:
Major MajorKey() const { return StoreRegistersState; }
virtual inline Major MajorKey() const FINAL OVERRIDE;
uint32_t MinorKey() const { return 0; }
void Generate(MacroAssembler* masm);
......@@ -92,7 +92,7 @@ class RestoreRegistersStateStub: public PlatformCodeStub {
static void GenerateAheadOfTime(Isolate* isolate);
private:
Major MajorKey() const { return RestoreRegistersState; }
virtual inline Major MajorKey() const FINAL OVERRIDE;
uint32_t MinorKey() const { return 0; }
void Generate(MacroAssembler* masm);
......@@ -120,7 +120,7 @@ class WriteInt32ToHeapNumberStub : public PlatformCodeStub {
static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate);
private:
Major MajorKey() const { return WriteInt32ToHeapNumber; }
virtual inline Major MajorKey() const FINAL OVERRIDE;
void Generate(MacroAssembler* masm);
......@@ -300,7 +300,7 @@ class RecordWriteStub: public PlatformCodeStub {
kUpdateRememberedSetOnNoNeedToInformIncrementalMarker
};
Major MajorKey() const { return RecordWrite; }
virtual inline Major MajorKey() const FINAL OVERRIDE;
void Generate(MacroAssembler* masm);
void GenerateIncremental(MacroAssembler* masm, Mode mode);
......@@ -359,7 +359,7 @@ class DirectCEntryStub: public PlatformCodeStub {
void GenerateCall(MacroAssembler* masm, Register target);
private:
Major MajorKey() const { return DirectCEntry; }
virtual inline Major MajorKey() const FINAL OVERRIDE;
bool NeedsImmovableCode() { return true; }
......@@ -408,7 +408,7 @@ class NameDictionaryLookupStub: public PlatformCodeStub {
NameDictionary::kHeaderSize +
NameDictionary::kElementsStartIndex * kPointerSize;
Major MajorKey() const { return NameDictionaryLookup; }
virtual inline Major MajorKey() const FINAL OVERRIDE;
LookupMode mode() const { return LookupModeBits::decode(minor_key_); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment