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

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

Issue 20723002: Do not allow external strings in old pointer space. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updating cctest.status Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | test/cctest/cctest.status » ('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 // 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 2725 matching lines...) Expand 10 before | Expand all | Expand 10 after
2736 void MarkCompactCollector::MigrateObject(Address dst, 2736 void MarkCompactCollector::MigrateObject(Address dst,
2737 Address src, 2737 Address src,
2738 int size, 2738 int size,
2739 AllocationSpace dest) { 2739 AllocationSpace dest) {
2740 HEAP_PROFILE(heap(), ObjectMoveEvent(src, dst)); 2740 HEAP_PROFILE(heap(), ObjectMoveEvent(src, dst));
2741 // TODO(hpayer): Replace that check with an assert. 2741 // TODO(hpayer): Replace that check with an assert.
2742 CHECK(dest != LO_SPACE && size <= Page::kMaxNonCodeHeapObjectSize); 2742 CHECK(dest != LO_SPACE && size <= Page::kMaxNonCodeHeapObjectSize);
2743 if (dest == OLD_POINTER_SPACE) { 2743 if (dest == OLD_POINTER_SPACE) {
2744 // TODO(hpayer): Replace this check with an assert. 2744 // TODO(hpayer): Replace this check with an assert.
2745 HeapObject* heap_object = HeapObject::FromAddress(src); 2745 HeapObject* heap_object = HeapObject::FromAddress(src);
2746 CHECK(heap_object->IsExternalString() || 2746 CHECK(heap_->TargetSpace(heap_object) == heap_->old_pointer_space());
2747 heap_->TargetSpace(heap_object) == heap_->old_pointer_space());
2748 Address src_slot = src; 2747 Address src_slot = src;
2749 Address dst_slot = dst; 2748 Address dst_slot = dst;
2750 ASSERT(IsAligned(size, kPointerSize)); 2749 ASSERT(IsAligned(size, kPointerSize));
2751 2750
2752 for (int remaining = size / kPointerSize; remaining > 0; remaining--) { 2751 for (int remaining = size / kPointerSize; remaining > 0; remaining--) {
2753 Object* value = Memory::Object_at(src_slot); 2752 Object* value = Memory::Object_at(src_slot);
2754 2753
2755 Memory::Object_at(dst_slot) = value; 2754 Memory::Object_at(dst_slot) = value;
2756 2755
2757 if (heap_->InNewSpace(value)) { 2756 if (heap_->InNewSpace(value)) {
(...skipping 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after
4338 while (buffer != NULL) { 4337 while (buffer != NULL) {
4339 SlotsBuffer* next_buffer = buffer->next(); 4338 SlotsBuffer* next_buffer = buffer->next();
4340 DeallocateBuffer(buffer); 4339 DeallocateBuffer(buffer);
4341 buffer = next_buffer; 4340 buffer = next_buffer;
4342 } 4341 }
4343 *buffer_address = NULL; 4342 *buffer_address = NULL;
4344 } 4343 }
4345 4344
4346 4345
4347 } } // namespace v8::internal 4346 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698