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 3255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3266 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 3266 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
3267 HObjectAccess access = instr->hydrogen()->access(); | 3267 HObjectAccess access = instr->hydrogen()->access(); |
3268 int offset = access.offset(); | 3268 int offset = access.offset(); |
3269 | 3269 |
3270 if (access.IsExternalMemory()) { | 3270 if (access.IsExternalMemory()) { |
3271 Register result = ToRegister(instr->result()); | 3271 Register result = ToRegister(instr->result()); |
3272 MemOperand operand = instr->object()->IsConstantOperand() | 3272 MemOperand operand = instr->object()->IsConstantOperand() |
3273 ? MemOperand::StaticVariable(ToExternalReference( | 3273 ? MemOperand::StaticVariable(ToExternalReference( |
3274 LConstantOperand::cast(instr->object()))) | 3274 LConstantOperand::cast(instr->object()))) |
3275 : MemOperand(ToRegister(instr->object()), offset); | 3275 : MemOperand(ToRegister(instr->object()), offset); |
3276 __ Load(result, operand, access.representation()); | 3276 if (access.representation().IsByte()) { |
| 3277 ASSERT(instr->hydrogen()->representation().IsInteger32()); |
| 3278 __ movzx_b(result, operand); |
| 3279 } else { |
| 3280 __ mov(result, operand); |
| 3281 } |
3277 return; | 3282 return; |
3278 } | 3283 } |
3279 | 3284 |
3280 Register object = ToRegister(instr->object()); | 3285 Register object = ToRegister(instr->object()); |
3281 if (FLAG_track_double_fields && | 3286 if (FLAG_track_double_fields && |
3282 instr->hydrogen()->representation().IsDouble()) { | 3287 instr->hydrogen()->representation().IsDouble()) { |
3283 if (CpuFeatures::IsSupported(SSE2)) { | 3288 if (CpuFeatures::IsSupported(SSE2)) { |
3284 CpuFeatureScope scope(masm(), SSE2); | 3289 CpuFeatureScope scope(masm(), SSE2); |
3285 XMMRegister result = ToDoubleRegister(instr->result()); | 3290 XMMRegister result = ToDoubleRegister(instr->result()); |
3286 __ movsd(result, FieldOperand(object, offset)); | 3291 __ movsd(result, FieldOperand(object, offset)); |
3287 } else { | 3292 } else { |
3288 X87Mov(ToX87Register(instr->result()), FieldOperand(object, offset)); | 3293 X87Mov(ToX87Register(instr->result()), FieldOperand(object, offset)); |
3289 } | 3294 } |
3290 return; | 3295 return; |
3291 } | 3296 } |
3292 | 3297 |
3293 Register result = ToRegister(instr->result()); | 3298 Register result = ToRegister(instr->result()); |
3294 if (!access.IsInobject()) { | 3299 if (!access.IsInobject()) { |
3295 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 3300 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); |
3296 object = result; | 3301 object = result; |
3297 } | 3302 } |
3298 __ Load(result, FieldOperand(object, offset), access.representation()); | 3303 if (access.representation().IsByte()) { |
| 3304 ASSERT(instr->hydrogen()->representation().IsInteger32()); |
| 3305 __ movzx_b(result, FieldOperand(object, offset)); |
| 3306 } else { |
| 3307 __ mov(result, FieldOperand(object, offset)); |
| 3308 } |
3299 } | 3309 } |
3300 | 3310 |
3301 | 3311 |
3302 void LCodeGen::EmitPushTaggedOperand(LOperand* operand) { | 3312 void LCodeGen::EmitPushTaggedOperand(LOperand* operand) { |
3303 ASSERT(!operand->IsDoubleRegister()); | 3313 ASSERT(!operand->IsDoubleRegister()); |
3304 if (operand->IsConstantOperand()) { | 3314 if (operand->IsConstantOperand()) { |
3305 Handle<Object> object = ToHandle(LConstantOperand::cast(operand)); | 3315 Handle<Object> object = ToHandle(LConstantOperand::cast(operand)); |
3306 AllowDeferredHandleDereference smi_check; | 3316 AllowDeferredHandleDereference smi_check; |
3307 if (object->IsSmi()) { | 3317 if (object->IsSmi()) { |
3308 __ Push(Handle<Smi>::cast(object)); | 3318 __ Push(Handle<Smi>::cast(object)); |
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4461 HObjectAccess access = instr->hydrogen()->access(); | 4471 HObjectAccess access = instr->hydrogen()->access(); |
4462 int offset = access.offset(); | 4472 int offset = access.offset(); |
4463 | 4473 |
4464 if (access.IsExternalMemory()) { | 4474 if (access.IsExternalMemory()) { |
4465 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4475 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4466 MemOperand operand = instr->object()->IsConstantOperand() | 4476 MemOperand operand = instr->object()->IsConstantOperand() |
4467 ? MemOperand::StaticVariable( | 4477 ? MemOperand::StaticVariable( |
4468 ToExternalReference(LConstantOperand::cast(instr->object()))) | 4478 ToExternalReference(LConstantOperand::cast(instr->object()))) |
4469 : MemOperand(ToRegister(instr->object()), offset); | 4479 : MemOperand(ToRegister(instr->object()), offset); |
4470 if (instr->value()->IsConstantOperand()) { | 4480 if (instr->value()->IsConstantOperand()) { |
| 4481 ASSERT(!representation.IsByte()); |
4471 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 4482 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
4472 __ mov(operand, Immediate(ToInteger32(operand_value))); | 4483 __ mov(operand, Immediate(ToInteger32(operand_value))); |
4473 } else { | 4484 } else { |
4474 Register value = ToRegister(instr->value()); | 4485 Register value = ToRegister(instr->value()); |
4475 __ Store(value, operand, representation); | 4486 if (representation.IsByte()) { |
| 4487 __ mov_b(operand, value); |
| 4488 } else { |
| 4489 __ mov(operand, value); |
| 4490 } |
4476 } | 4491 } |
4477 return; | 4492 return; |
4478 } | 4493 } |
4479 | 4494 |
4480 Register object = ToRegister(instr->object()); | 4495 Register object = ToRegister(instr->object()); |
4481 Handle<Map> transition = instr->transition(); | 4496 Handle<Map> transition = instr->transition(); |
4482 | 4497 |
4483 if (FLAG_track_fields && representation.IsSmi()) { | 4498 if (FLAG_track_fields && representation.IsSmi()) { |
4484 if (instr->value()->IsConstantOperand()) { | 4499 if (instr->value()->IsConstantOperand()) { |
4485 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 4500 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4543 if (!access.IsInobject()) { | 4558 if (!access.IsInobject()) { |
4544 write_register = ToRegister(instr->temp()); | 4559 write_register = ToRegister(instr->temp()); |
4545 __ mov(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); | 4560 __ mov(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); |
4546 } | 4561 } |
4547 | 4562 |
4548 MemOperand operand = FieldOperand(write_register, offset); | 4563 MemOperand operand = FieldOperand(write_register, offset); |
4549 if (instr->value()->IsConstantOperand()) { | 4564 if (instr->value()->IsConstantOperand()) { |
4550 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 4565 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
4551 if (operand_value->IsRegister()) { | 4566 if (operand_value->IsRegister()) { |
4552 Register value = ToRegister(operand_value); | 4567 Register value = ToRegister(operand_value); |
4553 __ Store(value, operand, representation); | 4568 if (representation.IsByte()) { |
| 4569 __ mov_b(operand, value); |
| 4570 } else { |
| 4571 __ mov(operand, value); |
| 4572 } |
4554 } else { | 4573 } else { |
4555 Handle<Object> handle_value = ToHandle(operand_value); | 4574 Handle<Object> handle_value = ToHandle(operand_value); |
4556 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4575 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4557 __ mov(operand, handle_value); | 4576 __ mov(operand, handle_value); |
4558 } | 4577 } |
4559 } else { | 4578 } else { |
4560 Register value = ToRegister(instr->value()); | 4579 Register value = ToRegister(instr->value()); |
4561 __ Store(value, operand, representation); | 4580 if (representation.IsByte()) { |
| 4581 __ mov_b(operand, value); |
| 4582 } else { |
| 4583 __ mov(operand, value); |
| 4584 } |
4562 } | 4585 } |
4563 | 4586 |
4564 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4587 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4565 Register value = ToRegister(instr->value()); | 4588 Register value = ToRegister(instr->value()); |
4566 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; | 4589 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; |
4567 // Update the write barrier for the object for in-object properties. | 4590 // Update the write barrier for the object for in-object properties. |
4568 __ RecordWriteField(write_register, | 4591 __ RecordWriteField(write_register, |
4569 offset, | 4592 offset, |
4570 value, | 4593 value, |
4571 temp, | 4594 temp, |
(...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6431 FixedArray::kHeaderSize - kPointerSize)); | 6454 FixedArray::kHeaderSize - kPointerSize)); |
6432 __ bind(&done); | 6455 __ bind(&done); |
6433 } | 6456 } |
6434 | 6457 |
6435 | 6458 |
6436 #undef __ | 6459 #undef __ |
6437 | 6460 |
6438 } } // namespace v8::internal | 6461 } } // namespace v8::internal |
6439 | 6462 |
6440 #endif // V8_TARGET_ARCH_IA32 | 6463 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |