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

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

Issue 148453015: A64: Fix access width in (Load|Store)NamedField. (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 | « no previous file | 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 3502 matching lines...) Expand 10 before | Expand all | Expand 10 after
3513 Register result = ToRegister(instr->result()); 3513 Register result = ToRegister(instr->result());
3514 __ Ldr(result, MemOperand(object, offset)); 3514 __ Ldr(result, MemOperand(object, offset));
3515 return; 3515 return;
3516 } 3516 }
3517 3517
3518 if (instr->hydrogen()->representation().IsDouble()) { 3518 if (instr->hydrogen()->representation().IsDouble()) {
3519 FPRegister result = ToDoubleRegister(instr->result()); 3519 FPRegister result = ToDoubleRegister(instr->result());
3520 __ Ldr(result, FieldMemOperand(object, offset)); 3520 __ Ldr(result, FieldMemOperand(object, offset));
3521 } else { 3521 } else {
3522 Register result = ToRegister(instr->result()); 3522 Register result = ToRegister(instr->result());
3523 Register src = no_reg;
3523 if (access.IsInobject()) { 3524 if (access.IsInobject()) {
3524 __ Ldr(result, FieldMemOperand(object, offset)); 3525 src = object;
3525 } else { 3526 } else {
3526 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 3527 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
3527 __ Ldr(result, FieldMemOperand(result, offset)); 3528 src = result;
3529 }
3530 if (access.representation().IsInteger32()) {
3531 __ Ldr(result.W(), FieldMemOperand(src, offset));
3532 } else {
3533 __ Ldr(result, FieldMemOperand(src, offset));
3528 } 3534 }
3529 } 3535 }
3530 } 3536 }
3531 3537
3532 3538
3533 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 3539 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
3534 // LoadIC expects x2 to hold the name, and x0 to hold the receiver. 3540 // LoadIC expects x2 to hold the name, and x0 to hold the receiver.
3535 ASSERT(ToRegister(instr->object()).is(x0)); 3541 ASSERT(ToRegister(instr->object()).is(x0));
3536 __ Mov(x2, Operand(instr->name())); 3542 __ Mov(x2, Operand(instr->name()));
3537 3543
(...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after
4980 temp1, 4986 temp1,
4981 GetLinkRegisterState(), 4987 GetLinkRegisterState(),
4982 kSaveFPRegs, 4988 kSaveFPRegs,
4983 OMIT_REMEMBERED_SET, 4989 OMIT_REMEMBERED_SET,
4984 OMIT_SMI_CHECK); 4990 OMIT_SMI_CHECK);
4985 } 4991 }
4986 } 4992 }
4987 4993
4988 // Do the store. 4994 // Do the store.
4989 Register value = ToRegister(instr->value()); 4995 Register value = ToRegister(instr->value());
4996 Register dst = no_reg;
4990 SmiCheck check_needed = 4997 SmiCheck check_needed =
4991 instr->hydrogen()->value()->IsHeapObject() 4998 instr->hydrogen()->value()->IsHeapObject()
4992 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4999 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4993 if (access.IsInobject()) { 5000 if (access.IsInobject()) {
4994 __ Str(value, FieldMemOperand(object, offset)); 5001 dst = object;
4995 if (instr->hydrogen()->NeedsWriteBarrier()) {
4996 // Update the write barrier for the object for in-object properties.
4997 __ RecordWriteField(object,
4998 offset,
4999 value, // Clobbered.
5000 temp0, // Clobbered.
5001 GetLinkRegisterState(),
5002 kSaveFPRegs,
5003 EMIT_REMEMBERED_SET,
5004 check_needed);
5005 }
5006 } else { 5002 } else {
5007 __ Ldr(temp0, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5003 __ Ldr(temp0, FieldMemOperand(object, JSObject::kPropertiesOffset));
5008 __ Str(value, FieldMemOperand(temp0, offset)); 5004 dst = temp0;
5009 if (instr->hydrogen()->NeedsWriteBarrier()) { 5005 }
5010 // Update the write barrier for the properties array. 5006 if (access.representation().IsInteger32()) {
5011 __ RecordWriteField(temp0, 5007 __ Str(value.W(), FieldMemOperand(dst, offset));
5012 offset, 5008 } else {
5013 value, // Clobbered. 5009 __ Str(value, FieldMemOperand(dst, offset));
5014 temp1, // Clobbered. 5010 }
5015 GetLinkRegisterState(), 5011 if (instr->hydrogen()->NeedsWriteBarrier()) {
5016 kSaveFPRegs, 5012 __ RecordWriteField(dst,
5017 EMIT_REMEMBERED_SET, 5013 offset,
5018 check_needed); 5014 value, // Clobbered.
5019 } 5015 temp1, // Clobbered.
5016 GetLinkRegisterState(),
5017 kSaveFPRegs,
5018 EMIT_REMEMBERED_SET,
5019 check_needed);
5020 } 5020 }
5021 } 5021 }
5022 5022
5023 5023
5024 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 5024 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
5025 ASSERT(ToRegister(instr->value()).is(x0)); 5025 ASSERT(ToRegister(instr->value()).is(x0));
5026 ASSERT(ToRegister(instr->object()).is(x1)); 5026 ASSERT(ToRegister(instr->object()).is(x1));
5027 5027
5028 // Name must be in x2. 5028 // Name must be in x2.
5029 __ Mov(x2, Operand(instr->name())); 5029 __ Mov(x2, Operand(instr->name()));
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
5597 __ Bind(&out_of_object); 5597 __ Bind(&out_of_object);
5598 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5598 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
5599 // Index is equal to negated out of object property index plus 1. 5599 // Index is equal to negated out of object property index plus 1.
5600 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5600 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5601 __ Ldr(result, FieldMemOperand(result, 5601 __ Ldr(result, FieldMemOperand(result,
5602 FixedArray::kHeaderSize - kPointerSize)); 5602 FixedArray::kHeaderSize - kPointerSize));
5603 __ Bind(&done); 5603 __ Bind(&done);
5604 } 5604 }
5605 5605
5606 } } // namespace v8::internal 5606 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698