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

Unified Diff: runtime/vm/stub_code_mips.cc

Issue 24203004: Dart VM: Simplify code generation for equality operators. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased Created 7 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_mips.cc
===================================================================
--- runtime/vm/stub_code_mips.cc (revision 28079)
+++ runtime/vm/stub_code_mips.cc (working copy)
@@ -2232,110 +2232,6 @@
}
-// Implements equality operator when one of the arguments is null
-// (identity check) and updates ICData if necessary.
-// RA: return address.
-// A1: left argument.
-// A0: right argument.
-// T0: ICData.
-// V0: result.
-// TODO(srdjan): Move to VM stubs once Boolean objects become VM objects.
-void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) {
- __ TraceSimMsg("EqualityWithNullArgStub");
- __ Comment("EqualityWithNullArgStub");
- __ EnterStubFrame();
- static const intptr_t kNumArgsTested = 2;
-#if defined(DEBUG)
- { Label ok;
- __ lw(CMPRES1, FieldAddress(T0, ICData::num_args_tested_offset()));
- __ BranchEqual(CMPRES1, kNumArgsTested, &ok);
- __ Stop("Incorrect ICData for equality");
- __ Bind(&ok);
- }
-#endif // DEBUG
- // Check IC data, update if needed.
- // T0: IC data object (preserved).
- __ lw(T6, FieldAddress(T0, ICData::ic_data_offset()));
- // T6: ic_data_array with check entries: classes and target functions.
- __ AddImmediate(T6, Array::data_offset() - kHeapObjectTag);
- // T6: points directly to the first ic data array element.
-
- Label get_class_id_as_smi, no_match, loop, found;
- __ Bind(&loop);
- // Check left.
- __ bal(&get_class_id_as_smi);
- __ delay_slot()->mov(T2, A1);
- __ lw(T3, Address(T6, 0 * kWordSize));
- __ bne(T2, T3, &no_match); // Class id match?
-
- // Check right.
- __ bal(&get_class_id_as_smi);
- __ delay_slot()->mov(T2, A0);
- __ lw(T3, Address(T6, 1 * kWordSize));
- __ beq(T2, T3, &found); // Class id match?
- __ Bind(&no_match);
- // Next check group.
- intptr_t entry_bytes = kWordSize * ICData::TestEntryLengthFor(kNumArgsTested);
- if (Utils::IsInt(kImmBits, entry_bytes)) {
- __ BranchNotEqual(T3, Smi::RawValue(kIllegalCid), &loop); // Done?
- __ delay_slot()->addiu(T6, T6, Immediate(entry_bytes));
- } else {
- __ AddImmediate(T6, entry_bytes);
- __ BranchNotEqual(T3, Smi::RawValue(kIllegalCid), &loop); // Done?
- }
-
- Label update_ic_data;
- __ b(&update_ic_data);
-
- __ Bind(&found);
- const intptr_t count_offset =
- ICData::CountIndexFor(kNumArgsTested) * kWordSize;
- Label no_overflow;
- __ lw(T1, Address(T6, count_offset));
- __ AddImmediateDetectOverflow(T1, T1, Smi::RawValue(1), CMPRES, T5);
- __ bgez(CMPRES, &no_overflow);
- __ delay_slot()->sw(T1, Address(T6, count_offset));
- __ LoadImmediate(TMP1, Smi::RawValue(Smi::kMaxValue));
- __ sw(TMP1, Address(T6, count_offset)); // If overflow.
- __ Bind(&no_overflow);
-
- Label compute_result;
- __ Bind(&compute_result);
- __ LoadObject(T4, Bool::True());
- __ LoadObject(T5, Bool::False());
- __ subu(CMPRES, A0, A1);
- __ movz(V0, T4, CMPRES);
- __ movn(V0, T5, CMPRES);
- __ LeaveStubFrameAndReturn();
-
- __ Bind(&get_class_id_as_smi);
- // Test if Smi -> load Smi class for comparison.
- Label not_smi;
- __ andi(CMPRES, T2, Immediate(kSmiTagMask));
- __ bne(CMPRES, ZR, &not_smi);
- __ jr(RA);
- __ delay_slot()->addiu(T2, ZR, Immediate(Smi::RawValue(kSmiCid)));
- __ Bind(&not_smi);
- __ LoadClassId(T2, T2);
- __ jr(RA);
- __ delay_slot()->SmiTag(T2);
-
- __ Bind(&update_ic_data);
- // T0: ICData
- __ addiu(SP, SP, Immediate(-4 * kWordSize));
- __ sw(A1, Address(SP, 3 * kWordSize));
- __ sw(A0, Address(SP, 2 * kWordSize));
- __ LoadObject(TMP1, Symbols::EqualOperator()); // Target's name.
- __ sw(TMP1, Address(SP, 1 * kWordSize));
- __ sw(T0, Address(SP, 0 * kWordSize)); // ICData.
- __ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry, 4);
- __ lw(A0, Address(SP, 2 * kWordSize));
- __ lw(A1, Address(SP, 3 * kWordSize));
- __ b(&compute_result);
- __ delay_slot()->addiu(SP, SP, Immediate(4 * kWordSize));
-}
-
-
// Calls to the runtime to optimize the given function.
// T0: function to be reoptimized.
// S4: argument descriptor (preserved).
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698