Commit a94a5661 authored by plind44@gmail.com's avatar plind44@gmail.com

MIPS: Fix performance regression on sunspider string-unpack-code.

Regression surfaced with r19009, but latent error was present since
r17767.

BUG=
R=dusan.milosavljevic@rt-rk.com

Review URL: https://codereview.chromium.org/171793005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19500 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent adfed0a1
...@@ -1439,10 +1439,11 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( ...@@ -1439,10 +1439,11 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
} }
Label number_case; Label number_case;
Register match = scratch1();
Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
__ JumpIfSmi(receiver(), smi_target); __ JumpIfSmi(receiver(), smi_target, match); // Reg match is 0 if Smi.
Register map_reg = scratch1(); Register map_reg = scratch2();
int receiver_count = types->length(); int receiver_count = types->length();
int number_of_handled_maps = 0; int number_of_handled_maps = 0;
...@@ -1452,12 +1453,15 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( ...@@ -1452,12 +1453,15 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
Handle<Map> map = IC::TypeToMap(*type, isolate()); Handle<Map> map = IC::TypeToMap(*type, isolate());
if (!map->is_deprecated()) { if (!map->is_deprecated()) {
number_of_handled_maps++; number_of_handled_maps++;
// Check map and tail call if there's a match.
// Separate compare from branch, to provide path for above JumpIfSmi().
__ Subu(match, map_reg, Operand(map));
if (type->Is(HeapType::Number())) { if (type->Is(HeapType::Number())) {
ASSERT(!number_case.is_unused()); ASSERT(!number_case.is_unused());
__ bind(&number_case); __ bind(&number_case);
} }
__ Jump(handlers->at(current), RelocInfo::CODE_TARGET, __ Jump(handlers->at(current), RelocInfo::CODE_TARGET,
eq, map_reg, Operand(map)); eq, match, Operand(zero_reg));
} }
} }
ASSERT(number_of_handled_maps != 0); ASSERT(number_of_handled_maps != 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment