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

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

Issue 172233003: Clean up weak objects in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments and fix whitespace Created 6 years, 10 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/lithium-codegen.cc ('k') | src/mips/lithium-codegen-mips.cc » ('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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 for (Object** current = start; current < end; current++) { 85 for (Object** current = start; current < end; current++) {
86 if ((*current)->IsHeapObject()) { 86 if ((*current)->IsHeapObject()) {
87 HeapObject* object = HeapObject::cast(*current); 87 HeapObject* object = HeapObject::cast(*current);
88 CHECK(heap_->mark_compact_collector()->IsMarked(object)); 88 CHECK(heap_->mark_compact_collector()->IsMarked(object));
89 } 89 }
90 } 90 }
91 } 91 }
92 92
93 void VisitEmbeddedPointer(RelocInfo* rinfo) { 93 void VisitEmbeddedPointer(RelocInfo* rinfo) {
94 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); 94 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT);
95 if (!Code::IsWeakEmbeddedObject(rinfo->host()->kind(), 95 if (!rinfo->host()->IsWeakObject(rinfo->target_object())) {
96 rinfo->target_object())) {
97 Object* p = rinfo->target_object(); 96 Object* p = rinfo->target_object();
98 VisitPointer(&p); 97 VisitPointer(&p);
99 } 98 }
100 } 99 }
101 100
102 void VisitCell(RelocInfo* rinfo) { 101 void VisitCell(RelocInfo* rinfo) {
103 Code* code = rinfo->host(); 102 Code* code = rinfo->host();
104 ASSERT(rinfo->rmode() == RelocInfo::CELL); 103 ASSERT(rinfo->rmode() == RelocInfo::CELL);
105 if (!Code::IsWeakEmbeddedObject(code->kind(), rinfo->target_cell())) { 104 if (!code->IsWeakObject(rinfo->target_cell())) {
106 ObjectVisitor::VisitCell(rinfo); 105 ObjectVisitor::VisitCell(rinfo);
107 } 106 }
108 } 107 }
109 108
110 private: 109 private:
111 Heap* heap_; 110 Heap* heap_;
112 }; 111 };
113 112
114 113
115 static void VerifyMarking(Heap* heap, Address bottom, Address top) { 114 static void VerifyMarking(Heap* heap, Address bottom, Address top) {
(...skipping 4331 matching lines...) Expand 10 before | Expand all | Expand 10 after
4447 while (buffer != NULL) { 4446 while (buffer != NULL) {
4448 SlotsBuffer* next_buffer = buffer->next(); 4447 SlotsBuffer* next_buffer = buffer->next();
4449 DeallocateBuffer(buffer); 4448 DeallocateBuffer(buffer);
4450 buffer = next_buffer; 4449 buffer = next_buffer;
4451 } 4450 }
4452 *buffer_address = NULL; 4451 *buffer_address = NULL;
4453 } 4452 }
4454 4453
4455 4454
4456 } } // namespace v8::internal 4455 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/lithium-codegen.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698