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 5593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5604 __ lea(ecx, Operand(result, elements_offset)); | 5604 __ lea(ecx, Operand(result, elements_offset)); |
5605 } else { | 5605 } else { |
5606 __ mov(ecx, FieldOperand(source, i)); | 5606 __ mov(ecx, FieldOperand(source, i)); |
5607 } | 5607 } |
5608 __ mov(FieldOperand(result, object_offset + i), ecx); | 5608 __ mov(FieldOperand(result, object_offset + i), ecx); |
5609 } | 5609 } |
5610 | 5610 |
5611 // Copy in-object properties. | 5611 // Copy in-object properties. |
5612 for (int i = 0; i < inobject_properties; i++) { | 5612 for (int i = 0; i < inobject_properties; i++) { |
5613 int total_offset = object_offset + object->GetInObjectPropertyOffset(i); | 5613 int total_offset = object_offset + object->GetInObjectPropertyOffset(i); |
5614 Handle<Object> value = Handle<Object>(object->InObjectPropertyAt(i)); | 5614 Handle<Object> value = Handle<Object>(object->InObjectPropertyAt(i), |
| 5615 isolate()); |
5615 if (value->IsJSObject()) { | 5616 if (value->IsJSObject()) { |
5616 Handle<JSObject> value_object = Handle<JSObject>::cast(value); | 5617 Handle<JSObject> value_object = Handle<JSObject>::cast(value); |
5617 __ lea(ecx, Operand(result, *offset)); | 5618 __ lea(ecx, Operand(result, *offset)); |
5618 __ mov(FieldOperand(result, total_offset), ecx); | 5619 __ mov(FieldOperand(result, total_offset), ecx); |
5619 __ LoadHeapObject(source, value_object); | 5620 __ LoadHeapObject(source, value_object); |
5620 EmitDeepCopy(value_object, result, source, offset, | 5621 EmitDeepCopy(value_object, result, source, offset, |
5621 DONT_TRACK_ALLOCATION_SITE); | 5622 DONT_TRACK_ALLOCATION_SITE); |
5622 } else if (value->IsHeapObject()) { | 5623 } else if (value->IsHeapObject()) { |
5623 __ LoadHeapObject(ecx, Handle<HeapObject>::cast(value)); | 5624 __ LoadHeapObject(ecx, Handle<HeapObject>::cast(value)); |
5624 __ mov(FieldOperand(result, total_offset), ecx); | 5625 __ mov(FieldOperand(result, total_offset), ecx); |
(...skipping 29 matching lines...) Expand all Loading... |
5654 int32_t value_high = static_cast<int32_t>(value >> 32); | 5655 int32_t value_high = static_cast<int32_t>(value >> 32); |
5655 int total_offset = | 5656 int total_offset = |
5656 elements_offset + FixedDoubleArray::OffsetOfElementAt(i); | 5657 elements_offset + FixedDoubleArray::OffsetOfElementAt(i); |
5657 __ mov(FieldOperand(result, total_offset), Immediate(value_low)); | 5658 __ mov(FieldOperand(result, total_offset), Immediate(value_low)); |
5658 __ mov(FieldOperand(result, total_offset + 4), Immediate(value_high)); | 5659 __ mov(FieldOperand(result, total_offset + 4), Immediate(value_high)); |
5659 } | 5660 } |
5660 } else if (elements->IsFixedArray()) { | 5661 } else if (elements->IsFixedArray()) { |
5661 Handle<FixedArray> fast_elements = Handle<FixedArray>::cast(elements); | 5662 Handle<FixedArray> fast_elements = Handle<FixedArray>::cast(elements); |
5662 for (int i = 0; i < elements_length; i++) { | 5663 for (int i = 0; i < elements_length; i++) { |
5663 int total_offset = elements_offset + FixedArray::OffsetOfElementAt(i); | 5664 int total_offset = elements_offset + FixedArray::OffsetOfElementAt(i); |
5664 Handle<Object> value(fast_elements->get(i)); | 5665 Handle<Object> value(fast_elements->get(i), isolate()); |
5665 if (value->IsJSObject()) { | 5666 if (value->IsJSObject()) { |
5666 Handle<JSObject> value_object = Handle<JSObject>::cast(value); | 5667 Handle<JSObject> value_object = Handle<JSObject>::cast(value); |
5667 __ lea(ecx, Operand(result, *offset)); | 5668 __ lea(ecx, Operand(result, *offset)); |
5668 __ mov(FieldOperand(result, total_offset), ecx); | 5669 __ mov(FieldOperand(result, total_offset), ecx); |
5669 __ LoadHeapObject(source, value_object); | 5670 __ LoadHeapObject(source, value_object); |
5670 EmitDeepCopy(value_object, result, source, offset, | 5671 EmitDeepCopy(value_object, result, source, offset, |
5671 DONT_TRACK_ALLOCATION_SITE); | 5672 DONT_TRACK_ALLOCATION_SITE); |
5672 } else if (value->IsHeapObject()) { | 5673 } else if (value->IsHeapObject()) { |
5673 __ LoadHeapObject(ecx, Handle<HeapObject>::cast(value)); | 5674 __ LoadHeapObject(ecx, Handle<HeapObject>::cast(value)); |
5674 __ mov(FieldOperand(result, total_offset), ecx); | 5675 __ mov(FieldOperand(result, total_offset), ecx); |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6186 FixedArray::kHeaderSize - kPointerSize)); | 6187 FixedArray::kHeaderSize - kPointerSize)); |
6187 __ bind(&done); | 6188 __ bind(&done); |
6188 } | 6189 } |
6189 | 6190 |
6190 | 6191 |
6191 #undef __ | 6192 #undef __ |
6192 | 6193 |
6193 } } // namespace v8::internal | 6194 } } // namespace v8::internal |
6194 | 6195 |
6195 #endif // V8_TARGET_ARCH_IA32 | 6196 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |