| 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 2735 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2746                                          int size, AllocationSpace dest) { |  2746                                          int size, AllocationSpace dest) { | 
|  2747   Address dst_addr = dst->address(); |  2747   Address dst_addr = dst->address(); | 
|  2748   Address src_addr = src->address(); |  2748   Address src_addr = src->address(); | 
|  2749   DCHECK(heap()->AllowedToBeMigrated(src, dest)); |  2749   DCHECK(heap()->AllowedToBeMigrated(src, dest)); | 
|  2750   DCHECK(dest != LO_SPACE && size <= Page::kMaxRegularHeapObjectSize); |  2750   DCHECK(dest != LO_SPACE && size <= Page::kMaxRegularHeapObjectSize); | 
|  2751   if (dest == OLD_POINTER_SPACE) { |  2751   if (dest == OLD_POINTER_SPACE) { | 
|  2752     Address src_slot = src_addr; |  2752     Address src_slot = src_addr; | 
|  2753     Address dst_slot = dst_addr; |  2753     Address dst_slot = dst_addr; | 
|  2754     DCHECK(IsAligned(size, kPointerSize)); |  2754     DCHECK(IsAligned(size, kPointerSize)); | 
|  2755  |  2755  | 
 |  2756     bool may_contain_raw_values = src->MayContainRawValues(); | 
 |  2757 #if V8_DOUBLE_FIELDS_UNBOXING | 
 |  2758     InobjectPropertiesHelper helper(src->map()); | 
 |  2759     bool has_only_tagged_fields = helper.all_fields_tagged(); | 
 |  2760 #endif | 
|  2756     for (int remaining = size / kPointerSize; remaining > 0; remaining--) { |  2761     for (int remaining = size / kPointerSize; remaining > 0; remaining--) { | 
|  2757       Object* value = Memory::Object_at(src_slot); |  2762       Object* value = Memory::Object_at(src_slot); | 
|  2758  |  2763  | 
|  2759       Memory::Object_at(dst_slot) = value; |  2764       Memory::Object_at(dst_slot) = value; | 
|  2760  |  2765  | 
|  2761       if (!src->MayContainRawValues()) { |  2766 #if V8_DOUBLE_FIELDS_UNBOXING | 
 |  2767       if (!may_contain_raw_values && | 
 |  2768           (has_only_tagged_fields || helper.IsTagged(src_slot - src_addr))) | 
 |  2769 #else | 
 |  2770       if (!may_contain_raw_values) | 
 |  2771 #endif | 
 |  2772       { | 
|  2762         RecordMigratedSlot(value, dst_slot); |  2773         RecordMigratedSlot(value, dst_slot); | 
|  2763       } |  2774       } | 
|  2764  |  2775  | 
|  2765       src_slot += kPointerSize; |  2776       src_slot += kPointerSize; | 
|  2766       dst_slot += kPointerSize; |  2777       dst_slot += kPointerSize; | 
|  2767     } |  2778     } | 
|  2768  |  2779  | 
|  2769     if (compacting_ && dst->IsJSFunction()) { |  2780     if (compacting_ && dst->IsJSFunction()) { | 
|  2770       Address code_entry_slot = dst_addr + JSFunction::kCodeEntryOffset; |  2781       Address code_entry_slot = dst_addr + JSFunction::kCodeEntryOffset; | 
|  2771       Address code_entry = Memory::Address_at(code_entry_slot); |  2782       Address code_entry = Memory::Address_at(code_entry_slot); | 
| (...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  4392   SlotsBuffer* buffer = *buffer_address; |  4403   SlotsBuffer* buffer = *buffer_address; | 
|  4393   while (buffer != NULL) { |  4404   while (buffer != NULL) { | 
|  4394     SlotsBuffer* next_buffer = buffer->next(); |  4405     SlotsBuffer* next_buffer = buffer->next(); | 
|  4395     DeallocateBuffer(buffer); |  4406     DeallocateBuffer(buffer); | 
|  4396     buffer = next_buffer; |  4407     buffer = next_buffer; | 
|  4397   } |  4408   } | 
|  4398   *buffer_address = NULL; |  4409   *buffer_address = NULL; | 
|  4399 } |  4410 } | 
|  4400 } |  4411 } | 
|  4401 }  // namespace v8::internal |  4412 }  // namespace v8::internal | 
| OLD | NEW |