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

Side by Side Diff: src/arm64/lithium-codegen-arm64.cc

Issue 1100083002: Don't MISS if you read the hole from certain FastHoley arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: With ports and test. Created 5 years, 8 months 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
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arm64/lithium-codegen-arm64.h" 7 #include "src/arm64/lithium-codegen-arm64.h"
8 #include "src/arm64/lithium-gap-resolver-arm64.h" 8 #include "src/arm64/lithium-gap-resolver-arm64.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 3596 matching lines...) Expand 10 before | Expand all | Expand 10 after
3607 3607
3608 __ Load(result, mem_op, representation); 3608 __ Load(result, mem_op, representation);
3609 3609
3610 if (instr->hydrogen()->RequiresHoleCheck()) { 3610 if (instr->hydrogen()->RequiresHoleCheck()) {
3611 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { 3611 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) {
3612 DeoptimizeIfNotSmi(result, instr, Deoptimizer::kNotASmi); 3612 DeoptimizeIfNotSmi(result, instr, Deoptimizer::kNotASmi);
3613 } else { 3613 } else {
3614 DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, instr, 3614 DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, instr,
3615 Deoptimizer::kHole); 3615 Deoptimizer::kHole);
3616 } 3616 }
3617 } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
3618 DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
3619 Label done;
3620 __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
3621 __ B(ne, &done);
3622 if (info()->IsStub()) {
3623 // A stub can safely convert the hole to undefined only if the array
3624 // protector cell contains (Smi) 1. Otherwise it needs to bail out.
3625 __ LoadRoot(result, Heap::kArrayProtectorRootIndex);
3626 __ ldr(result, FieldMemOperand(result, Cell::kValueOffset));
Jakob Kummerow 2015/04/23 13:40:00 nit: s/ldr/Ldr/ (always use MacroAssembler instruc
mvstanton 2015/04/27 07:57:12 Done.
3627 __ Cmp(result, Operand(Smi::FromInt(1)));
3628 DeoptimizeIf(ne, instr, Deoptimizer::kHole);
3629 }
3630 __ LoadRoot(result, Heap::kUndefinedValueRootIndex);
3631 __ bind(&done);
Jakob Kummerow 2015/04/23 13:40:00 nit: s/bind/Bind/
mvstanton 2015/04/27 07:57:12 Done.
3617 } 3632 }
3618 } 3633 }
3619 3634
3620 3635
3621 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { 3636 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
3622 DCHECK(ToRegister(instr->context()).is(cp)); 3637 DCHECK(ToRegister(instr->context()).is(cp));
3623 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); 3638 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
3624 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); 3639 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));
3625 3640
3626 if (instr->hydrogen()->HasVectorAndSlot()) { 3641 if (instr->hydrogen()->HasVectorAndSlot()) {
(...skipping 2384 matching lines...) Expand 10 before | Expand all | Expand 10 after
6011 Handle<ScopeInfo> scope_info = instr->scope_info(); 6026 Handle<ScopeInfo> scope_info = instr->scope_info();
6012 __ Push(scope_info); 6027 __ Push(scope_info);
6013 __ Push(ToRegister(instr->function())); 6028 __ Push(ToRegister(instr->function()));
6014 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6029 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6015 RecordSafepoint(Safepoint::kNoLazyDeopt); 6030 RecordSafepoint(Safepoint::kNoLazyDeopt);
6016 } 6031 }
6017 6032
6018 6033
6019 6034
6020 } } // namespace v8::internal 6035 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698