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

Unified Diff: src/liveedit.cc

Issue 995006: Explicitly declare temporary cooked frames state (Closed)
Patch Set: merge, codereview Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/frames.cc ('k') | src/top.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/liveedit.cc
diff --git a/src/liveedit.cc b/src/liveedit.cc
index 4533f9c7ddab854446ab33ece7b4ed93685d2587..55308ab67ce4d1043046618351b57295c929e640 100644
--- a/src/liveedit.cc
+++ b/src/liveedit.cc
@@ -391,6 +391,26 @@ class ReferenceCollectorVisitor : public ObjectVisitor {
ZoneList<RelocInfo> reloc_infos_;
};
+
+class FrameCookingThreadVisitor : public ThreadVisitor {
+ public:
+ void VisitThread(ThreadLocalTop* top) {
+ StackFrame::CookFramesForThread(top);
+ }
+};
+
+class FrameUncookingThreadVisitor : public ThreadVisitor {
+ public:
+ void VisitThread(ThreadLocalTop* top) {
+ StackFrame::UncookFramesForThread(top);
+ }
+};
+
+static void IterateAllThreads(ThreadVisitor* visitor) {
+ Top::IterateThread(visitor);
+ ThreadManager::IterateThreads(visitor);
+}
+
// Finds all references to original and replaces them with substitution.
static void ReplaceCodeObject(Code* original, Code* substitution) {
ASSERT(!Heap::InNewSpace(substitution));
@@ -405,9 +425,15 @@ static void ReplaceCodeObject(Code* original, Code* substitution) {
// Iterate over all roots. Stack frames may have pointer into original code,
// so temporary replace the pointers with offset numbers
// in prologue/epilogue.
- ThreadManager::MarkCompactPrologue(true);
- Heap::IterateStrongRoots(&visitor, VISIT_ALL);
- ThreadManager::MarkCompactEpilogue(true);
+ {
+ FrameCookingThreadVisitor cooking_visitor;
+ IterateAllThreads(&cooking_visitor);
+
+ Heap::IterateStrongRoots(&visitor, VISIT_ALL);
+
+ FrameUncookingThreadVisitor uncooking_visitor;
+ IterateAllThreads(&uncooking_visitor);
+ }
// Now iterate over all pointers of all objects, including code_target
// implicit pointers.
« no previous file with comments | « src/frames.cc ('k') | src/top.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698