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

Side by Side Diff: src/crankshaft/arm64/lithium-codegen-arm64.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/arm64/lithium-arm64.cc ('k') | src/crankshaft/hydrogen-instructions.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/arm64/lithium-codegen-arm64.h" 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h"
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after
2952 DCHECK(ToRegister(instr->right()).is(InstanceOfDescriptor::RightRegister())); 2952 DCHECK(ToRegister(instr->right()).is(InstanceOfDescriptor::RightRegister()));
2953 DCHECK(ToRegister(instr->result()).is(x0)); 2953 DCHECK(ToRegister(instr->result()).is(x0));
2954 InstanceOfStub stub(isolate()); 2954 InstanceOfStub stub(isolate());
2955 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 2955 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
2956 } 2956 }
2957 2957
2958 2958
2959 void LCodeGen::DoHasInPrototypeChainAndBranch( 2959 void LCodeGen::DoHasInPrototypeChainAndBranch(
2960 LHasInPrototypeChainAndBranch* instr) { 2960 LHasInPrototypeChainAndBranch* instr) {
2961 Register const object = ToRegister(instr->object()); 2961 Register const object = ToRegister(instr->object());
2962 Register const object_map = ToRegister(instr->scratch()); 2962 Register const object_map = ToRegister(instr->scratch1());
2963 Register const object_instance_type = ToRegister(instr->scratch2());
2963 Register const object_prototype = object_map; 2964 Register const object_prototype = object_map;
2964 Register const prototype = ToRegister(instr->prototype()); 2965 Register const prototype = ToRegister(instr->prototype());
2965 2966
2966 // The {object} must be a spec object. It's sufficient to know that {object} 2967 // The {object} must be a spec object. It's sufficient to know that {object}
2967 // is not a smi, since all other non-spec objects have {null} prototypes and 2968 // is not a smi, since all other non-spec objects have {null} prototypes and
2968 // will be ruled out below. 2969 // will be ruled out below.
2969 if (instr->hydrogen()->ObjectNeedsSmiCheck()) { 2970 if (instr->hydrogen()->ObjectNeedsSmiCheck()) {
2970 __ JumpIfSmi(object, instr->FalseLabel(chunk_)); 2971 __ JumpIfSmi(object, instr->FalseLabel(chunk_));
2971 } 2972 }
2972 2973
2973 // Loop through the {object}s prototype chain looking for the {prototype}. 2974 // Loop through the {object}s prototype chain looking for the {prototype}.
2974 __ Ldr(object_map, FieldMemOperand(object, HeapObject::kMapOffset)); 2975 __ Ldr(object_map, FieldMemOperand(object, HeapObject::kMapOffset));
2975 Label loop; 2976 Label loop;
2976 __ Bind(&loop); 2977 __ Bind(&loop);
2978 __ CompareInstanceType(object_map, object_instance_type, JS_PROXY_TYPE);
2979 DeoptimizeIf(eq, instr, Deoptimizer::kProxy);
2977 __ Ldr(object_prototype, FieldMemOperand(object_map, Map::kPrototypeOffset)); 2980 __ Ldr(object_prototype, FieldMemOperand(object_map, Map::kPrototypeOffset));
2978 __ Cmp(object_prototype, prototype); 2981 __ Cmp(object_prototype, prototype);
2979 __ B(eq, instr->TrueLabel(chunk_)); 2982 __ B(eq, instr->TrueLabel(chunk_));
2980 __ CompareRoot(object_prototype, Heap::kNullValueRootIndex); 2983 __ CompareRoot(object_prototype, Heap::kNullValueRootIndex);
2981 __ B(eq, instr->FalseLabel(chunk_)); 2984 __ B(eq, instr->FalseLabel(chunk_));
2982 __ Ldr(object_map, FieldMemOperand(object_prototype, HeapObject::kMapOffset)); 2985 __ Ldr(object_map, FieldMemOperand(object_prototype, HeapObject::kMapOffset));
2983 __ B(&loop); 2986 __ B(&loop);
2984 } 2987 }
2985 2988
2986 2989
(...skipping 2885 matching lines...) Expand 10 before | Expand all | Expand 10 after
5872 Handle<ScopeInfo> scope_info = instr->scope_info(); 5875 Handle<ScopeInfo> scope_info = instr->scope_info();
5873 __ Push(scope_info); 5876 __ Push(scope_info);
5874 __ Push(ToRegister(instr->function())); 5877 __ Push(ToRegister(instr->function()));
5875 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5878 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5876 RecordSafepoint(Safepoint::kNoLazyDeopt); 5879 RecordSafepoint(Safepoint::kNoLazyDeopt);
5877 } 5880 }
5878 5881
5879 5882
5880 } // namespace internal 5883 } // namespace internal
5881 } // namespace v8 5884 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/arm64/lithium-arm64.cc ('k') | src/crankshaft/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698