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 5400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5411 __ Addu(a2, result, Operand(elements_offset)); | 5411 __ Addu(a2, result, Operand(elements_offset)); |
5412 } else { | 5412 } else { |
5413 __ lw(a2, FieldMemOperand(source, i)); | 5413 __ lw(a2, FieldMemOperand(source, i)); |
5414 } | 5414 } |
5415 __ sw(a2, FieldMemOperand(result, object_offset + i)); | 5415 __ sw(a2, FieldMemOperand(result, object_offset + i)); |
5416 } | 5416 } |
5417 | 5417 |
5418 // Copy in-object properties. | 5418 // Copy in-object properties. |
5419 for (int i = 0; i < inobject_properties; i++) { | 5419 for (int i = 0; i < inobject_properties; i++) { |
5420 int total_offset = object_offset + object->GetInObjectPropertyOffset(i); | 5420 int total_offset = object_offset + object->GetInObjectPropertyOffset(i); |
5421 Handle<Object> value = Handle<Object>(object->InObjectPropertyAt(i)); | 5421 Handle<Object> value = Handle<Object>(object->InObjectPropertyAt(i), |
| 5422 isolate()); |
5422 if (value->IsJSObject()) { | 5423 if (value->IsJSObject()) { |
5423 Handle<JSObject> value_object = Handle<JSObject>::cast(value); | 5424 Handle<JSObject> value_object = Handle<JSObject>::cast(value); |
5424 __ Addu(a2, result, Operand(*offset)); | 5425 __ Addu(a2, result, Operand(*offset)); |
5425 __ sw(a2, FieldMemOperand(result, total_offset)); | 5426 __ sw(a2, FieldMemOperand(result, total_offset)); |
5426 __ LoadHeapObject(source, value_object); | 5427 __ LoadHeapObject(source, value_object); |
5427 EmitDeepCopy(value_object, result, source, offset, | 5428 EmitDeepCopy(value_object, result, source, offset, |
5428 DONT_TRACK_ALLOCATION_SITE); | 5429 DONT_TRACK_ALLOCATION_SITE); |
5429 } else if (value->IsHeapObject()) { | 5430 } else if (value->IsHeapObject()) { |
5430 __ LoadHeapObject(a2, Handle<HeapObject>::cast(value)); | 5431 __ LoadHeapObject(a2, Handle<HeapObject>::cast(value)); |
5431 __ sw(a2, FieldMemOperand(result, total_offset)); | 5432 __ sw(a2, FieldMemOperand(result, total_offset)); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5465 elements_offset + FixedDoubleArray::OffsetOfElementAt(i); | 5466 elements_offset + FixedDoubleArray::OffsetOfElementAt(i); |
5466 __ li(a2, Operand(value_low)); | 5467 __ li(a2, Operand(value_low)); |
5467 __ sw(a2, FieldMemOperand(result, total_offset)); | 5468 __ sw(a2, FieldMemOperand(result, total_offset)); |
5468 __ li(a2, Operand(value_high)); | 5469 __ li(a2, Operand(value_high)); |
5469 __ sw(a2, FieldMemOperand(result, total_offset + 4)); | 5470 __ sw(a2, FieldMemOperand(result, total_offset + 4)); |
5470 } | 5471 } |
5471 } else if (elements->IsFixedArray()) { | 5472 } else if (elements->IsFixedArray()) { |
5472 Handle<FixedArray> fast_elements = Handle<FixedArray>::cast(elements); | 5473 Handle<FixedArray> fast_elements = Handle<FixedArray>::cast(elements); |
5473 for (int i = 0; i < elements_length; i++) { | 5474 for (int i = 0; i < elements_length; i++) { |
5474 int total_offset = elements_offset + FixedArray::OffsetOfElementAt(i); | 5475 int total_offset = elements_offset + FixedArray::OffsetOfElementAt(i); |
5475 Handle<Object> value(fast_elements->get(i)); | 5476 Handle<Object> value(fast_elements->get(i), isolate()); |
5476 if (value->IsJSObject()) { | 5477 if (value->IsJSObject()) { |
5477 Handle<JSObject> value_object = Handle<JSObject>::cast(value); | 5478 Handle<JSObject> value_object = Handle<JSObject>::cast(value); |
5478 __ Addu(a2, result, Operand(*offset)); | 5479 __ Addu(a2, result, Operand(*offset)); |
5479 __ sw(a2, FieldMemOperand(result, total_offset)); | 5480 __ sw(a2, FieldMemOperand(result, total_offset)); |
5480 __ LoadHeapObject(source, value_object); | 5481 __ LoadHeapObject(source, value_object); |
5481 EmitDeepCopy(value_object, result, source, offset, | 5482 EmitDeepCopy(value_object, result, source, offset, |
5482 DONT_TRACK_ALLOCATION_SITE); | 5483 DONT_TRACK_ALLOCATION_SITE); |
5483 } else if (value->IsHeapObject()) { | 5484 } else if (value->IsHeapObject()) { |
5484 __ LoadHeapObject(a2, Handle<HeapObject>::cast(value)); | 5485 __ LoadHeapObject(a2, Handle<HeapObject>::cast(value)); |
5485 __ sw(a2, FieldMemOperand(result, total_offset)); | 5486 __ sw(a2, FieldMemOperand(result, total_offset)); |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6036 __ Subu(scratch, result, scratch); | 6037 __ Subu(scratch, result, scratch); |
6037 __ lw(result, FieldMemOperand(scratch, | 6038 __ lw(result, FieldMemOperand(scratch, |
6038 FixedArray::kHeaderSize - kPointerSize)); | 6039 FixedArray::kHeaderSize - kPointerSize)); |
6039 __ bind(&done); | 6040 __ bind(&done); |
6040 } | 6041 } |
6041 | 6042 |
6042 | 6043 |
6043 #undef __ | 6044 #undef __ |
6044 | 6045 |
6045 } } // namespace v8::internal | 6046 } } // namespace v8::internal |
OLD | NEW |