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

Side by Side Diff: src/crankshaft/s390/lithium-codegen-s390.cc

Issue 2697473004: PPC/s390: [crankshaft] Fix Smi overflow in {HMaybeGrowElements}. (Closed)
Patch Set: Created 3 years, 10 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/crankshaft/ppc/lithium-codegen-ppc.cc ('k') | no next file » | 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 // 2 //
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 #include "src/crankshaft/s390/lithium-codegen-s390.h" 6 #include "src/crankshaft/s390/lithium-codegen-s390.h"
7 7
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/builtins/builtins-constructor.h" 9 #include "src/builtins/builtins-constructor.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 4265 matching lines...) Expand 10 before | Expand all | Expand 10 after
4276 __ LoadP(result, ToMemOperand(instr->object())); 4276 __ LoadP(result, ToMemOperand(instr->object()));
4277 } 4277 }
4278 4278
4279 LOperand* key = instr->key(); 4279 LOperand* key = instr->key();
4280 if (key->IsConstantOperand()) { 4280 if (key->IsConstantOperand()) {
4281 LConstantOperand* constant_key = LConstantOperand::cast(key); 4281 LConstantOperand* constant_key = LConstantOperand::cast(key);
4282 int32_t int_key = ToInteger32(constant_key); 4282 int32_t int_key = ToInteger32(constant_key);
4283 if (Smi::IsValid(int_key)) { 4283 if (Smi::IsValid(int_key)) {
4284 __ LoadSmiLiteral(r5, Smi::FromInt(int_key)); 4284 __ LoadSmiLiteral(r5, Smi::FromInt(int_key));
4285 } else { 4285 } else {
4286 // We should never get here at runtime because there is a smi check on 4286 Abort(kArrayIndexConstantValueTooBig);
4287 // the key before this point.
4288 __ stop("expected smi");
4289 } 4287 }
4290 } else { 4288 } else {
4289 Label is_smi;
4290 #if V8_TARGET_ARCH_S390X
4291 __ SmiTag(r5, ToRegister(key)); 4291 __ SmiTag(r5, ToRegister(key));
4292 #else
4293 // Deopt if the key is outside Smi range. The stub expects Smi and would
4294 // bump the elements into dictionary mode (and trigger a deopt) anyways.
4295 __ Add32(r5, ToRegister(key), ToRegister(key));
4296 __ b(nooverflow, &is_smi);
4297 __ PopSafepointRegisters();
4298 DeoptimizeIf(al, instr, DeoptimizeReason::kOverflow, cr0);
4299 __ bind(&is_smi);
4300 #endif
4292 } 4301 }
4293 4302
4294 GrowArrayElementsStub stub(isolate(), instr->hydrogen()->kind()); 4303 GrowArrayElementsStub stub(isolate(), instr->hydrogen()->kind());
4295 __ CallStub(&stub); 4304 __ CallStub(&stub);
4296 RecordSafepointWithLazyDeopt( 4305 RecordSafepointWithLazyDeopt(
4297 instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); 4306 instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
4298 __ StoreToSafepointRegisterSlot(result, result); 4307 __ StoreToSafepointRegisterSlot(result, result);
4299 } 4308 }
4300 4309
4301 // Deopt on smi, which means the elements array changed to dictionary mode. 4310 // Deopt on smi, which means the elements array changed to dictionary mode.
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
5599 __ LoadP(result, 5608 __ LoadP(result,
5600 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); 5609 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize));
5601 __ bind(deferred->exit()); 5610 __ bind(deferred->exit());
5602 __ bind(&done); 5611 __ bind(&done);
5603 } 5612 }
5604 5613
5605 #undef __ 5614 #undef __
5606 5615
5607 } // namespace internal 5616 } // namespace internal
5608 } // namespace v8 5617 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/ppc/lithium-codegen-ppc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698