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

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

Issue 18592006: Don't return frame by reference in ProcessTopOptimizedFrame. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « no previous file | no next file » | 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 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2174 isolate()->global_handles()->IterateObjectGroups( 2174 isolate()->global_handles()->IterateObjectGroups(
2175 visitor, &IsUnmarkedHeapObjectWithHeap); 2175 visitor, &IsUnmarkedHeapObjectWithHeap);
2176 MarkImplicitRefGroups(); 2176 MarkImplicitRefGroups();
2177 ProcessWeakMaps(); 2177 ProcessWeakMaps();
2178 work_to_do = !marking_deque_.IsEmpty(); 2178 work_to_do = !marking_deque_.IsEmpty();
2179 ProcessMarkingDeque(); 2179 ProcessMarkingDeque();
2180 } 2180 }
2181 } 2181 }
2182 2182
2183 2183
2184 static StackFrame* TopOptimizedFrame(Isolate* isolate) {
2185 for (StackFrameIterator it(isolate, isolate->thread_local_top());
2186 !it.done(); it.Advance()) {
2187 if (it.frame()->type() == StackFrame::JAVA_SCRIPT) {
2188 return NULL;
2189 }
2190 if (it.frame()->type() == StackFrame::OPTIMIZED) {
2191 return it.frame();
2192 }
2193 }
2194 return NULL;
2195 }
2196
2197
2198 void MarkCompactCollector::ProcessTopOptimizedFrame(ObjectVisitor* visitor) { 2184 void MarkCompactCollector::ProcessTopOptimizedFrame(ObjectVisitor* visitor) {
2199 StackFrame* frame = TopOptimizedFrame(isolate()); 2185 for (StackFrameIterator it(isolate(), isolate()->thread_local_top());
2200 if (frame != NULL) { 2186 !it.done(); it.Advance()) {
2201 Code* code = frame->LookupCode(); 2187 if (it.frame()->type() == StackFrame::JAVA_SCRIPT) {
2202 if (!code->CanDeoptAt(frame->pc())) { 2188 return;
2203 code->CodeIterateBody(visitor);
2204 } 2189 }
2205 ProcessMarkingDeque(); 2190 if (it.frame()->type() == StackFrame::OPTIMIZED) {
2191 Code* code = it.frame()->LookupCode();
2192 if (!code->CanDeoptAt(it.frame()->pc())) {
2193 code->CodeIterateBody(visitor);
2194 }
2195 ProcessMarkingDeque();
2196 return;
2197 }
2206 } 2198 }
2207 } 2199 }
2208 2200
2209 2201
2210 void MarkCompactCollector::MarkLiveObjects() { 2202 void MarkCompactCollector::MarkLiveObjects() {
2211 GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_MARK); 2203 GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_MARK);
2212 // The recursive GC marker detects when it is nearing stack overflow, 2204 // The recursive GC marker detects when it is nearing stack overflow,
2213 // and switches to a different marking system. JS interrupts interfere 2205 // and switches to a different marking system. JS interrupts interfere
2214 // with the C stack limit check. 2206 // with the C stack limit check.
2215 PostponeInterruptsScope postpone(isolate()); 2207 PostponeInterruptsScope postpone(isolate());
(...skipping 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after
4314 while (buffer != NULL) { 4306 while (buffer != NULL) {
4315 SlotsBuffer* next_buffer = buffer->next(); 4307 SlotsBuffer* next_buffer = buffer->next();
4316 DeallocateBuffer(buffer); 4308 DeallocateBuffer(buffer);
4317 buffer = next_buffer; 4309 buffer = next_buffer;
4318 } 4310 }
4319 *buffer_address = NULL; 4311 *buffer_address = NULL;
4320 } 4312 }
4321 4313
4322 4314
4323 } } // namespace v8::internal 4315 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698