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

Unified Diff: runtime/vm/intermediate_language_mips.cc

Issue 169223005: Simplify type argument instantiation cache lookup by introducing an array (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_mips.cc
===================================================================
--- runtime/vm/intermediate_language_mips.cc (revision 32754)
+++ runtime/vm/intermediate_language_mips.cc (working copy)
@@ -2158,18 +2158,16 @@
__ LoadObject(T2, type_arguments());
__ lw(T2, FieldAddress(T2, TypeArguments::instantiations_offset()));
- __ lw(T3, FieldAddress(T2, Array::length_offset()));
__ AddImmediate(T2, Array::data_offset() - kHeapObjectTag);
- __ sll(TMP, T3, 1); // T3 is Smi.
- __ addu(T3, T2, TMP);
+ // The instantiations cache is initialized with Object::zero_array() and is
+ // therefore guaranteed to contain kNoInstantiator. No length check needed.
Label loop, found, slow_case;
__ Bind(&loop);
- __ BranchUnsignedGreaterEqual(T2, T3, &slow_case);
__ lw(T1, Address(T2, 0 * kWordSize)); // Cached instantiator.
__ beq(T1, T0, &found);
- __ BranchEqual(T1, Smi::RawValue(StubCode::kNoInstantiator), &slow_case);
- __ b(&loop);
+ __ BranchNotEqual(T1, Smi::RawValue(StubCode::kNoInstantiator), &loop);
__ delay_slot()->addiu(T2, T2, Immediate(2 * kWordSize));
+ __ b(&slow_case);
__ Bind(&found);
__ lw(T0, Address(T2, 1 * kWordSize)); // Cached instantiated args.
__ b(&type_arguments_instantiated);
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698