Commit c64fe2ec authored by ricow@chromium.org's avatar ricow@chromium.org

MIPS: Reland 10216 - Optimize the equality check case of ICCompare stubs.

Port r10219 (56686b).

Original commit message:

Now with arm and x64 support. Additionally, added default unreachable case to switch statement in CompareIC::TargetState to make win and mac compilers happy.

Reviewer guide:
This is an exact copy of 10216 except:
src/arm/*
src/x64/*
src/ic.cc (added default case to swith in CompareIC::TargetState)

BUG=
TEST=
Review URL: http://codereview.chromium.org/8896022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3e3827bd
......@@ -6869,26 +6869,39 @@ void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
}
void ICCompareStub::GenerateMiss(MacroAssembler* masm) {
__ Push(a1, a0);
__ push(ra);
void ICCompareStub::GenerateKnownObjects(MacroAssembler* masm) {
Label miss;
__ And(a2, a1, a0);
__ JumpIfSmi(a2, &miss);
__ lw(a2, FieldMemOperand(a0, HeapObject::kMapOffset));
__ lw(a3, FieldMemOperand(a1, HeapObject::kMapOffset));
__ Branch(&miss, ne, a2, Operand(known_map_));
__ Branch(&miss, ne, a3, Operand(known_map_));
__ Ret(USE_DELAY_SLOT);
__ subu(v0, a0, a1);
// Call the runtime system in a fresh internal frame.
ExternalReference miss = ExternalReference(IC_Utility(IC::kCompareIC_Miss),
masm->isolate());
__ bind(&miss);
GenerateMiss(masm);
}
void ICCompareStub::GenerateMiss(MacroAssembler* masm) {
{
// Call the runtime system in a fresh internal frame.
ExternalReference miss =
ExternalReference(IC_Utility(IC::kCompareIC_Miss), masm->isolate());
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(a1, a0);
__ push(ra);
__ Push(a1, a0);
__ li(t0, Operand(Smi::FromInt(op_)));
__ push(t0);
__ CallExternalReference(miss, 3);
// Compute the entry point of the rewritten stub.
__ Addu(a2, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
// Restore registers.
__ Pop(a1, a0, ra);
}
// Compute the entry point of the rewritten stub.
__ Addu(a2, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
// Restore registers.
__ pop(ra);
__ pop(a0);
__ pop(a1);
__ Jump(a2);
}
......
......@@ -1587,6 +1587,9 @@ void CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) {
rewritten = stub.GetCode();
} else {
ICCompareStub stub(op_, state);
if (state == KNOWN_OBJECTS) {
stub.set_known_map(Handle<Map>(Handle<JSObject>::cast(x)->map()));
}
rewritten = stub.GetCode();
}
set_target(*rewritten);
......
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