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

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

Issue 145893004: A64: Fix handling of Smis in lithium Load/Store. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/a64/lithium-a64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3454 matching lines...) Expand 10 before | Expand all | Expand 10 after
3465 instr->additional_index()); 3465 instr->additional_index());
3466 load_base = elements; 3466 load_base = elements;
3467 } else { 3467 } else {
3468 load_base = ToRegister(instr->temp()); 3468 load_base = ToRegister(instr->temp());
3469 Register key = ToRegister(instr->key()); 3469 Register key = ToRegister(instr->key());
3470 bool key_is_tagged = instr->hydrogen()->key()->representation().IsSmi(); 3470 bool key_is_tagged = instr->hydrogen()->key()->representation().IsSmi();
3471 CalcKeyedArrayBaseRegister(load_base, elements, key, key_is_tagged, 3471 CalcKeyedArrayBaseRegister(load_base, elements, key, key_is_tagged,
3472 instr->hydrogen()->elements_kind()); 3472 instr->hydrogen()->elements_kind());
3473 offset = FixedArray::OffsetOfElementAt(instr->additional_index()); 3473 offset = FixedArray::OffsetOfElementAt(instr->additional_index());
3474 } 3474 }
3475 __ Ldr(result, FieldMemOperand(load_base, offset)); 3475 Representation representation = instr->hydrogen()->representation();
3476
3477 if (representation.IsInteger32() &&
3478 instr->hydrogen()->elements_kind() == FAST_SMI_ELEMENTS) {
m.m.capewell 2014/02/07 15:56:50 Perhaps assert the format of a smi here and in sto
ulan 2014/02/07 16:08:09 Done.
3479 __ Load(result, UntagSmiFieldMemOperand(load_base, offset),
3480 Representation::Integer32());
3481 } else {
3482 __ Load(result, FieldMemOperand(load_base, offset),
3483 representation);
3484 }
3476 3485
3477 if (instr->hydrogen()->RequiresHoleCheck()) { 3486 if (instr->hydrogen()->RequiresHoleCheck()) {
3478 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { 3487 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) {
3479 DeoptimizeIfNotSmi(result, instr->environment()); 3488 DeoptimizeIfNotSmi(result, instr->environment());
3480 } else { 3489 } else {
3481 DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, 3490 DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex,
3482 instr->environment()); 3491 instr->environment());
3483 } 3492 }
3484 } 3493 }
3485 } 3494 }
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after
4907 offset = FixedArray::OffsetOfElementAt(ToInteger32(const_operand) + 4916 offset = FixedArray::OffsetOfElementAt(ToInteger32(const_operand) +
4908 instr->additional_index()); 4917 instr->additional_index());
4909 store_base = elements; 4918 store_base = elements;
4910 } else { 4919 } else {
4911 key = ToRegister(instr->key()); 4920 key = ToRegister(instr->key());
4912 bool key_is_tagged = instr->hydrogen()->key()->representation().IsSmi(); 4921 bool key_is_tagged = instr->hydrogen()->key()->representation().IsSmi();
4913 CalcKeyedArrayBaseRegister(store_base, elements, key, key_is_tagged, 4922 CalcKeyedArrayBaseRegister(store_base, elements, key, key_is_tagged,
4914 instr->hydrogen()->elements_kind()); 4923 instr->hydrogen()->elements_kind());
4915 offset = FixedArray::OffsetOfElementAt(instr->additional_index()); 4924 offset = FixedArray::OffsetOfElementAt(instr->additional_index());
4916 } 4925 }
4917 __ Str(value, FieldMemOperand(store_base, offset)); 4926 Representation representation = instr->hydrogen()->value()->representation();
4927 if (representation.IsInteger32()) {
4928 ASSERT(instr->hydrogen()->store_mode() == STORE_TO_INITIALIZED_ENTRY);
4929 ASSERT(instr->hydrogen()->elements_kind() == FAST_SMI_ELEMENTS);
4930 __ Store(value, UntagSmiFieldMemOperand(store_base, offset),
4931 Representation::Integer32());
4932 } else {
4933 __ Store(value, FieldMemOperand(store_base, offset), representation);
4934 }
4918 4935
4919 if (instr->hydrogen()->NeedsWriteBarrier()) { 4936 if (instr->hydrogen()->NeedsWriteBarrier()) {
4920 SmiCheck check_needed = 4937 SmiCheck check_needed =
4921 instr->hydrogen()->value()->IsHeapObject() 4938 instr->hydrogen()->value()->IsHeapObject()
4922 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4939 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4923 // Compute address of modified element and store it into key register. 4940 // Compute address of modified element and store it into key register.
4924 __ Add(key, store_base, offset - kHeapObjectTag); 4941 __ Add(key, store_base, offset - kHeapObjectTag);
4925 __ RecordWrite(elements, key, value, GetLinkRegisterState(), kSaveFPRegs, 4942 __ RecordWrite(elements, key, value, GetLinkRegisterState(), kSaveFPRegs,
4926 EMIT_REMEMBERED_SET, check_needed); 4943 EMIT_REMEMBERED_SET, check_needed);
4927 } 4944 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
4996 Register destination; 5013 Register destination;
4997 SmiCheck check_needed = 5014 SmiCheck check_needed =
4998 instr->hydrogen()->value()->IsHeapObject() 5015 instr->hydrogen()->value()->IsHeapObject()
4999 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 5016 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
5000 if (access.IsInobject()) { 5017 if (access.IsInobject()) {
5001 destination = object; 5018 destination = object;
5002 } else { 5019 } else {
5003 __ Ldr(temp0, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5020 __ Ldr(temp0, FieldMemOperand(object, JSObject::kPropertiesOffset));
5004 destination = temp0; 5021 destination = temp0;
5005 } 5022 }
5006 __ Store(value, FieldMemOperand(destination, offset), representation); 5023
5024 if (representation.IsSmi() &&
5025 instr->hydrogen()->value()->representation().IsInteger32()) {
5026 ASSERT(instr->hydrogen()->store_mode() == STORE_TO_INITIALIZED_ENTRY);
5027 __ Store(value, UntagSmiFieldMemOperand(destination, offset),
5028 Representation::Integer32());
5029 } else {
5030 __ Store(value, FieldMemOperand(destination, offset), representation);
5031 }
5007 if (instr->hydrogen()->NeedsWriteBarrier()) { 5032 if (instr->hydrogen()->NeedsWriteBarrier()) {
5008 __ RecordWriteField(destination, 5033 __ RecordWriteField(destination,
5009 offset, 5034 offset,
5010 value, // Clobbered. 5035 value, // Clobbered.
5011 temp1, // Clobbered. 5036 temp1, // Clobbered.
5012 GetLinkRegisterState(), 5037 GetLinkRegisterState(),
5013 kSaveFPRegs, 5038 kSaveFPRegs,
5014 EMIT_REMEMBERED_SET, 5039 EMIT_REMEMBERED_SET,
5015 check_needed); 5040 check_needed);
5016 } 5041 }
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
5629 __ Bind(&out_of_object); 5654 __ Bind(&out_of_object);
5630 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5655 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
5631 // Index is equal to negated out of object property index plus 1. 5656 // Index is equal to negated out of object property index plus 1.
5632 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5657 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5633 __ Ldr(result, FieldMemOperand(result, 5658 __ Ldr(result, FieldMemOperand(result,
5634 FixedArray::kHeaderSize - kPointerSize)); 5659 FixedArray::kHeaderSize - kPointerSize));
5635 __ Bind(&done); 5660 __ Bind(&done);
5636 } 5661 }
5637 5662
5638 } } // namespace v8::internal 5663 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/a64/lithium-a64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698