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

Side by Side Diff: src/heap.cc

Issue 2836021: Only flush code when there are no heap allocated locals in the scopeinfo.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 6 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 | src/scopeinfo.h » ('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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 2246 matching lines...) Expand 10 before | Expand all | Expand 10 after
2257 // Make sure we are not referencing the code from the stack. 2257 // Make sure we are not referencing the code from the stack.
2258 for (StackFrameIterator it; !it.done(); it.Advance()) { 2258 for (StackFrameIterator it; !it.done(); it.Advance()) {
2259 if (function_info->code()->contains(it.frame()->pc())) return; 2259 if (function_info->code()->contains(it.frame()->pc())) return;
2260 } 2260 }
2261 // Iterate the archived stacks in all threads to check if 2261 // Iterate the archived stacks in all threads to check if
2262 // the code is referenced. 2262 // the code is referenced.
2263 FlushingStackVisitor threadvisitor(function_info->code()); 2263 FlushingStackVisitor threadvisitor(function_info->code());
2264 ThreadManager::IterateArchivedThreads(&threadvisitor); 2264 ThreadManager::IterateArchivedThreads(&threadvisitor);
2265 if (threadvisitor.FoundCode()) return; 2265 if (threadvisitor.FoundCode()) return;
2266 2266
2267 // Check that there are heap allocated locals in the scopeinfo. If
2268 // there is, we are potentially using eval and need the scopeinfo
2269 // for variable resolution.
2270 if (ScopeInfo<>::HasHeapAllocatedLocals(function_info->code()))
2271 return;
2272
2267 HandleScope scope; 2273 HandleScope scope;
2268 // Compute the lazy compilable version of the code. 2274 // Compute the lazy compilable version of the code.
2269 function_info->set_code(*ComputeLazyCompile(function_info->length())); 2275 function_info->set_code(*ComputeLazyCompile(function_info->length()));
2270 } 2276 }
2271 2277
2272 2278
2273 void Heap::FlushCode() { 2279 void Heap::FlushCode() {
2274 #ifdef ENABLE_DEBUGGER_SUPPORT 2280 #ifdef ENABLE_DEBUGGER_SUPPORT
2275 // Do not flush code if the debugger is loaded or there are breakpoints. 2281 // Do not flush code if the debugger is loaded or there are breakpoints.
2276 if (Debug::IsLoaded() || Debug::has_break_points()) return; 2282 if (Debug::IsLoaded() || Debug::has_break_points()) return;
(...skipping 2486 matching lines...) Expand 10 before | Expand all | Expand 10 after
4763 void ExternalStringTable::TearDown() { 4769 void ExternalStringTable::TearDown() {
4764 new_space_strings_.Free(); 4770 new_space_strings_.Free();
4765 old_space_strings_.Free(); 4771 old_space_strings_.Free();
4766 } 4772 }
4767 4773
4768 4774
4769 List<Object*> ExternalStringTable::new_space_strings_; 4775 List<Object*> ExternalStringTable::new_space_strings_;
4770 List<Object*> ExternalStringTable::old_space_strings_; 4776 List<Object*> ExternalStringTable::old_space_strings_;
4771 4777
4772 } } // namespace v8::internal 4778 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/scopeinfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698