Reviewers: Vyacheslav Egorov,

Message:
NewGC broke the compile option "gdbjit=on" due to undefined variable. This is my shot at fixing it. However, when compiling in debug mode with gdbjit, running

gdb --arg ./d8_g -e "while(true){i = Math.random()}" --gdbjit

breaking into gdb with ^C, gdbjit seems to do its job. But when restarting the
run in gdb once or twice again, gdb crashes...

Description:
Fix for gdbjit.


Please review this at http://codereview.chromium.org/8017001/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/mark-compact.cc


Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 2378a5e0a4e0690ab99a5701125bc9d331d846c4..2b26236162188b3a700d44e996f76a82d3b6fe42 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -483,15 +483,16 @@ void MarkCompactCollector::Prepare(GCTracer* tracer) {
   ASSERT(!FLAG_always_compact || !FLAG_never_compact);

   if (collect_maps_) CreateBackPointers();
+  bool gdbjit = false;
 #ifdef ENABLE_GDB_JIT_INTERFACE
   if (FLAG_gdbjit) {
     // If GDBJIT interface is active disable compaction.
-    compacting_collection_ = false;
+    gdbjit = true;
   }
 #endif

   // Clear marking bits for precise sweeping to collect all garbage.
-  if (was_marked_incrementally_ && PreciseSweepingRequired()) {
+  if ((was_marked_incrementally_ && PreciseSweepingRequired()) || gdbjit) {
     heap()->incremental_marking()->Abort();
     ClearMarkbits(heap_);
     AbortCompaction();


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to