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

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 store buffer. 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
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 2741 matching lines...) Expand 10 before | Expand all | Expand 10 after
2752 } 2752 }
2753 2753
2754 2754
2755 void MarkCompactCollector::MigrateObjectMixed(HeapObject* dst, HeapObject* src, 2755 void MarkCompactCollector::MigrateObjectMixed(HeapObject* dst, HeapObject* src,
2756 int size) { 2756 int size) {
2757 if (src->IsFixedTypedArrayBase()) { 2757 if (src->IsFixedTypedArrayBase()) {
2758 heap()->MoveBlock(dst->address(), src->address(), size); 2758 heap()->MoveBlock(dst->address(), src->address(), size);
2759 Address base_pointer_slot = 2759 Address base_pointer_slot =
2760 dst->address() + FixedTypedArrayBase::kBasePointerOffset; 2760 dst->address() + FixedTypedArrayBase::kBasePointerOffset;
2761 RecordMigratedSlot(Memory::Object_at(base_pointer_slot), base_pointer_slot); 2761 RecordMigratedSlot(Memory::Object_at(base_pointer_slot), base_pointer_slot);
2762 } else if (src->IsBytecodeArray()) {
2763 heap()->MoveBlock(dst->address(), src->address(), size);
2764 Address constant_pool_slot =
2765 dst->address() + BytecodeArray::kConstantPoolOffset;
2766 RecordMigratedSlot(Memory::Object_at(constant_pool_slot),
2767 constant_pool_slot);
2762 } else if (FLAG_unbox_double_fields) { 2768 } else if (FLAG_unbox_double_fields) {
2763 Address dst_addr = dst->address(); 2769 Address dst_addr = dst->address();
2764 Address src_addr = src->address(); 2770 Address src_addr = src->address();
2765 Address src_slot = src_addr; 2771 Address src_slot = src_addr;
2766 Address dst_slot = dst_addr; 2772 Address dst_slot = dst_addr;
2767 2773
2768 LayoutDescriptorHelper helper(src->map()); 2774 LayoutDescriptorHelper helper(src->map());
2769 DCHECK(!helper.all_fields_tagged()); 2775 DCHECK(!helper.all_fields_tagged());
2770 for (int remaining = size / kPointerSize; remaining > 0; remaining--) { 2776 for (int remaining = size / kPointerSize; remaining > 0; remaining--) {
2771 Object* value = Memory::Object_at(src_slot); 2777 Object* value = Memory::Object_at(src_slot);
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
3175 if (type == MAP_TYPE || type == CODE_TYPE) return true; 3181 if (type == MAP_TYPE || type == CODE_TYPE) return true;
3176 3182
3177 // Consider slots in objects that contain ONLY raw data as invalid. 3183 // Consider slots in objects that contain ONLY raw data as invalid.
3178 return false; 3184 return false;
3179 } 3185 }
3180 3186
3181 case HeapObjectContents::kMixedValues: { 3187 case HeapObjectContents::kMixedValues: {
3182 if (object->IsFixedTypedArrayBase()) { 3188 if (object->IsFixedTypedArrayBase()) {
3183 return static_cast<int>(slot - object->address()) == 3189 return static_cast<int>(slot - object->address()) ==
3184 FixedTypedArrayBase::kBasePointerOffset; 3190 FixedTypedArrayBase::kBasePointerOffset;
3191 } else if (object->IsBytecodeArray()) {
3192 return static_cast<int>(slot - object->address()) ==
3193 BytecodeArray::kConstantPoolOffset;
3185 } else if (FLAG_unbox_double_fields) { 3194 } else if (FLAG_unbox_double_fields) {
3186 // Filter out slots that happen to point to unboxed double fields. 3195 // Filter out slots that happen to point to unboxed double fields.
3187 LayoutDescriptorHelper helper(object->map()); 3196 LayoutDescriptorHelper helper(object->map());
3188 DCHECK(!helper.all_fields_tagged()); 3197 DCHECK(!helper.all_fields_tagged());
3189 return helper.IsTagged(static_cast<int>(slot - object->address())); 3198 return helper.IsTagged(static_cast<int>(slot - object->address()));
3190 } 3199 }
3191 break; 3200 break;
3192 } 3201 }
3193 } 3202 }
3194 UNREACHABLE(); 3203 UNREACHABLE();
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
4696 SlotsBuffer* buffer = *buffer_address; 4705 SlotsBuffer* buffer = *buffer_address;
4697 while (buffer != NULL) { 4706 while (buffer != NULL) {
4698 SlotsBuffer* next_buffer = buffer->next(); 4707 SlotsBuffer* next_buffer = buffer->next();
4699 DeallocateBuffer(buffer); 4708 DeallocateBuffer(buffer);
4700 buffer = next_buffer; 4709 buffer = next_buffer;
4701 } 4710 }
4702 *buffer_address = NULL; 4711 *buffer_address = NULL;
4703 } 4712 }
4704 } // namespace internal 4713 } // namespace internal
4705 } // namespace v8 4714 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/objects-visiting.h » ('j') | test/cctest/test-heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698