Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/heap/mark-compact.cc

Issue 1314953004: [interpreter] Add constant_pool() to BytecodeArray. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_args
Patch Set: Fix test flag. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/objects-visiting.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/heap/mark-compact.h" 5 #include "src/heap/mark-compact.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 2769 matching lines...) Expand 10 before | Expand all | Expand 10 after
2780 } 2780 }
2781 2781
2782 2782
2783 void MarkCompactCollector::MigrateObjectMixed(HeapObject* dst, HeapObject* src, 2783 void MarkCompactCollector::MigrateObjectMixed(HeapObject* dst, HeapObject* src,
2784 int size) { 2784 int size) {
2785 if (src->IsFixedTypedArrayBase()) { 2785 if (src->IsFixedTypedArrayBase()) {
2786 heap()->MoveBlock(dst->address(), src->address(), size); 2786 heap()->MoveBlock(dst->address(), src->address(), size);
2787 Address base_pointer_slot = 2787 Address base_pointer_slot =
2788 dst->address() + FixedTypedArrayBase::kBasePointerOffset; 2788 dst->address() + FixedTypedArrayBase::kBasePointerOffset;
2789 RecordMigratedSlot(Memory::Object_at(base_pointer_slot), base_pointer_slot); 2789 RecordMigratedSlot(Memory::Object_at(base_pointer_slot), base_pointer_slot);
2790 } else if (src->IsBytecodeArray()) {
2791 heap()->MoveBlock(dst->address(), src->address(), size);
2792 Address constant_pool_slot =
2793 dst->address() + BytecodeArray::kConstantPoolOffset;
2794 RecordMigratedSlot(Memory::Object_at(constant_pool_slot),
2795 constant_pool_slot);
2790 } else if (FLAG_unbox_double_fields) { 2796 } else if (FLAG_unbox_double_fields) {
2791 Address dst_addr = dst->address(); 2797 Address dst_addr = dst->address();
2792 Address src_addr = src->address(); 2798 Address src_addr = src->address();
2793 Address src_slot = src_addr; 2799 Address src_slot = src_addr;
2794 Address dst_slot = dst_addr; 2800 Address dst_slot = dst_addr;
2795 2801
2796 LayoutDescriptorHelper helper(src->map()); 2802 LayoutDescriptorHelper helper(src->map());
2797 DCHECK(!helper.all_fields_tagged()); 2803 DCHECK(!helper.all_fields_tagged());
2798 for (int remaining = size / kPointerSize; remaining > 0; remaining--) { 2804 for (int remaining = size / kPointerSize; remaining > 0; remaining--) {
2799 Object* value = Memory::Object_at(src_slot); 2805 Object* value = Memory::Object_at(src_slot);
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
3203 if (type == MAP_TYPE || type == CODE_TYPE) return true; 3209 if (type == MAP_TYPE || type == CODE_TYPE) return true;
3204 3210
3205 // Consider slots in objects that contain ONLY raw data as invalid. 3211 // Consider slots in objects that contain ONLY raw data as invalid.
3206 return false; 3212 return false;
3207 } 3213 }
3208 3214
3209 case HeapObjectContents::kMixedValues: { 3215 case HeapObjectContents::kMixedValues: {
3210 if (object->IsFixedTypedArrayBase()) { 3216 if (object->IsFixedTypedArrayBase()) {
3211 return static_cast<int>(slot - object->address()) == 3217 return static_cast<int>(slot - object->address()) ==
3212 FixedTypedArrayBase::kBasePointerOffset; 3218 FixedTypedArrayBase::kBasePointerOffset;
3219 } else if (object->IsBytecodeArray()) {
3220 return static_cast<int>(slot - object->address()) ==
3221 BytecodeArray::kConstantPoolOffset;
3213 } else if (FLAG_unbox_double_fields) { 3222 } else if (FLAG_unbox_double_fields) {
3214 // Filter out slots that happen to point to unboxed double fields. 3223 // Filter out slots that happen to point to unboxed double fields.
3215 LayoutDescriptorHelper helper(object->map()); 3224 LayoutDescriptorHelper helper(object->map());
3216 DCHECK(!helper.all_fields_tagged()); 3225 DCHECK(!helper.all_fields_tagged());
3217 return helper.IsTagged(static_cast<int>(slot - object->address())); 3226 return helper.IsTagged(static_cast<int>(slot - object->address()));
3218 } 3227 }
3219 break; 3228 break;
3220 } 3229 }
3221 } 3230 }
3222 UNREACHABLE(); 3231 UNREACHABLE();
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
4742 SlotsBuffer* buffer = *buffer_address; 4751 SlotsBuffer* buffer = *buffer_address;
4743 while (buffer != NULL) { 4752 while (buffer != NULL) {
4744 SlotsBuffer* next_buffer = buffer->next(); 4753 SlotsBuffer* next_buffer = buffer->next();
4745 DeallocateBuffer(buffer); 4754 DeallocateBuffer(buffer);
4746 buffer = next_buffer; 4755 buffer = next_buffer;
4747 } 4756 }
4748 *buffer_address = NULL; 4757 *buffer_address = NULL;
4749 } 4758 }
4750 } // namespace internal 4759 } // namespace internal
4751 } // namespace v8 4760 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/objects-visiting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698