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 5158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5169 __ lea(rcx, Operand(result, elements_offset)); | 5169 __ lea(rcx, Operand(result, elements_offset)); |
5170 } else { | 5170 } else { |
5171 __ movq(rcx, FieldOperand(source, i)); | 5171 __ movq(rcx, FieldOperand(source, i)); |
5172 } | 5172 } |
5173 __ movq(FieldOperand(result, object_offset + i), rcx); | 5173 __ movq(FieldOperand(result, object_offset + i), rcx); |
5174 } | 5174 } |
5175 | 5175 |
5176 // Copy in-object properties. | 5176 // Copy in-object properties. |
5177 for (int i = 0; i < inobject_properties; i++) { | 5177 for (int i = 0; i < inobject_properties; i++) { |
5178 int total_offset = object_offset + object->GetInObjectPropertyOffset(i); | 5178 int total_offset = object_offset + object->GetInObjectPropertyOffset(i); |
5179 Handle<Object> value = Handle<Object>(object->InObjectPropertyAt(i)); | 5179 Handle<Object> value = Handle<Object>(object->InObjectPropertyAt(i), |
| 5180 isolate()); |
5180 if (value->IsJSObject()) { | 5181 if (value->IsJSObject()) { |
5181 Handle<JSObject> value_object = Handle<JSObject>::cast(value); | 5182 Handle<JSObject> value_object = Handle<JSObject>::cast(value); |
5182 __ lea(rcx, Operand(result, *offset)); | 5183 __ lea(rcx, Operand(result, *offset)); |
5183 __ movq(FieldOperand(result, total_offset), rcx); | 5184 __ movq(FieldOperand(result, total_offset), rcx); |
5184 __ LoadHeapObject(source, value_object); | 5185 __ LoadHeapObject(source, value_object); |
5185 EmitDeepCopy(value_object, result, source, offset, | 5186 EmitDeepCopy(value_object, result, source, offset, |
5186 DONT_TRACK_ALLOCATION_SITE); | 5187 DONT_TRACK_ALLOCATION_SITE); |
5187 } else if (value->IsHeapObject()) { | 5188 } else if (value->IsHeapObject()) { |
5188 __ LoadHeapObject(rcx, Handle<HeapObject>::cast(value)); | 5189 __ LoadHeapObject(rcx, Handle<HeapObject>::cast(value)); |
5189 __ movq(FieldOperand(result, total_offset), rcx); | 5190 __ movq(FieldOperand(result, total_offset), rcx); |
(...skipping 27 matching lines...) Expand all Loading... |
5217 int64_t value = double_array->get_representation(i); | 5218 int64_t value = double_array->get_representation(i); |
5218 int total_offset = | 5219 int total_offset = |
5219 elements_offset + FixedDoubleArray::OffsetOfElementAt(i); | 5220 elements_offset + FixedDoubleArray::OffsetOfElementAt(i); |
5220 __ movq(rcx, value, RelocInfo::NONE64); | 5221 __ movq(rcx, value, RelocInfo::NONE64); |
5221 __ movq(FieldOperand(result, total_offset), rcx); | 5222 __ movq(FieldOperand(result, total_offset), rcx); |
5222 } | 5223 } |
5223 } else if (elements->IsFixedArray()) { | 5224 } else if (elements->IsFixedArray()) { |
5224 Handle<FixedArray> fast_elements = Handle<FixedArray>::cast(elements); | 5225 Handle<FixedArray> fast_elements = Handle<FixedArray>::cast(elements); |
5225 for (int i = 0; i < elements_length; i++) { | 5226 for (int i = 0; i < elements_length; i++) { |
5226 int total_offset = elements_offset + FixedArray::OffsetOfElementAt(i); | 5227 int total_offset = elements_offset + FixedArray::OffsetOfElementAt(i); |
5227 Handle<Object> value(fast_elements->get(i)); | 5228 Handle<Object> value(fast_elements->get(i), isolate()); |
5228 if (value->IsJSObject()) { | 5229 if (value->IsJSObject()) { |
5229 Handle<JSObject> value_object = Handle<JSObject>::cast(value); | 5230 Handle<JSObject> value_object = Handle<JSObject>::cast(value); |
5230 __ lea(rcx, Operand(result, *offset)); | 5231 __ lea(rcx, Operand(result, *offset)); |
5231 __ movq(FieldOperand(result, total_offset), rcx); | 5232 __ movq(FieldOperand(result, total_offset), rcx); |
5232 __ LoadHeapObject(source, value_object); | 5233 __ LoadHeapObject(source, value_object); |
5233 EmitDeepCopy(value_object, result, source, offset, | 5234 EmitDeepCopy(value_object, result, source, offset, |
5234 DONT_TRACK_ALLOCATION_SITE); | 5235 DONT_TRACK_ALLOCATION_SITE); |
5235 } else if (value->IsHeapObject()) { | 5236 } else if (value->IsHeapObject()) { |
5236 __ LoadHeapObject(rcx, Handle<HeapObject>::cast(value)); | 5237 __ LoadHeapObject(rcx, Handle<HeapObject>::cast(value)); |
5237 __ movq(FieldOperand(result, total_offset), rcx); | 5238 __ movq(FieldOperand(result, total_offset), rcx); |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5758 FixedArray::kHeaderSize - kPointerSize)); | 5759 FixedArray::kHeaderSize - kPointerSize)); |
5759 __ bind(&done); | 5760 __ bind(&done); |
5760 } | 5761 } |
5761 | 5762 |
5762 | 5763 |
5763 #undef __ | 5764 #undef __ |
5764 | 5765 |
5765 } } // namespace v8::internal | 5766 } } // namespace v8::internal |
5766 | 5767 |
5767 #endif // V8_TARGET_ARCH_X64 | 5768 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |