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

Side by Side Diff: src/crankshaft/arm/lithium-codegen-arm.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/arm/lithium-arm.cc ('k') | src/crankshaft/arm64/lithium-arm64.h » ('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. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/crankshaft/arm/lithium-codegen-arm.h" 5 #include "src/crankshaft/arm/lithium-codegen-arm.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h"
(...skipping 2665 matching lines...) Expand 10 before | Expand all | Expand 10 after
2676 DCHECK(ToRegister(instr->result()).is(r0)); 2676 DCHECK(ToRegister(instr->result()).is(r0));
2677 InstanceOfStub stub(isolate()); 2677 InstanceOfStub stub(isolate());
2678 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 2678 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
2679 } 2679 }
2680 2680
2681 2681
2682 void LCodeGen::DoHasInPrototypeChainAndBranch( 2682 void LCodeGen::DoHasInPrototypeChainAndBranch(
2683 LHasInPrototypeChainAndBranch* instr) { 2683 LHasInPrototypeChainAndBranch* instr) {
2684 Register const object = ToRegister(instr->object()); 2684 Register const object = ToRegister(instr->object());
2685 Register const object_map = scratch0(); 2685 Register const object_map = scratch0();
2686 Register const object_instance_type = ip;
2686 Register const object_prototype = object_map; 2687 Register const object_prototype = object_map;
2687 Register const prototype = ToRegister(instr->prototype()); 2688 Register const prototype = ToRegister(instr->prototype());
2688 2689
2689 // The {object} must be a spec object. It's sufficient to know that {object} 2690 // The {object} must be a spec object. It's sufficient to know that {object}
2690 // is not a smi, since all other non-spec objects have {null} prototypes and 2691 // is not a smi, since all other non-spec objects have {null} prototypes and
2691 // will be ruled out below. 2692 // will be ruled out below.
2692 if (instr->hydrogen()->ObjectNeedsSmiCheck()) { 2693 if (instr->hydrogen()->ObjectNeedsSmiCheck()) {
2693 __ SmiTst(object); 2694 __ SmiTst(object);
2694 EmitFalseBranch(instr, eq); 2695 EmitFalseBranch(instr, eq);
2695 } 2696 }
2696 2697
2697 // Loop through the {object}s prototype chain looking for the {prototype}. 2698 // Loop through the {object}s prototype chain looking for the {prototype}.
2698 __ ldr(object_map, FieldMemOperand(object, HeapObject::kMapOffset)); 2699 __ ldr(object_map, FieldMemOperand(object, HeapObject::kMapOffset));
2699 Label loop; 2700 Label loop;
2700 __ bind(&loop); 2701 __ bind(&loop);
2702 __ CompareInstanceType(object_map, object_instance_type, JS_PROXY_TYPE);
2703 DeoptimizeIf(eq, instr, Deoptimizer::kProxy);
2701 __ ldr(object_prototype, FieldMemOperand(object_map, Map::kPrototypeOffset)); 2704 __ ldr(object_prototype, FieldMemOperand(object_map, Map::kPrototypeOffset));
2702 __ cmp(object_prototype, prototype); 2705 __ cmp(object_prototype, prototype);
2703 EmitTrueBranch(instr, eq); 2706 EmitTrueBranch(instr, eq);
2704 __ CompareRoot(object_prototype, Heap::kNullValueRootIndex); 2707 __ CompareRoot(object_prototype, Heap::kNullValueRootIndex);
2705 EmitFalseBranch(instr, eq); 2708 EmitFalseBranch(instr, eq);
2706 __ ldr(object_map, FieldMemOperand(object_prototype, HeapObject::kMapOffset)); 2709 __ ldr(object_map, FieldMemOperand(object_prototype, HeapObject::kMapOffset));
2707 __ b(&loop); 2710 __ b(&loop);
2708 } 2711 }
2709 2712
2710 2713
(...skipping 2983 matching lines...) Expand 10 before | Expand all | Expand 10 after
5694 __ push(ToRegister(instr->function())); 5697 __ push(ToRegister(instr->function()));
5695 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5698 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5696 RecordSafepoint(Safepoint::kNoLazyDeopt); 5699 RecordSafepoint(Safepoint::kNoLazyDeopt);
5697 } 5700 }
5698 5701
5699 5702
5700 #undef __ 5703 #undef __
5701 5704
5702 } // namespace internal 5705 } // namespace internal
5703 } // namespace v8 5706 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/arm/lithium-arm.cc ('k') | src/crankshaft/arm64/lithium-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698