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

Unified Diff: runtime/vm/intermediate_language_x64.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_mips.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_x64.cc
===================================================================
--- runtime/vm/intermediate_language_x64.cc (revision 32754)
+++ runtime/vm/intermediate_language_x64.cc (working copy)
@@ -2073,23 +2073,21 @@
// generated code size.
__ LoadObject(RDI, type_arguments(), PP);
__ movq(RDI, FieldAddress(RDI, TypeArguments::instantiations_offset()));
- __ movq(RBX, FieldAddress(RDI, Array::length_offset()));
__ leaq(RDI, FieldAddress(RDI, Array::data_offset()));
- __ leaq(RBX, Address(RDI, RBX, TIMES_2, 0)); // RBX is smi.
+ // 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);
- __ cmpq(RDI, RBX);
- __ j(ABOVE_EQUAL, &slow_case);
__ movq(RDX, Address(RDI, 0 * kWordSize)); // Cached instantiator.
__ cmpq(RDX, RAX);
__ j(EQUAL, &found, Assembler::kNearJump);
- __ cmpq(RDX, Immediate(Smi::RawValue(StubCode::kNoInstantiator)));
- __ j(EQUAL, &slow_case);
__ addq(RDI, Immediate(2 * kWordSize));
- __ jmp(&loop, Assembler::kNearJump);
+ __ cmpq(RDX, Immediate(Smi::RawValue(StubCode::kNoInstantiator)));
+ __ j(NOT_EQUAL, &loop, Assembler::kNearJump);
+ __ jmp(&slow_case, Assembler::kNearJump);
__ Bind(&found);
__ movq(RAX, Address(RDI, 1 * kWordSize)); // Cached instantiated args.
- __ jmp(&type_arguments_instantiated);
+ __ jmp(&type_arguments_instantiated, Assembler::kNearJump);
__ Bind(&slow_case);
// Instantiate non-null type arguments.
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698