OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4044 int offset = access.offset(); | 4044 int offset = access.offset(); |
4045 | 4045 |
4046 if (access.IsExternalMemory()) { | 4046 if (access.IsExternalMemory()) { |
4047 Register value = ToRegister(instr->value()); | 4047 Register value = ToRegister(instr->value()); |
4048 MemOperand operand = MemOperand(object, offset); | 4048 MemOperand operand = MemOperand(object, offset); |
4049 __ Store(value, operand, representation); | 4049 __ Store(value, operand, representation); |
4050 return; | 4050 return; |
4051 } | 4051 } |
4052 | 4052 |
4053 Handle<Map> transition = instr->transition(); | 4053 Handle<Map> transition = instr->transition(); |
| 4054 SmiCheck check_needed = |
| 4055 instr->hydrogen()->value()->IsHeapObject() |
| 4056 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
4054 | 4057 |
4055 if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { | 4058 if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { |
4056 Register value = ToRegister(instr->value()); | 4059 Register value = ToRegister(instr->value()); |
4057 if (!instr->hydrogen()->value()->type().IsHeapObject()) { | 4060 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
4058 __ SmiTst(value); | 4061 __ SmiTst(value); |
4059 DeoptimizeIf(eq, instr->environment()); | 4062 DeoptimizeIf(eq, instr->environment()); |
| 4063 |
| 4064 // We know that value is a smi now, so we can omit the check below. |
| 4065 check_needed = OMIT_SMI_CHECK; |
4060 } | 4066 } |
4061 } else if (representation.IsDouble()) { | 4067 } else if (representation.IsDouble()) { |
4062 ASSERT(transition.is_null()); | 4068 ASSERT(transition.is_null()); |
4063 ASSERT(access.IsInobject()); | 4069 ASSERT(access.IsInobject()); |
4064 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4070 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4065 DwVfpRegister value = ToDoubleRegister(instr->value()); | 4071 DwVfpRegister value = ToDoubleRegister(instr->value()); |
4066 __ vstr(value, FieldMemOperand(object, offset)); | 4072 __ vstr(value, FieldMemOperand(object, offset)); |
4067 return; | 4073 return; |
4068 } | 4074 } |
4069 | 4075 |
4070 if (!transition.is_null()) { | 4076 if (!transition.is_null()) { |
4071 __ mov(scratch, Operand(transition)); | 4077 __ mov(scratch, Operand(transition)); |
4072 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 4078 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
4073 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { | 4079 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { |
4074 Register temp = ToRegister(instr->temp()); | 4080 Register temp = ToRegister(instr->temp()); |
4075 // Update the write barrier for the map field. | 4081 // Update the write barrier for the map field. |
4076 __ RecordWriteField(object, | 4082 __ RecordWriteField(object, |
4077 HeapObject::kMapOffset, | 4083 HeapObject::kMapOffset, |
4078 scratch, | 4084 scratch, |
4079 temp, | 4085 temp, |
4080 GetLinkRegisterState(), | 4086 GetLinkRegisterState(), |
4081 kSaveFPRegs, | 4087 kSaveFPRegs, |
4082 OMIT_REMEMBERED_SET, | 4088 OMIT_REMEMBERED_SET, |
4083 OMIT_SMI_CHECK); | 4089 OMIT_SMI_CHECK); |
4084 } | 4090 } |
4085 } | 4091 } |
4086 | 4092 |
4087 // Do the store. | 4093 // Do the store. |
4088 Register value = ToRegister(instr->value()); | 4094 Register value = ToRegister(instr->value()); |
4089 SmiCheck check_needed = | |
4090 instr->hydrogen()->value()->IsHeapObject() | |
4091 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | |
4092 if (access.IsInobject()) { | 4095 if (access.IsInobject()) { |
4093 MemOperand operand = FieldMemOperand(object, offset); | 4096 MemOperand operand = FieldMemOperand(object, offset); |
4094 __ Store(value, operand, representation); | 4097 __ Store(value, operand, representation); |
4095 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4098 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4096 // Update the write barrier for the object for in-object properties. | 4099 // Update the write barrier for the object for in-object properties. |
4097 __ RecordWriteField(object, | 4100 __ RecordWriteField(object, |
4098 offset, | 4101 offset, |
4099 value, | 4102 value, |
4100 scratch, | 4103 scratch, |
4101 GetLinkRegisterState(), | 4104 GetLinkRegisterState(), |
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5739 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5742 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5740 __ ldr(result, FieldMemOperand(scratch, | 5743 __ ldr(result, FieldMemOperand(scratch, |
5741 FixedArray::kHeaderSize - kPointerSize)); | 5744 FixedArray::kHeaderSize - kPointerSize)); |
5742 __ bind(&done); | 5745 __ bind(&done); |
5743 } | 5746 } |
5744 | 5747 |
5745 | 5748 |
5746 #undef __ | 5749 #undef __ |
5747 | 5750 |
5748 } } // namespace v8::internal | 5751 } } // namespace v8::internal |
OLD | NEW |