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

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

Issue 1134483002: Allow loading holes from holey smi arrays (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update the DCHECK Created 5 years, 7 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
« no previous file with comments | « src/ppc/lithium-codegen-ppc.cc ('k') | src/x87/lithium-codegen-x87.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/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
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 3246 matching lines...) Expand 10 before | Expand all | Expand 10 after
3257 // Check for the hole value. 3257 // Check for the hole value.
3258 if (requires_hole_check) { 3258 if (requires_hole_check) {
3259 if (IsFastSmiElementsKind(hinstr->elements_kind())) { 3259 if (IsFastSmiElementsKind(hinstr->elements_kind())) {
3260 Condition smi = __ CheckSmi(result); 3260 Condition smi = __ CheckSmi(result);
3261 DeoptimizeIf(NegateCondition(smi), instr, Deoptimizer::kNotASmi); 3261 DeoptimizeIf(NegateCondition(smi), instr, Deoptimizer::kNotASmi);
3262 } else { 3262 } else {
3263 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); 3263 __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
3264 DeoptimizeIf(equal, instr, Deoptimizer::kHole); 3264 DeoptimizeIf(equal, instr, Deoptimizer::kHole);
3265 } 3265 }
3266 } else if (hinstr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { 3266 } else if (hinstr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
3267 DCHECK(hinstr->elements_kind() == FAST_HOLEY_ELEMENTS); 3267 DCHECK(hinstr->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
3268 hinstr->elements_kind() == FAST_HOLEY_ELEMENTS);
3268 Label done; 3269 Label done;
3269 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); 3270 __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
3270 __ j(not_equal, &done); 3271 __ j(not_equal, &done);
3271 if (info()->IsStub()) { 3272 if (info()->IsStub()) {
3272 // A stub can safely convert the hole to undefined only if the array 3273 // A stub can safely convert the hole to undefined only if the array
3273 // protector cell contains (Smi) Isolate::kArrayProtectorValid. Otherwise 3274 // protector cell contains (Smi) Isolate::kArrayProtectorValid. Otherwise
3274 // it needs to bail out. 3275 // it needs to bail out.
3275 __ LoadRoot(result, Heap::kArrayProtectorRootIndex); 3276 __ LoadRoot(result, Heap::kArrayProtectorRootIndex);
3276 __ Cmp(FieldOperand(result, Cell::kValueOffset), 3277 __ Cmp(FieldOperand(result, Cell::kValueOffset),
3277 Smi::FromInt(Isolate::kArrayProtectorValid)); 3278 Smi::FromInt(Isolate::kArrayProtectorValid));
(...skipping 2674 matching lines...) Expand 10 before | Expand all | Expand 10 after
5952 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5953 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5953 RecordSafepoint(Safepoint::kNoLazyDeopt); 5954 RecordSafepoint(Safepoint::kNoLazyDeopt);
5954 } 5955 }
5955 5956
5956 5957
5957 #undef __ 5958 #undef __
5958 5959
5959 } } // namespace v8::internal 5960 } } // namespace v8::internal
5960 5961
5961 #endif // V8_TARGET_ARCH_X64 5962 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ppc/lithium-codegen-ppc.cc ('k') | src/x87/lithium-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698