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

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

Issue 2686263002: [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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/mips64/lithium-codegen-mips64.h" 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h"
6 6
7 #include "src/builtins/builtins-constructor.h" 7 #include "src/builtins/builtins-constructor.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/crankshaft/hydrogen-osr.h" 10 #include "src/crankshaft/hydrogen-osr.h"
(...skipping 4231 matching lines...) Expand 10 before | Expand all | Expand 10 after
4242 { 4242 {
4243 PushSafepointRegistersScope scope(this); 4243 PushSafepointRegistersScope scope(this);
4244 if (instr->object()->IsRegister()) { 4244 if (instr->object()->IsRegister()) {
4245 __ mov(result, ToRegister(instr->object())); 4245 __ mov(result, ToRegister(instr->object()));
4246 } else { 4246 } else {
4247 __ ld(result, ToMemOperand(instr->object())); 4247 __ ld(result, ToMemOperand(instr->object()));
4248 } 4248 }
4249 4249
4250 LOperand* key = instr->key(); 4250 LOperand* key = instr->key();
4251 if (key->IsConstantOperand()) { 4251 if (key->IsConstantOperand()) {
4252 LConstantOperand* constant_key = LConstantOperand::cast(key); 4252 __ li(a3, Operand(ToSmi(LConstantOperand::cast(key))));
4253 int32_t int_key = ToInteger32(constant_key);
4254 if (Smi::IsValid(int_key)) {
4255 __ li(a3, Operand(Smi::FromInt(int_key)));
4256 } else {
4257 // We should never get here at runtime because there is a smi check on
4258 // the key before this point.
4259 __ stop("expected smi");
4260 }
4261 } else { 4253 } else {
4262 __ mov(a3, ToRegister(key)); 4254 __ mov(a3, ToRegister(key));
4263 __ SmiTag(a3); 4255 __ SmiTag(a3);
4264 } 4256 }
4265 4257
4266 GrowArrayElementsStub stub(isolate(), instr->hydrogen()->kind()); 4258 GrowArrayElementsStub stub(isolate(), instr->hydrogen()->kind());
4267 __ mov(a0, result); 4259 __ mov(a0, result);
4268 __ CallStub(&stub); 4260 __ CallStub(&stub);
4269 RecordSafepointWithLazyDeopt( 4261 RecordSafepointWithLazyDeopt(
4270 instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); 4262 instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
(...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after
5638 __ ld(result, FieldMemOperand(scratch, 5630 __ ld(result, FieldMemOperand(scratch,
5639 FixedArray::kHeaderSize - kPointerSize)); 5631 FixedArray::kHeaderSize - kPointerSize));
5640 __ bind(deferred->exit()); 5632 __ bind(deferred->exit());
5641 __ bind(&done); 5633 __ bind(&done);
5642 } 5634 }
5643 5635
5644 #undef __ 5636 #undef __
5645 5637
5646 } // namespace internal 5638 } // namespace internal
5647 } // namespace v8 5639 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/mips/lithium-codegen-mips.cc ('k') | test/mjsunit/regress/regress-crbug-686427.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698