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 3062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3073 | 3073 |
3074 | 3074 |
3075 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 3075 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
3076 HObjectAccess access = instr->hydrogen()->access(); | 3076 HObjectAccess access = instr->hydrogen()->access(); |
3077 int offset = access.offset(); | 3077 int offset = access.offset(); |
3078 Register object = ToRegister(instr->object()); | 3078 Register object = ToRegister(instr->object()); |
3079 | 3079 |
3080 if (access.IsExternalMemory()) { | 3080 if (access.IsExternalMemory()) { |
3081 Register result = ToRegister(instr->result()); | 3081 Register result = ToRegister(instr->result()); |
3082 MemOperand operand = MemOperand(object, offset); | 3082 MemOperand operand = MemOperand(object, offset); |
3083 if (access.representation().IsByte()) { | 3083 __ Load(result, operand, access.representation()); |
3084 __ ldrb(result, operand); | |
3085 } else { | |
3086 __ ldr(result, operand); | |
3087 } | |
3088 return; | 3084 return; |
3089 } | 3085 } |
3090 | 3086 |
3091 if (instr->hydrogen()->representation().IsDouble()) { | 3087 if (instr->hydrogen()->representation().IsDouble()) { |
3092 DwVfpRegister result = ToDoubleRegister(instr->result()); | 3088 DwVfpRegister result = ToDoubleRegister(instr->result()); |
3093 __ vldr(result, FieldMemOperand(object, offset)); | 3089 __ vldr(result, FieldMemOperand(object, offset)); |
3094 return; | 3090 return; |
3095 } | 3091 } |
3096 | 3092 |
3097 Register result = ToRegister(instr->result()); | 3093 Register result = ToRegister(instr->result()); |
3098 if (!access.IsInobject()) { | 3094 if (!access.IsInobject()) { |
3099 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 3095 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
3100 object = result; | 3096 object = result; |
3101 } | 3097 } |
3102 MemOperand operand = FieldMemOperand(object, offset); | 3098 MemOperand operand = FieldMemOperand(object, offset); |
3103 if (access.representation().IsByte()) { | 3099 __ Load(result, operand, access.representation()); |
3104 __ ldrb(result, operand); | |
3105 } else { | |
3106 __ ldr(result, operand); | |
3107 } | |
3108 } | 3100 } |
3109 | 3101 |
3110 | 3102 |
3111 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3103 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3112 ASSERT(ToRegister(instr->context()).is(cp)); | 3104 ASSERT(ToRegister(instr->context()).is(cp)); |
3113 ASSERT(ToRegister(instr->object()).is(r0)); | 3105 ASSERT(ToRegister(instr->object()).is(r0)); |
3114 ASSERT(ToRegister(instr->result()).is(r0)); | 3106 ASSERT(ToRegister(instr->result()).is(r0)); |
3115 | 3107 |
3116 // Name is always in r2. | 3108 // Name is always in r2. |
3117 __ mov(r2, Operand(instr->name())); | 3109 __ mov(r2, Operand(instr->name())); |
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4200 Representation representation = instr->representation(); | 4192 Representation representation = instr->representation(); |
4201 | 4193 |
4202 Register object = ToRegister(instr->object()); | 4194 Register object = ToRegister(instr->object()); |
4203 Register scratch = scratch0(); | 4195 Register scratch = scratch0(); |
4204 HObjectAccess access = instr->hydrogen()->access(); | 4196 HObjectAccess access = instr->hydrogen()->access(); |
4205 int offset = access.offset(); | 4197 int offset = access.offset(); |
4206 | 4198 |
4207 if (access.IsExternalMemory()) { | 4199 if (access.IsExternalMemory()) { |
4208 Register value = ToRegister(instr->value()); | 4200 Register value = ToRegister(instr->value()); |
4209 MemOperand operand = MemOperand(object, offset); | 4201 MemOperand operand = MemOperand(object, offset); |
4210 if (representation.IsByte()) { | 4202 __ Store(value, operand, representation); |
4211 __ strb(value, operand); | |
4212 } else { | |
4213 __ str(value, operand); | |
4214 } | |
4215 return; | 4203 return; |
4216 } | 4204 } |
4217 | 4205 |
4218 Handle<Map> transition = instr->transition(); | 4206 Handle<Map> transition = instr->transition(); |
4219 | 4207 |
4220 if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { | 4208 if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { |
4221 Register value = ToRegister(instr->value()); | 4209 Register value = ToRegister(instr->value()); |
4222 if (!instr->hydrogen()->value()->type().IsHeapObject()) { | 4210 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
4223 __ SmiTst(value); | 4211 __ SmiTst(value); |
4224 DeoptimizeIf(eq, instr->environment()); | 4212 DeoptimizeIf(eq, instr->environment()); |
(...skipping 25 matching lines...) Expand all Loading... |
4250 } | 4238 } |
4251 | 4239 |
4252 // Do the store. | 4240 // Do the store. |
4253 Register value = ToRegister(instr->value()); | 4241 Register value = ToRegister(instr->value()); |
4254 ASSERT(!object.is(value)); | 4242 ASSERT(!object.is(value)); |
4255 SmiCheck check_needed = | 4243 SmiCheck check_needed = |
4256 instr->hydrogen()->value()->IsHeapObject() | 4244 instr->hydrogen()->value()->IsHeapObject() |
4257 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 4245 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
4258 if (access.IsInobject()) { | 4246 if (access.IsInobject()) { |
4259 MemOperand operand = FieldMemOperand(object, offset); | 4247 MemOperand operand = FieldMemOperand(object, offset); |
4260 if (representation.IsByte()) { | 4248 __ Store(value, operand, representation); |
4261 __ strb(value, operand); | |
4262 } else { | |
4263 __ str(value, operand); | |
4264 } | |
4265 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4249 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4266 // Update the write barrier for the object for in-object properties. | 4250 // Update the write barrier for the object for in-object properties. |
4267 __ RecordWriteField(object, | 4251 __ RecordWriteField(object, |
4268 offset, | 4252 offset, |
4269 value, | 4253 value, |
4270 scratch, | 4254 scratch, |
4271 GetLinkRegisterState(), | 4255 GetLinkRegisterState(), |
4272 kSaveFPRegs, | 4256 kSaveFPRegs, |
4273 EMIT_REMEMBERED_SET, | 4257 EMIT_REMEMBERED_SET, |
4274 check_needed); | 4258 check_needed); |
4275 } | 4259 } |
4276 } else { | 4260 } else { |
4277 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 4261 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
4278 MemOperand operand = FieldMemOperand(scratch, offset); | 4262 MemOperand operand = FieldMemOperand(scratch, offset); |
4279 if (representation.IsByte()) { | 4263 __ Store(value, operand, representation); |
4280 __ strb(value, operand); | |
4281 } else { | |
4282 __ str(value, operand); | |
4283 } | |
4284 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4264 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4285 // Update the write barrier for the properties array. | 4265 // Update the write barrier for the properties array. |
4286 // object is used as a scratch register. | 4266 // object is used as a scratch register. |
4287 __ RecordWriteField(scratch, | 4267 __ RecordWriteField(scratch, |
4288 offset, | 4268 offset, |
4289 value, | 4269 value, |
4290 object, | 4270 object, |
4291 GetLinkRegisterState(), | 4271 GetLinkRegisterState(), |
4292 kSaveFPRegs, | 4272 kSaveFPRegs, |
4293 EMIT_REMEMBERED_SET, | 4273 EMIT_REMEMBERED_SET, |
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5895 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5875 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5896 __ ldr(result, FieldMemOperand(scratch, | 5876 __ ldr(result, FieldMemOperand(scratch, |
5897 FixedArray::kHeaderSize - kPointerSize)); | 5877 FixedArray::kHeaderSize - kPointerSize)); |
5898 __ bind(&done); | 5878 __ bind(&done); |
5899 } | 5879 } |
5900 | 5880 |
5901 | 5881 |
5902 #undef __ | 5882 #undef __ |
5903 | 5883 |
5904 } } // namespace v8::internal | 5884 } } // namespace v8::internal |
OLD | NEW |