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 <kalmard@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11135 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
mstarzinger@chromium.org 2012-03-26 09:41:53 +00:00
parent 4e405b6945
commit 5bca664574

View File

@ -4242,9 +4242,16 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
LOperand* input = instr->InputAt(0); LOperand* input = instr->InputAt(0);
ASSERT(input->IsRegister()); ASSERT(input->IsRegister());
Register reg = ToRegister(input); Register reg = ToRegister(input);
Handle<Map> map = instr->hydrogen()->map(); Label success;
DoCheckMapCommon(reg, scratch, map, instr->hydrogen()->mode(), SmallMapList* map_set = instr->hydrogen()->map_set();
instr->environment()); for (int i = 0; i < map_set->length() - 1; i++) {
Handle<Map> map = map_set->at(i);
__ CompareMapAndBranch(
reg, scratch, map, &success, eq, &success, REQUIRE_EXACT_MAP);
}
Handle<Map> map = map_set->last();
DoCheckMapCommon(reg, scratch, map, REQUIRE_EXACT_MAP, instr->environment());
__ bind(&success);
} }