| OLD | NEW | 
|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "src/v8.h" | 5 #include "src/v8.h" | 
| 6 | 6 | 
| 7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" | 
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" | 
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" | 
| 10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" | 
| (...skipping 2790 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2801                                          int size, AllocationSpace dest) { | 2801                                          int size, AllocationSpace dest) { | 
| 2802   Address dst_addr = dst->address(); | 2802   Address dst_addr = dst->address(); | 
| 2803   Address src_addr = src->address(); | 2803   Address src_addr = src->address(); | 
| 2804   DCHECK(heap()->AllowedToBeMigrated(src, dest)); | 2804   DCHECK(heap()->AllowedToBeMigrated(src, dest)); | 
| 2805   DCHECK(dest != LO_SPACE && size <= Page::kMaxRegularHeapObjectSize); | 2805   DCHECK(dest != LO_SPACE && size <= Page::kMaxRegularHeapObjectSize); | 
| 2806   if (dest == OLD_POINTER_SPACE) { | 2806   if (dest == OLD_POINTER_SPACE) { | 
| 2807     Address src_slot = src_addr; | 2807     Address src_slot = src_addr; | 
| 2808     Address dst_slot = dst_addr; | 2808     Address dst_slot = dst_addr; | 
| 2809     DCHECK(IsAligned(size, kPointerSize)); | 2809     DCHECK(IsAligned(size, kPointerSize)); | 
| 2810 | 2810 | 
|  | 2811     bool may_contain_raw_values = src->MayContainRawValues(); | 
|  | 2812 #if V8_DOUBLE_FIELDS_UNBOXING | 
|  | 2813     InobjectPropertiesHelper helper(src->map()); | 
|  | 2814     bool has_only_tagged_fields = helper.all_fields_tagged(); | 
|  | 2815 #endif | 
| 2811     for (int remaining = size / kPointerSize; remaining > 0; remaining--) { | 2816     for (int remaining = size / kPointerSize; remaining > 0; remaining--) { | 
| 2812       Object* value = Memory::Object_at(src_slot); | 2817       Object* value = Memory::Object_at(src_slot); | 
| 2813 | 2818 | 
| 2814       Memory::Object_at(dst_slot) = value; | 2819       Memory::Object_at(dst_slot) = value; | 
| 2815 | 2820 | 
| 2816       if (!src->MayContainRawValues()) { | 2821 #if V8_DOUBLE_FIELDS_UNBOXING | 
|  | 2822       if (!may_contain_raw_values && | 
|  | 2823           (has_only_tagged_fields || helper.IsTagged(src_slot - src_addr))) | 
|  | 2824 #else | 
|  | 2825       if (!may_contain_raw_values) | 
|  | 2826 #endif | 
|  | 2827       { | 
| 2817         RecordMigratedSlot(value, dst_slot); | 2828         RecordMigratedSlot(value, dst_slot); | 
| 2818       } | 2829       } | 
| 2819 | 2830 | 
| 2820       src_slot += kPointerSize; | 2831       src_slot += kPointerSize; | 
| 2821       dst_slot += kPointerSize; | 2832       dst_slot += kPointerSize; | 
| 2822     } | 2833     } | 
| 2823 | 2834 | 
| 2824     if (compacting_ && dst->IsJSFunction()) { | 2835     if (compacting_ && dst->IsJSFunction()) { | 
| 2825       Address code_entry_slot = dst_addr + JSFunction::kCodeEntryOffset; | 2836       Address code_entry_slot = dst_addr + JSFunction::kCodeEntryOffset; | 
| 2826       Address code_entry = Memory::Address_at(code_entry_slot); | 2837       Address code_entry = Memory::Address_at(code_entry_slot); | 
| (...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4451   SlotsBuffer* buffer = *buffer_address; | 4462   SlotsBuffer* buffer = *buffer_address; | 
| 4452   while (buffer != NULL) { | 4463   while (buffer != NULL) { | 
| 4453     SlotsBuffer* next_buffer = buffer->next(); | 4464     SlotsBuffer* next_buffer = buffer->next(); | 
| 4454     DeallocateBuffer(buffer); | 4465     DeallocateBuffer(buffer); | 
| 4455     buffer = next_buffer; | 4466     buffer = next_buffer; | 
| 4456   } | 4467   } | 
| 4457   *buffer_address = NULL; | 4468   *buffer_address = NULL; | 
| 4458 } | 4469 } | 
| 4459 } | 4470 } | 
| 4460 }  // namespace v8::internal | 4471 }  // namespace v8::internal | 
| OLD | NEW | 
|---|