Chromium Code Reviews

Side by Side Diff: src/ppc/lithium-codegen-ppc.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.
Jump to:
View unified diff |
« no previous file with comments | « src/mips64/lithium-codegen-mips64.cc ('k') | src/x64/lithium-codegen-x64.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/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/cpu-profiler.h" 10 #include "src/cpu-profiler.h"
(...skipping 3477 matching lines...)
3488 if (requires_hole_check) { 3488 if (requires_hole_check) {
3489 if (IsFastSmiElementsKind(hinstr->elements_kind())) { 3489 if (IsFastSmiElementsKind(hinstr->elements_kind())) {
3490 __ TestIfSmi(result, r0); 3490 __ TestIfSmi(result, r0);
3491 DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, cr0); 3491 DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, cr0);
3492 } else { 3492 } else {
3493 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); 3493 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
3494 __ cmp(result, scratch); 3494 __ cmp(result, scratch);
3495 DeoptimizeIf(eq, instr, Deoptimizer::kHole); 3495 DeoptimizeIf(eq, instr, Deoptimizer::kHole);
3496 } 3496 }
3497 } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { 3497 } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
3498 DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS); 3498 DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS ||
3499 instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
3499 Label done; 3500 Label done;
3500 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); 3501 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex);
3501 __ cmp(result, scratch); 3502 __ cmp(result, scratch);
3502 __ bne(&done); 3503 __ bne(&done);
3503 if (info()->IsStub()) { 3504 if (info()->IsStub()) {
3504 // A stub can safely convert the hole to undefined only if the array 3505 // A stub can safely convert the hole to undefined only if the array
3505 // protector cell contains (Smi) Isolate::kArrayProtectorValid. Otherwise 3506 // protector cell contains (Smi) Isolate::kArrayProtectorValid. Otherwise
3506 // it needs to bail out. 3507 // it needs to bail out.
3507 __ LoadRoot(result, Heap::kArrayProtectorRootIndex); 3508 __ LoadRoot(result, Heap::kArrayProtectorRootIndex);
3508 __ LoadP(result, FieldMemOperand(result, Cell::kValueOffset)); 3509 __ LoadP(result, FieldMemOperand(result, Cell::kValueOffset));
(...skipping 2705 matching lines...)
6214 __ Push(scope_info); 6215 __ Push(scope_info);
6215 __ push(ToRegister(instr->function())); 6216 __ push(ToRegister(instr->function()));
6216 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6217 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6217 RecordSafepoint(Safepoint::kNoLazyDeopt); 6218 RecordSafepoint(Safepoint::kNoLazyDeopt);
6218 } 6219 }
6219 6220
6220 6221
6221 #undef __ 6222 #undef __
6222 } 6223 }
6223 } // namespace v8::internal 6224 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips64/lithium-codegen-mips64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine