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 4697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4708 if (is_simple_map_transition) { | 4708 if (is_simple_map_transition) { |
4709 Register new_map_reg = ToRegister(instr->new_map_temp()); | 4709 Register new_map_reg = ToRegister(instr->new_map_temp()); |
4710 Handle<Map> map = instr->hydrogen()->transitioned_map(); | 4710 Handle<Map> map = instr->hydrogen()->transitioned_map(); |
4711 __ mov(FieldOperand(object_reg, HeapObject::kMapOffset), | 4711 __ mov(FieldOperand(object_reg, HeapObject::kMapOffset), |
4712 Immediate(map)); | 4712 Immediate(map)); |
4713 // Write barrier. | 4713 // Write barrier. |
4714 ASSERT_NE(instr->temp(), NULL); | 4714 ASSERT_NE(instr->temp(), NULL); |
4715 __ RecordWriteForMap(object_reg, to_map, new_map_reg, | 4715 __ RecordWriteForMap(object_reg, to_map, new_map_reg, |
4716 ToRegister(instr->temp()), | 4716 ToRegister(instr->temp()), |
4717 kDontSaveFPRegs); | 4717 kDontSaveFPRegs); |
4718 } else if (FLAG_compiled_transitions) { | 4718 } else { |
4719 PushSafepointRegistersScope scope(this); | 4719 PushSafepointRegistersScope scope(this); |
4720 if (!object_reg.is(eax)) { | 4720 if (!object_reg.is(eax)) { |
4721 __ push(object_reg); | 4721 __ push(object_reg); |
4722 } | 4722 } |
4723 LoadContextFromDeferred(instr->context()); | 4723 LoadContextFromDeferred(instr->context()); |
4724 if (!object_reg.is(eax)) { | 4724 if (!object_reg.is(eax)) { |
4725 __ pop(eax); | 4725 __ pop(eax); |
4726 } | 4726 } |
4727 __ mov(ebx, to_map); | 4727 __ mov(ebx, to_map); |
4728 TransitionElementsKindStub stub(from_kind, to_kind); | 4728 TransitionElementsKindStub stub(from_kind, to_kind); |
4729 __ CallStub(&stub); | 4729 __ CallStub(&stub); |
4730 RecordSafepointWithRegisters( | 4730 RecordSafepointWithRegisters( |
4731 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); | 4731 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
4732 } else if (IsFastSmiElementsKind(from_kind) && | |
4733 IsFastDoubleElementsKind(to_kind)) { | |
4734 Register new_map_reg = ToRegister(instr->new_map_temp()); | |
4735 __ mov(new_map_reg, to_map); | |
4736 Register fixed_object_reg = ToRegister(instr->temp()); | |
4737 ASSERT(fixed_object_reg.is(edx)); | |
4738 ASSERT(new_map_reg.is(ebx)); | |
4739 __ mov(fixed_object_reg, object_reg); | |
4740 CallCode(isolate()->builtins()->TransitionElementsSmiToDouble(), | |
4741 RelocInfo::CODE_TARGET, instr); | |
4742 } else if (IsFastDoubleElementsKind(from_kind) && | |
4743 IsFastObjectElementsKind(to_kind)) { | |
4744 Register new_map_reg = ToRegister(instr->new_map_temp()); | |
4745 __ mov(new_map_reg, to_map); | |
4746 Register fixed_object_reg = ToRegister(instr->temp()); | |
4747 ASSERT(fixed_object_reg.is(edx)); | |
4748 ASSERT(new_map_reg.is(ebx)); | |
4749 __ mov(fixed_object_reg, object_reg); | |
4750 CallCode(isolate()->builtins()->TransitionElementsDoubleToObject(), | |
4751 RelocInfo::CODE_TARGET, instr); | |
4752 } else { | |
4753 UNREACHABLE(); | |
4754 } | 4732 } |
4755 __ bind(¬_applicable); | 4733 __ bind(¬_applicable); |
4756 } | 4734 } |
4757 | 4735 |
4758 | 4736 |
4759 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { | 4737 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { |
4760 class DeferredStringCharCodeAt: public LDeferredCode { | 4738 class DeferredStringCharCodeAt: public LDeferredCode { |
4761 public: | 4739 public: |
4762 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) | 4740 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) |
4763 : LDeferredCode(codegen), instr_(instr) { } | 4741 : LDeferredCode(codegen), instr_(instr) { } |
(...skipping 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6506 FixedArray::kHeaderSize - kPointerSize)); | 6484 FixedArray::kHeaderSize - kPointerSize)); |
6507 __ bind(&done); | 6485 __ bind(&done); |
6508 } | 6486 } |
6509 | 6487 |
6510 | 6488 |
6511 #undef __ | 6489 #undef __ |
6512 | 6490 |
6513 } } // namespace v8::internal | 6491 } } // namespace v8::internal |
6514 | 6492 |
6515 #endif // V8_TARGET_ARCH_IA32 | 6493 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |