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 2949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2960 GetSaveFPRegsMode(), | 2960 GetSaveFPRegsMode(), |
2961 EMIT_REMEMBERED_SET, | 2961 EMIT_REMEMBERED_SET, |
2962 check_needed); | 2962 check_needed); |
2963 } | 2963 } |
2964 | 2964 |
2965 __ bind(&skip_assignment); | 2965 __ bind(&skip_assignment); |
2966 } | 2966 } |
2967 | 2967 |
2968 | 2968 |
2969 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2969 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
2970 int offset = instr->hydrogen()->offset(); | 2970 HObjectAccess access = instr->hydrogen()->access(); |
| 2971 int offset = access.offset(); |
2971 Register object = ToRegister(instr->object()); | 2972 Register object = ToRegister(instr->object()); |
2972 if (FLAG_track_double_fields && | 2973 if (FLAG_track_double_fields && |
2973 instr->hydrogen()->representation().IsDouble()) { | 2974 instr->hydrogen()->representation().IsDouble()) { |
2974 if (CpuFeatures::IsSupported(SSE2)) { | 2975 if (CpuFeatures::IsSupported(SSE2)) { |
2975 CpuFeatureScope scope(masm(), SSE2); | 2976 CpuFeatureScope scope(masm(), SSE2); |
2976 XMMRegister result = ToDoubleRegister(instr->result()); | 2977 XMMRegister result = ToDoubleRegister(instr->result()); |
2977 __ movdbl(result, FieldOperand(object, offset)); | 2978 __ movdbl(result, FieldOperand(object, offset)); |
2978 } else { | 2979 } else { |
2979 PushX87DoubleOperand(FieldOperand(object, offset)); | 2980 PushX87DoubleOperand(FieldOperand(object, offset)); |
2980 CurrentInstructionReturnsX87Result(); | 2981 CurrentInstructionReturnsX87Result(); |
2981 } | 2982 } |
2982 return; | 2983 return; |
2983 } | 2984 } |
2984 | 2985 |
2985 Register result = ToRegister(instr->result()); | 2986 Register result = ToRegister(instr->result()); |
2986 if (instr->hydrogen()->is_in_object()) { | 2987 if (access.IsInobject()) { |
2987 __ mov(result, FieldOperand(object, offset)); | 2988 __ mov(result, FieldOperand(object, offset)); |
2988 } else { | 2989 } else { |
2989 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 2990 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); |
2990 __ mov(result, FieldOperand(result, offset)); | 2991 __ mov(result, FieldOperand(result, offset)); |
2991 } | 2992 } |
2992 } | 2993 } |
2993 | 2994 |
2994 | 2995 |
2995 void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, | 2996 void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, |
2996 Register object, | 2997 Register object, |
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4232 Register result = ToRegister(instr->result()); | 4233 Register result = ToRegister(instr->result()); |
4233 Register base = ToRegister(instr->base_object()); | 4234 Register base = ToRegister(instr->base_object()); |
4234 __ lea(result, Operand(base, instr->offset())); | 4235 __ lea(result, Operand(base, instr->offset())); |
4235 } | 4236 } |
4236 | 4237 |
4237 | 4238 |
4238 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { | 4239 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
4239 Representation representation = instr->representation(); | 4240 Representation representation = instr->representation(); |
4240 | 4241 |
4241 Register object = ToRegister(instr->object()); | 4242 Register object = ToRegister(instr->object()); |
4242 | 4243 HObjectAccess access = instr->hydrogen()->access(); |
4243 int offset = instr->offset(); | 4244 int offset = access.offset(); |
4244 | 4245 |
4245 Handle<Map> transition = instr->transition(); | 4246 Handle<Map> transition = instr->transition(); |
4246 | 4247 |
4247 if (FLAG_track_fields && representation.IsSmi()) { | 4248 if (FLAG_track_fields && representation.IsSmi()) { |
4248 if (instr->value()->IsConstantOperand()) { | 4249 if (instr->value()->IsConstantOperand()) { |
4249 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 4250 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
4250 if (!IsSmi(operand_value)) { | 4251 if (!IsSmi(operand_value)) { |
4251 DeoptimizeIf(no_condition, instr->environment()); | 4252 DeoptimizeIf(no_condition, instr->environment()); |
4252 } | 4253 } |
4253 } | 4254 } |
4254 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { | 4255 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { |
4255 if (instr->value()->IsConstantOperand()) { | 4256 if (instr->value()->IsConstantOperand()) { |
4256 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 4257 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
4257 if (IsInteger32(operand_value)) { | 4258 if (IsInteger32(operand_value)) { |
4258 DeoptimizeIf(no_condition, instr->environment()); | 4259 DeoptimizeIf(no_condition, instr->environment()); |
4259 } | 4260 } |
4260 } else { | 4261 } else { |
4261 if (!instr->hydrogen()->value()->type().IsHeapObject()) { | 4262 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
4262 Register value = ToRegister(instr->value()); | 4263 Register value = ToRegister(instr->value()); |
4263 __ test(value, Immediate(kSmiTagMask)); | 4264 __ test(value, Immediate(kSmiTagMask)); |
4264 DeoptimizeIf(zero, instr->environment()); | 4265 DeoptimizeIf(zero, instr->environment()); |
4265 } | 4266 } |
4266 } | 4267 } |
4267 } else if (FLAG_track_double_fields && representation.IsDouble()) { | 4268 } else if (FLAG_track_double_fields && representation.IsDouble()) { |
4268 ASSERT(transition.is_null()); | 4269 ASSERT(transition.is_null()); |
4269 ASSERT(instr->is_in_object()); | 4270 ASSERT(access.IsInobject()); |
4270 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4271 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4271 if (CpuFeatures::IsSupported(SSE2)) { | 4272 if (CpuFeatures::IsSupported(SSE2)) { |
4272 CpuFeatureScope scope(masm(), SSE2); | 4273 CpuFeatureScope scope(masm(), SSE2); |
4273 XMMRegister value = ToDoubleRegister(instr->value()); | 4274 XMMRegister value = ToDoubleRegister(instr->value()); |
4274 __ movdbl(FieldOperand(object, offset), value); | 4275 __ movdbl(FieldOperand(object, offset), value); |
4275 } else { | 4276 } else { |
4276 __ fstp_d(FieldOperand(object, offset)); | 4277 __ fstp_d(FieldOperand(object, offset)); |
4277 } | 4278 } |
4278 return; | 4279 return; |
4279 } | 4280 } |
(...skipping 19 matching lines...) Expand all Loading... |
4299 OMIT_SMI_CHECK); | 4300 OMIT_SMI_CHECK); |
4300 } | 4301 } |
4301 } | 4302 } |
4302 | 4303 |
4303 // Do the store. | 4304 // Do the store. |
4304 HType type = instr->hydrogen()->value()->type(); | 4305 HType type = instr->hydrogen()->value()->type(); |
4305 SmiCheck check_needed = | 4306 SmiCheck check_needed = |
4306 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 4307 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
4307 | 4308 |
4308 Register write_register = object; | 4309 Register write_register = object; |
4309 if (!instr->is_in_object()) { | 4310 if (!access.IsInobject()) { |
4310 write_register = ToRegister(instr->temp()); | 4311 write_register = ToRegister(instr->temp()); |
4311 __ mov(write_register, | 4312 __ mov(write_register, |
4312 FieldOperand(object, JSObject::kPropertiesOffset)); | 4313 FieldOperand(object, JSObject::kPropertiesOffset)); |
4313 } | 4314 } |
4314 | 4315 |
4315 if (instr->value()->IsConstantOperand()) { | 4316 if (instr->value()->IsConstantOperand()) { |
4316 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 4317 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
4317 if (operand_value->IsRegister()) { | 4318 if (operand_value->IsRegister()) { |
4318 __ mov(FieldOperand(write_register, offset), ToRegister(operand_value)); | 4319 __ mov(FieldOperand(write_register, offset), ToRegister(operand_value)); |
4319 } else { | 4320 } else { |
4320 Handle<Object> handle_value = ToHandle(operand_value); | 4321 Handle<Object> handle_value = ToHandle(operand_value); |
4321 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4322 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4322 __ mov(FieldOperand(write_register, offset), handle_value); | 4323 __ mov(FieldOperand(write_register, offset), handle_value); |
4323 } | 4324 } |
4324 } else { | 4325 } else { |
4325 __ mov(FieldOperand(write_register, offset), ToRegister(instr->value())); | 4326 __ mov(FieldOperand(write_register, offset), ToRegister(instr->value())); |
4326 } | 4327 } |
4327 | 4328 |
4328 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4329 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4329 Register value = ToRegister(instr->value()); | 4330 Register value = ToRegister(instr->value()); |
4330 Register temp = instr->is_in_object() ? ToRegister(instr->temp()) : object; | 4331 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; |
4331 // Update the write barrier for the object for in-object properties. | 4332 // Update the write barrier for the object for in-object properties. |
4332 __ RecordWriteField(write_register, | 4333 __ RecordWriteField(write_register, |
4333 offset, | 4334 offset, |
4334 value, | 4335 value, |
4335 temp, | 4336 temp, |
4336 GetSaveFPRegsMode(), | 4337 GetSaveFPRegsMode(), |
4337 EMIT_REMEMBERED_SET, | 4338 EMIT_REMEMBERED_SET, |
4338 check_needed); | 4339 check_needed); |
4339 } | 4340 } |
4340 } | 4341 } |
(...skipping 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6594 FixedArray::kHeaderSize - kPointerSize)); | 6595 FixedArray::kHeaderSize - kPointerSize)); |
6595 __ bind(&done); | 6596 __ bind(&done); |
6596 } | 6597 } |
6597 | 6598 |
6598 | 6599 |
6599 #undef __ | 6600 #undef __ |
6600 | 6601 |
6601 } } // namespace v8::internal | 6602 } } // namespace v8::internal |
6602 | 6603 |
6603 #endif // V8_TARGET_ARCH_IA32 | 6604 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |