PPC: [crankshaft] Deoptimize if HHasInPrototypeChainAndBranch hits a proxy.

Port a330af0ed1

Original commit message:
    The optimized code generated by Crankshaft cannot properly deal
    with proxies (in the prototype chain), and there's probably no
    point in trying to make that work^Wfast with Crankshaft at all.
    TurboFan will handle that properly; Crankshaft just bails out
    to fullcodegen, which then goes to the runtime, which should do
    the right thing soon.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:1543
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#32583}
This commit is contained in:
mbrandy 2015-12-03 11:35:39 -08:00 committed by Commit bot
parent 1a61dab34b
commit 90e4179f2d
2 changed files with 6 additions and 1 deletions

View File

@ -2756,6 +2756,7 @@ void LCodeGen::DoHasInPrototypeChainAndBranch(
LHasInPrototypeChainAndBranch* instr) {
Register const object = ToRegister(instr->object());
Register const object_map = scratch0();
Register const object_instance_type = ip;
Register const object_prototype = object_map;
Register const prototype = ToRegister(instr->prototype());
@ -2771,6 +2772,8 @@ void LCodeGen::DoHasInPrototypeChainAndBranch(
__ LoadP(object_map, FieldMemOperand(object, HeapObject::kMapOffset));
Label loop;
__ bind(&loop);
__ CompareInstanceType(object_map, object_instance_type, JS_PROXY_TYPE);
DeoptimizeIf(eq, instr, Deoptimizer::kProxy);
__ LoadP(object_prototype,
FieldMemOperand(object_map, Map::kPrototypeOffset));
__ cmp(object_prototype, prototype);

View File

@ -995,7 +995,9 @@ LInstruction* LChunkBuilder::DoHasInPrototypeChainAndBranch(
HHasInPrototypeChainAndBranch* instr) {
LOperand* object = UseRegister(instr->object());
LOperand* prototype = UseRegister(instr->prototype());
return new (zone()) LHasInPrototypeChainAndBranch(object, prototype);
LHasInPrototypeChainAndBranch* result =
new (zone()) LHasInPrototypeChainAndBranch(object, prototype);
return AssignEnvironment(result);
}