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

Side by Side Diff: src/crankshaft/mips64/lithium-codegen-mips64.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/mips/lithium-mips.cc ('k') | src/crankshaft/mips64/lithium-mips64.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. 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/mips64/lithium-codegen-mips64.h" 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/crankshaft/hydrogen-osr.h" 9 #include "src/crankshaft/hydrogen-osr.h"
10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h"
(...skipping 2697 matching lines...) Expand 10 before | Expand all | Expand 10 after
2708 2708
2709 InstanceOfStub stub(isolate()); 2709 InstanceOfStub stub(isolate());
2710 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 2710 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
2711 } 2711 }
2712 2712
2713 2713
2714 void LCodeGen::DoHasInPrototypeChainAndBranch( 2714 void LCodeGen::DoHasInPrototypeChainAndBranch(
2715 LHasInPrototypeChainAndBranch* instr) { 2715 LHasInPrototypeChainAndBranch* instr) {
2716 Register const object = ToRegister(instr->object()); 2716 Register const object = ToRegister(instr->object());
2717 Register const object_map = scratch0(); 2717 Register const object_map = scratch0();
2718 Register const object_instance_type = scratch1();
2718 Register const object_prototype = object_map; 2719 Register const object_prototype = object_map;
2719 Register const prototype = ToRegister(instr->prototype()); 2720 Register const prototype = ToRegister(instr->prototype());
2720 2721
2721 // The {object} must be a spec object. It's sufficient to know that {object} 2722 // The {object} must be a spec object. It's sufficient to know that {object}
2722 // is not a smi, since all other non-spec objects have {null} prototypes and 2723 // is not a smi, since all other non-spec objects have {null} prototypes and
2723 // will be ruled out below. 2724 // will be ruled out below.
2724 if (instr->hydrogen()->ObjectNeedsSmiCheck()) { 2725 if (instr->hydrogen()->ObjectNeedsSmiCheck()) {
2725 __ SmiTst(object, at); 2726 __ SmiTst(object, at);
2726 EmitFalseBranch(instr, eq, at, Operand(zero_reg)); 2727 EmitFalseBranch(instr, eq, at, Operand(zero_reg));
2727 } 2728 }
2728 2729
2729 // Loop through the {object}s prototype chain looking for the {prototype}. 2730 // Loop through the {object}s prototype chain looking for the {prototype}.
2730 __ ld(object_map, FieldMemOperand(object, HeapObject::kMapOffset)); 2731 __ ld(object_map, FieldMemOperand(object, HeapObject::kMapOffset));
2731 Label loop; 2732 Label loop;
2732 __ bind(&loop); 2733 __ bind(&loop);
2734 __ lbu(object_instance_type,
2735 FieldMemOperand(object_map, Map::kInstanceTypeOffset));
2736 DeoptimizeIf(eq, instr, Deoptimizer::kProxy, object_instance_type,
2737 Operand(JS_PROXY_TYPE));
2733 __ ld(object_prototype, FieldMemOperand(object_map, Map::kPrototypeOffset)); 2738 __ ld(object_prototype, FieldMemOperand(object_map, Map::kPrototypeOffset));
2734 EmitTrueBranch(instr, eq, object_prototype, Operand(prototype)); 2739 EmitTrueBranch(instr, eq, object_prototype, Operand(prototype));
2735 __ LoadRoot(at, Heap::kNullValueRootIndex); 2740 __ LoadRoot(at, Heap::kNullValueRootIndex);
2736 EmitFalseBranch(instr, eq, object_prototype, Operand(at)); 2741 EmitFalseBranch(instr, eq, object_prototype, Operand(at));
2737 __ Branch(&loop, USE_DELAY_SLOT); 2742 __ Branch(&loop, USE_DELAY_SLOT);
2738 __ ld(object_map, FieldMemOperand(object_prototype, 2743 __ ld(object_map, FieldMemOperand(object_prototype,
2739 HeapObject::kMapOffset)); // In delay slot. 2744 HeapObject::kMapOffset)); // In delay slot.
2740 } 2745 }
2741 2746
2742 2747
(...skipping 3179 matching lines...) Expand 10 before | Expand all | Expand 10 after
5922 __ Push(at, ToRegister(instr->function())); 5927 __ Push(at, ToRegister(instr->function()));
5923 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5928 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5924 RecordSafepoint(Safepoint::kNoLazyDeopt); 5929 RecordSafepoint(Safepoint::kNoLazyDeopt);
5925 } 5930 }
5926 5931
5927 5932
5928 #undef __ 5933 #undef __
5929 5934
5930 } // namespace internal 5935 } // namespace internal
5931 } // namespace v8 5936 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/mips/lithium-mips.cc ('k') | src/crankshaft/mips64/lithium-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698