| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 5641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5652 __ Pop(x1); | 5652 __ Pop(x1); |
| 5653 | 5653 |
| 5654 __ Bind(&allocated); | 5654 __ Bind(&allocated); |
| 5655 // Copy the content into the newly allocated memory. | 5655 // Copy the content into the newly allocated memory. |
| 5656 __ CopyFields(x0, x1, CPURegList(x10, x11, x12), size / kPointerSize); | 5656 __ CopyFields(x0, x1, CPURegList(x10, x11, x12), size / kPointerSize); |
| 5657 } | 5657 } |
| 5658 | 5658 |
| 5659 | 5659 |
| 5660 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { | 5660 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
| 5661 Register object = ToRegister(instr->object()); | 5661 Register object = ToRegister(instr->object()); |
| 5662 Register temp1 = ToRegister(instr->temp1()); | |
| 5663 | 5662 |
| 5664 Handle<Map> from_map = instr->original_map(); | 5663 Handle<Map> from_map = instr->original_map(); |
| 5665 Handle<Map> to_map = instr->transitioned_map(); | 5664 Handle<Map> to_map = instr->transitioned_map(); |
| 5666 ElementsKind from_kind = instr->from_kind(); | 5665 ElementsKind from_kind = instr->from_kind(); |
| 5667 ElementsKind to_kind = instr->to_kind(); | 5666 ElementsKind to_kind = instr->to_kind(); |
| 5668 | 5667 |
| 5669 Label not_applicable; | 5668 Label not_applicable; |
| 5670 __ CheckMap(object, temp1, from_map, ¬_applicable, DONT_DO_SMI_CHECK); | |
| 5671 | 5669 |
| 5672 if (IsSimpleMapChangeTransition(from_kind, to_kind)) { | 5670 if (IsSimpleMapChangeTransition(from_kind, to_kind)) { |
| 5671 Register temp1 = ToRegister(instr->temp1()); |
| 5673 Register new_map = ToRegister(instr->temp2()); | 5672 Register new_map = ToRegister(instr->temp2()); |
| 5673 __ CheckMap(object, temp1, from_map, ¬_applicable, DONT_DO_SMI_CHECK); |
| 5674 __ Mov(new_map, Operand(to_map)); | 5674 __ Mov(new_map, Operand(to_map)); |
| 5675 __ Str(new_map, FieldMemOperand(object, HeapObject::kMapOffset)); | 5675 __ Str(new_map, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 5676 // Write barrier. | 5676 // Write barrier. |
| 5677 __ RecordWriteField(object, HeapObject::kMapOffset, new_map, temp1, | 5677 __ RecordWriteField(object, HeapObject::kMapOffset, new_map, temp1, |
| 5678 GetLinkRegisterState(), kDontSaveFPRegs); | 5678 GetLinkRegisterState(), kDontSaveFPRegs); |
| 5679 } else { | 5679 } else { |
| 5680 { |
| 5681 UseScratchRegisterScope temps(masm()); |
| 5682 // Use the temp register only in a restricted scope - the codegen checks |
| 5683 // that we do not use any register across a call. |
| 5684 __ CheckMap(object, temps.AcquireX(), from_map, ¬_applicable, |
| 5685 DONT_DO_SMI_CHECK); |
| 5686 } |
| 5687 ASSERT(object.is(x0)); |
| 5680 ASSERT(ToRegister(instr->context()).is(cp)); | 5688 ASSERT(ToRegister(instr->context()).is(cp)); |
| 5681 PushSafepointRegistersScope scope( | 5689 PushSafepointRegistersScope scope( |
| 5682 this, Safepoint::kWithRegistersAndDoubles); | 5690 this, Safepoint::kWithRegistersAndDoubles); |
| 5683 __ Mov(x0, object); | |
| 5684 __ Mov(x1, Operand(to_map)); | 5691 __ Mov(x1, Operand(to_map)); |
| 5685 bool is_js_array = from_map->instance_type() == JS_ARRAY_TYPE; | 5692 bool is_js_array = from_map->instance_type() == JS_ARRAY_TYPE; |
| 5686 TransitionElementsKindStub stub(from_kind, to_kind, is_js_array); | 5693 TransitionElementsKindStub stub(from_kind, to_kind, is_js_array); |
| 5687 __ CallStub(&stub); | 5694 __ CallStub(&stub); |
| 5688 RecordSafepointWithRegistersAndDoubles( | 5695 RecordSafepointWithRegistersAndDoubles( |
| 5689 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); | 5696 instr->pointer_map(), 0, Safepoint::kLazyDeopt); |
| 5690 } | 5697 } |
| 5691 __ Bind(¬_applicable); | 5698 __ Bind(¬_applicable); |
| 5692 } | 5699 } |
| 5693 | 5700 |
| 5694 | 5701 |
| 5695 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { | 5702 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { |
| 5696 Register object = ToRegister(instr->object()); | 5703 Register object = ToRegister(instr->object()); |
| 5697 Register temp1 = ToRegister(instr->temp1()); | 5704 Register temp1 = ToRegister(instr->temp1()); |
| 5698 Register temp2 = ToRegister(instr->temp2()); | 5705 Register temp2 = ToRegister(instr->temp2()); |
| 5699 | 5706 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5892 __ Bind(&out_of_object); | 5899 __ Bind(&out_of_object); |
| 5893 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5900 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| 5894 // Index is equal to negated out of object property index plus 1. | 5901 // Index is equal to negated out of object property index plus 1. |
| 5895 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5902 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 5896 __ Ldr(result, FieldMemOperand(result, | 5903 __ Ldr(result, FieldMemOperand(result, |
| 5897 FixedArray::kHeaderSize - kPointerSize)); | 5904 FixedArray::kHeaderSize - kPointerSize)); |
| 5898 __ Bind(&done); | 5905 __ Bind(&done); |
| 5899 } | 5906 } |
| 5900 | 5907 |
| 5901 } } // namespace v8::internal | 5908 } } // namespace v8::internal |
| OLD | NEW |