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

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

Issue 71163006: Merge bleeding_edge r17376:17693. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Fix all.gyp Created 7 years, 1 month 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/macros.py ('k') | src/math.js » ('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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 HeapObject* object = HeapObject::cast(*current); 86 HeapObject* object = HeapObject::cast(*current);
87 CHECK(heap_->mark_compact_collector()->IsMarked(object)); 87 CHECK(heap_->mark_compact_collector()->IsMarked(object));
88 } 88 }
89 } 89 }
90 } 90 }
91 91
92 void VisitEmbeddedPointer(RelocInfo* rinfo) { 92 void VisitEmbeddedPointer(RelocInfo* rinfo) {
93 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); 93 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT);
94 if (!Code::IsWeakEmbeddedObject(rinfo->host()->kind(), 94 if (!Code::IsWeakEmbeddedObject(rinfo->host()->kind(),
95 rinfo->target_object())) { 95 rinfo->target_object())) {
96 VisitPointer(rinfo->target_object_address()); 96 Object* p = rinfo->target_object();
97 VisitPointer(&p);
97 } 98 }
98 } 99 }
99 100
100 private: 101 private:
101 Heap* heap_; 102 Heap* heap_;
102 }; 103 };
103 104
104 105
105 static void VerifyMarking(Heap* heap, Address bottom, Address top) { 106 static void VerifyMarking(Heap* heap, Address bottom, Address top) {
106 VerifyMarkingVisitor visitor(heap); 107 VerifyMarkingVisitor visitor(heap);
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 1643
1643 template<> 1644 template<>
1644 class MarkCompactMarkingVisitor::ObjectStatsTracker< 1645 class MarkCompactMarkingVisitor::ObjectStatsTracker<
1645 MarkCompactMarkingVisitor::kVisitCode> { 1646 MarkCompactMarkingVisitor::kVisitCode> {
1646 public: 1647 public:
1647 static inline void Visit(Map* map, HeapObject* obj) { 1648 static inline void Visit(Map* map, HeapObject* obj) {
1648 Heap* heap = map->GetHeap(); 1649 Heap* heap = map->GetHeap();
1649 int object_size = obj->Size(); 1650 int object_size = obj->Size();
1650 ASSERT(map->instance_type() == CODE_TYPE); 1651 ASSERT(map->instance_type() == CODE_TYPE);
1651 Code* code_obj = Code::cast(obj); 1652 Code* code_obj = Code::cast(obj);
1652 heap->RecordCodeSubTypeStats(code_obj->kind(), code_obj->GetAge(), 1653 heap->RecordCodeSubTypeStats(code_obj->kind(), code_obj->GetRawAge(),
1653 object_size); 1654 object_size);
1654 ObjectStatsVisitBase(kVisitCode, map, obj); 1655 ObjectStatsVisitBase(kVisitCode, map, obj);
1655 } 1656 }
1656 }; 1657 };
1657 1658
1658 1659
1659 template<> 1660 template<>
1660 class MarkCompactMarkingVisitor::ObjectStatsTracker< 1661 class MarkCompactMarkingVisitor::ObjectStatsTracker<
1661 MarkCompactMarkingVisitor::kVisitSharedFunctionInfo> { 1662 MarkCompactMarkingVisitor::kVisitSharedFunctionInfo> {
1662 public: 1663 public:
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2931 bool MarkCompactCollector::TryPromoteObject(HeapObject* object, 2932 bool MarkCompactCollector::TryPromoteObject(HeapObject* object,
2932 int object_size) { 2933 int object_size) {
2933 // TODO(hpayer): Replace that check with an assert. 2934 // TODO(hpayer): Replace that check with an assert.
2934 CHECK(object_size <= Page::kMaxNonCodeHeapObjectSize); 2935 CHECK(object_size <= Page::kMaxNonCodeHeapObjectSize);
2935 2936
2936 OldSpace* target_space = heap()->TargetSpace(object); 2937 OldSpace* target_space = heap()->TargetSpace(object);
2937 2938
2938 ASSERT(target_space == heap()->old_pointer_space() || 2939 ASSERT(target_space == heap()->old_pointer_space() ||
2939 target_space == heap()->old_data_space()); 2940 target_space == heap()->old_data_space());
2940 Object* result; 2941 Object* result;
2941 MaybeObject* maybe_result = target_space->AllocateRaw( 2942 MaybeObject* maybe_result = target_space->AllocateRaw(object_size);
2942 object_size,
2943 PagedSpace::MOVE_OBJECT);
2944 if (maybe_result->ToObject(&result)) { 2943 if (maybe_result->ToObject(&result)) {
2945 HeapObject* target = HeapObject::cast(result); 2944 HeapObject* target = HeapObject::cast(result);
2946 MigrateObject(target->address(), 2945 MigrateObject(target->address(),
2947 object->address(), 2946 object->address(),
2948 object_size, 2947 object_size,
2949 target_space->identity()); 2948 target_space->identity());
2950 heap()->mark_compact_collector()->tracer()-> 2949 heap()->mark_compact_collector()->tracer()->
2951 increment_promoted_objects_size(object_size); 2950 increment_promoted_objects_size(object_size);
2952 return true; 2951 return true;
2953 } 2952 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
3006 if (*cell == 0) continue; 3005 if (*cell == 0) continue;
3007 3006
3008 int live_objects = MarkWordToObjectStarts(*cell, offsets); 3007 int live_objects = MarkWordToObjectStarts(*cell, offsets);
3009 for (int i = 0; i < live_objects; i++) { 3008 for (int i = 0; i < live_objects; i++) {
3010 Address object_addr = cell_base + offsets[i] * kPointerSize; 3009 Address object_addr = cell_base + offsets[i] * kPointerSize;
3011 HeapObject* object = HeapObject::FromAddress(object_addr); 3010 HeapObject* object = HeapObject::FromAddress(object_addr);
3012 ASSERT(Marking::IsBlack(Marking::MarkBitFrom(object))); 3011 ASSERT(Marking::IsBlack(Marking::MarkBitFrom(object)));
3013 3012
3014 int size = object->Size(); 3013 int size = object->Size();
3015 3014
3016 MaybeObject* target = space->AllocateRaw(size, PagedSpace::MOVE_OBJECT); 3015 MaybeObject* target = space->AllocateRaw(size);
3017 if (target->IsFailure()) { 3016 if (target->IsFailure()) {
3018 // OS refused to give us memory. 3017 // OS refused to give us memory.
3019 V8::FatalProcessOutOfMemory("Evacuation"); 3018 V8::FatalProcessOutOfMemory("Evacuation");
3020 return; 3019 return;
3021 } 3020 }
3022 3021
3023 Object* target_object = target->ToObjectUnchecked(); 3022 Object* target_object = target->ToObjectUnchecked();
3024 3023
3025 MigrateObject(HeapObject::cast(target_object)->address(), 3024 MigrateObject(HeapObject::cast(target_object)->address(),
3026 object_addr, 3025 object_addr,
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
4352 while (buffer != NULL) { 4351 while (buffer != NULL) {
4353 SlotsBuffer* next_buffer = buffer->next(); 4352 SlotsBuffer* next_buffer = buffer->next();
4354 DeallocateBuffer(buffer); 4353 DeallocateBuffer(buffer);
4355 buffer = next_buffer; 4354 buffer = next_buffer;
4356 } 4355 }
4357 *buffer_address = NULL; 4356 *buffer_address = NULL;
4358 } 4357 }
4359 4358
4360 4359
4361 } } // namespace v8::internal 4360 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/macros.py ('k') | src/math.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698