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

Side by Side Diff: src/crankshaft/mips/lithium-codegen-mips.cc

Issue 1492983002: [crankshaft] Deoptimize if HHasInPrototypeChainAndBranch hits a proxy. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « src/crankshaft/ia32/lithium-ia32.cc ('k') | src/crankshaft/mips/lithium-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2591 matching lines...) Expand 10 before | Expand all | Expand 10 after
2602 DCHECK(ToRegister(instr->result()).is(v0)); 2602 DCHECK(ToRegister(instr->result()).is(v0));
2603 InstanceOfStub stub(isolate()); 2603 InstanceOfStub stub(isolate());
2604 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 2604 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
2605 } 2605 }
2606 2606
2607 2607
2608 void LCodeGen::DoHasInPrototypeChainAndBranch( 2608 void LCodeGen::DoHasInPrototypeChainAndBranch(
2609 LHasInPrototypeChainAndBranch* instr) { 2609 LHasInPrototypeChainAndBranch* instr) {
2610 Register const object = ToRegister(instr->object()); 2610 Register const object = ToRegister(instr->object());
2611 Register const object_map = scratch0(); 2611 Register const object_map = scratch0();
2612 Register const object_instance_type = scratch1();
2612 Register const object_prototype = object_map; 2613 Register const object_prototype = object_map;
2613 Register const prototype = ToRegister(instr->prototype()); 2614 Register const prototype = ToRegister(instr->prototype());
2614 2615
2615 // The {object} must be a spec object. It's sufficient to know that {object} 2616 // The {object} must be a spec object. It's sufficient to know that {object}
2616 // is not a smi, since all other non-spec objects have {null} prototypes and 2617 // is not a smi, since all other non-spec objects have {null} prototypes and
2617 // will be ruled out below. 2618 // will be ruled out below.
2618 if (instr->hydrogen()->ObjectNeedsSmiCheck()) { 2619 if (instr->hydrogen()->ObjectNeedsSmiCheck()) {
2619 __ SmiTst(object, at); 2620 __ SmiTst(object, at);
2620 EmitFalseBranch(instr, eq, at, Operand(zero_reg)); 2621 EmitFalseBranch(instr, eq, at, Operand(zero_reg));
2621 } 2622 }
2622 // Loop through the {object}s prototype chain looking for the {prototype}. 2623 // Loop through the {object}s prototype chain looking for the {prototype}.
2623 __ lw(object_map, FieldMemOperand(object, HeapObject::kMapOffset)); 2624 __ lw(object_map, FieldMemOperand(object, HeapObject::kMapOffset));
2624 Label loop; 2625 Label loop;
2625 __ bind(&loop); 2626 __ bind(&loop);
2627 __ lbu(object_instance_type,
2628 FieldMemOperand(object_map, Map::kInstanceTypeOffset));
2629 DeoptimizeIf(eq, instr, Deoptimizer::kProxy, object_instance_type,
2630 Operand(JS_PROXY_TYPE));
2626 __ lw(object_prototype, FieldMemOperand(object_map, Map::kPrototypeOffset)); 2631 __ lw(object_prototype, FieldMemOperand(object_map, Map::kPrototypeOffset));
2627 EmitTrueBranch(instr, eq, object_prototype, Operand(prototype)); 2632 EmitTrueBranch(instr, eq, object_prototype, Operand(prototype));
2628 __ LoadRoot(at, Heap::kNullValueRootIndex); 2633 __ LoadRoot(at, Heap::kNullValueRootIndex);
2629 EmitFalseBranch(instr, eq, object_prototype, Operand(at)); 2634 EmitFalseBranch(instr, eq, object_prototype, Operand(at));
2630 __ Branch(USE_DELAY_SLOT, &loop); 2635 __ Branch(USE_DELAY_SLOT, &loop);
2631 __ lw(object_map, FieldMemOperand(object_prototype, HeapObject::kMapOffset)); 2636 __ lw(object_map, FieldMemOperand(object_prototype, HeapObject::kMapOffset));
2632 } 2637 }
2633 2638
2634 2639
2635 void LCodeGen::DoCmpT(LCmpT* instr) { 2640 void LCodeGen::DoCmpT(LCmpT* instr) {
(...skipping 3098 matching lines...) Expand 10 before | Expand all | Expand 10 after
5734 __ Push(at, ToRegister(instr->function())); 5739 __ Push(at, ToRegister(instr->function()));
5735 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5740 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5736 RecordSafepoint(Safepoint::kNoLazyDeopt); 5741 RecordSafepoint(Safepoint::kNoLazyDeopt);
5737 } 5742 }
5738 5743
5739 5744
5740 #undef __ 5745 #undef __
5741 5746
5742 } // namespace internal 5747 } // namespace internal
5743 } // namespace v8 5748 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/ia32/lithium-ia32.cc ('k') | src/crankshaft/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698