From 5bca664574cfc0213f6144cfe8b514e24c92804f Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Mon, 26 Mar 2012 09:41:53 +0000 Subject: [PATCH] MIPS: Improve polymorphic loads on single slots. Port r11132 (91bdad6108). Original commit message: If all property lookups for a polymorphic load actually result in the same field index under all maps, we can actually emit a monomorphic load that is guarded by a map check that verifies that the actual map is in the set of handled maps. This also allows GVN to get rid of redundant such map checks. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/9852007 Patch from Daniel Kalmar . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11135 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mips/lithium-codegen-mips.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 1b36d5b..e9023fa 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -4242,9 +4242,16 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) { LOperand* input = instr->InputAt(0); ASSERT(input->IsRegister()); Register reg = ToRegister(input); - Handle map = instr->hydrogen()->map(); - DoCheckMapCommon(reg, scratch, map, instr->hydrogen()->mode(), - instr->environment()); + Label success; + SmallMapList* map_set = instr->hydrogen()->map_set(); + for (int i = 0; i < map_set->length() - 1; i++) { + Handle map = map_set->at(i); + __ CompareMapAndBranch( + reg, scratch, map, &success, eq, &success, REQUIRE_EXACT_MAP); + } + Handle map = map_set->last(); + DoCheckMapCommon(reg, scratch, map, REQUIRE_EXACT_MAP, instr->environment()); + __ bind(&success); } -- 2.7.4