Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 8896022: MIPS: Reland 10216 - Optimize the equality check case of ICCompare stubs. (Closed)
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/mips/ic-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 6851 matching lines...) Expand 10 before | Expand all | Expand 10 after
6862 6862
6863 ASSERT(GetCondition() == eq); 6863 ASSERT(GetCondition() == eq);
6864 __ Subu(v0, a0, Operand(a1)); 6864 __ Subu(v0, a0, Operand(a1));
6865 __ Ret(); 6865 __ Ret();
6866 6866
6867 __ bind(&miss); 6867 __ bind(&miss);
6868 GenerateMiss(masm); 6868 GenerateMiss(masm);
6869 } 6869 }
6870 6870
6871 6871
6872 void ICCompareStub::GenerateKnownObjects(MacroAssembler* masm) {
6873 Label miss;
6874 __ And(a2, a1, a0);
6875 __ JumpIfSmi(a2, &miss);
6876 __ lw(a2, FieldMemOperand(a0, HeapObject::kMapOffset));
6877 __ lw(a3, FieldMemOperand(a1, HeapObject::kMapOffset));
6878 __ Branch(&miss, ne, a2, Operand(known_map_));
6879 __ Branch(&miss, ne, a3, Operand(known_map_));
6880
6881 __ Ret(USE_DELAY_SLOT);
6882 __ subu(v0, a0, a1);
6883
6884 __ bind(&miss);
6885 GenerateMiss(masm);
6886 }
6887
6872 void ICCompareStub::GenerateMiss(MacroAssembler* masm) { 6888 void ICCompareStub::GenerateMiss(MacroAssembler* masm) {
6873 __ Push(a1, a0);
6874 __ push(ra);
6875
6876 // Call the runtime system in a fresh internal frame.
6877 ExternalReference miss = ExternalReference(IC_Utility(IC::kCompareIC_Miss),
6878 masm->isolate());
6879 { 6889 {
6890 // Call the runtime system in a fresh internal frame.
6891 ExternalReference miss =
6892 ExternalReference(IC_Utility(IC::kCompareIC_Miss), masm->isolate());
6880 FrameScope scope(masm, StackFrame::INTERNAL); 6893 FrameScope scope(masm, StackFrame::INTERNAL);
6881 __ Push(a1, a0); 6894 __ Push(a1, a0);
6895 __ push(ra);
6896 __ Push(a1, a0);
6882 __ li(t0, Operand(Smi::FromInt(op_))); 6897 __ li(t0, Operand(Smi::FromInt(op_)));
6883 __ push(t0); 6898 __ push(t0);
6884 __ CallExternalReference(miss, 3); 6899 __ CallExternalReference(miss, 3);
6900 // Compute the entry point of the rewritten stub.
6901 __ Addu(a2, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
6902 // Restore registers.
6903 __ Pop(a1, a0, ra);
6885 } 6904 }
6886 // Compute the entry point of the rewritten stub.
6887 __ Addu(a2, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
6888 // Restore registers.
6889 __ pop(ra);
6890 __ pop(a0);
6891 __ pop(a1);
6892 __ Jump(a2); 6905 __ Jump(a2);
6893 } 6906 }
6894 6907
6895 6908
6896 void DirectCEntryStub::Generate(MacroAssembler* masm) { 6909 void DirectCEntryStub::Generate(MacroAssembler* masm) {
6897 // No need to pop or drop anything, LeaveExitFrame will restore the old 6910 // No need to pop or drop anything, LeaveExitFrame will restore the old
6898 // stack, thus dropping the allocated space for the return value. 6911 // stack, thus dropping the allocated space for the return value.
6899 // The saved ra is after the reserved stack space for the 4 args. 6912 // The saved ra is after the reserved stack space for the 4 args.
6900 __ lw(t9, MemOperand(sp, kCArgsSlotsSize)); 6913 __ lw(t9, MemOperand(sp, kCArgsSlotsSize));
6901 6914
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
7532 __ Ret(USE_DELAY_SLOT); 7545 __ Ret(USE_DELAY_SLOT);
7533 __ mov(v0, a0); 7546 __ mov(v0, a0);
7534 } 7547 }
7535 7548
7536 7549
7537 #undef __ 7550 #undef __
7538 7551
7539 } } // namespace v8::internal 7552 } } // namespace v8::internal
7540 7553
7541 #endif // V8_TARGET_ARCH_MIPS 7554 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/mips/ic-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698