]> git.lizzy.rs Git - rust.git/commitdiff
Merge commit 'jyasskin/work'
authorGraydon Hoare <graydon@mozilla.com>
Tue, 10 Aug 2010 20:26:00 +0000 (13:26 -0700)
committerGraydon Hoare <graydon@mozilla.com>
Tue, 10 Aug 2010 20:26:00 +0000 (13:26 -0700)
Conflicts:
src/rt/rust_dom.cpp
src/rt/rust_upcall.cpp

1  2 
src/Makefile
src/boot/me/layout.ml
src/boot/me/trans.ml
src/rt/rust.cpp
src/rt/rust_dom.cpp
src/rt/rust_dom.h
src/rt/rust_task.cpp
src/rt/rust_upcall.cpp

diff --cc src/Makefile
Simple merge
Simple merge
Simple merge
diff --cc src/rt/rust.cpp
Simple merge
index af1472520ba20c26e63972788a763cc6a705e3de,004a10275e46d1cbac83654f54d2cc57d64fae57..f7b8e97bd3ad8b9388ebf0ff07e103479a468d21
@@@ -4,10 -4,9 +4,11 @@@
  
  template class ptr_vec<rust_task>;
  
 +// Keeps track of all live domains, for debugging purposes.
 +array_list<rust_dom*> _live_domains;
  
- rust_dom::rust_dom(rust_srv *srv, rust_crate const *root_crate) :
+ rust_dom::rust_dom(rust_srv *srv, rust_crate const *root_crate,
+                    const char *name) :
      interrupt_flag(0),
      root_crate(root_crate),
      _log(srv, this),
      pthread_attr_setstacksize(&attr, 1024 * 1024);
      pthread_attr_setdetachstate(&attr, true);
  #endif
-     root_task = new (this) rust_task(this, NULL);
+     root_task = new (this) rust_task(this, NULL, name);
 +
 +    if (_live_domains.replace(NULL, this) == false) {
 +        _live_domains.append(this);
 +    }
  }
  
  static void
@@@ -49,18 -44,18 +51,18 @@@ rust_dom::delete_proxies() 
      rust_task *task;
      rust_proxy<rust_task> *task_proxy;
      while (_task_proxies.pop(&task, &task_proxy)) {
-         log(rust_log::TASK, "deleting proxy 0x%" PRIxPTR
-                             " in dom 0x%" PRIxPTR,
-                             task_proxy, task_proxy->dom);
+         log(rust_log::TASK,
 -            "deleting proxy %" PRIxPTR " in dom %s @0x%" PRIxPTR,
++            "deleting proxy 0x%" PRIxPTR " in dom %s 0x%" PRIxPTR,
+             task_proxy, task_proxy->dom->name, task_proxy->dom);
          delete task_proxy;
      }
  
      rust_port *port;
      rust_proxy<rust_port> *port_proxy;
      while (_port_proxies.pop(&port, &port_proxy)) {
-         log(rust_log::TASK, "deleting proxy 0x%" PRIxPTR
-                             " in dom 0x%" PRIxPTR,
-                             port_proxy, port_proxy->dom);
+         log(rust_log::TASK,
 -            "deleting proxy %" PRIxPTR " in dom %s @0x%" PRIxPTR,
++            "deleting proxy 0x%" PRIxPTR " in dom %s 0x%" PRIxPTR,
+             port_proxy, port_proxy->dom->name, port_proxy->dom);
          delete port_proxy;
      }
  }
@@@ -237,9 -232,11 +241,10 @@@ rust_dom::reap_dead_tasks() 
          rust_task *task = dead_tasks[i];
          if (task->ref_count == 0) {
              I(this, task->tasks_waiting_to_join.is_empty());
 -
              dead_tasks.swap_delete(task);
              log(rust_log::TASK,
-                 "deleting unreferenced dead task 0x%" PRIxPTR, task);
+                 "deleting unreferenced dead task %s @0x%" PRIxPTR,
+                 task->name, task);
              delete task;
              continue;
          }
@@@ -360,8 -352,8 +367,9 @@@ rust_dom::log_state() 
      if (!dead_tasks.is_empty()) {
          log(rust_log::TASK, "dead tasks:");
          for (size_t i = 0; i < dead_tasks.length(); i++) {
-             log(rust_log::TASK, "\t task: 0x%" PRIxPTR ", ref_count: %d",
-                 dead_tasks[i], dead_tasks[i]->ref_count);
 -            log(rust_log::TASK, "\t task: %s @0x%" PRIxPTR,
 -                dead_tasks[i]->name, dead_tasks[i]);
++            log(rust_log::TASK, "\t task: %s 0x%" PRIxPTR ", ref_count: %d",
++                dead_tasks[i], dead_tasks[i]->name,
++                dead_tasks[i]->ref_count);
          }
      }
  }
@@@ -405,14 -397,9 +414,15 @@@ rust_dom::start_main_loop(
          I(this, scheduled_task->running());
  
          log(rust_log::TASK,
-                  "activating task 0x%" PRIxPTR
-                  ", sp=0x%" PRIxPTR
-                  ", ref_count=%d"
-                  ", state: %s",
-                  (uintptr_t)scheduled_task,
-                  scheduled_task->rust_sp,
-                  scheduled_task->ref_count,
-                  scheduled_task->state_str());
 -                 "activating task %s @0x%" PRIxPTR ", sp=0x%" PRIxPTR,
 -            scheduled_task->name, (uintptr_t)scheduled_task,
 -            scheduled_task->rust_sp);
++            "activating task %s 0x%" PRIxPTR
++            ", sp=0x%" PRIxPTR
++            ", ref_count=%d"
++            ", state: %s",
++            scheduled_task->name,
++            (uintptr_t)scheduled_task,
++            scheduled_task->rust_sp,
++            scheduled_task->ref_count,
++            scheduled_task->state_str());
  
          interrupt_flag = 0;
  
Simple merge
Simple merge
index 039aa2fd972af31e63e0f85aa35033743cc53027,b0757e29e42f03934146c53cf35aa704fb1200eb..90d6f6d90372f03c672aff07524ffab62b447a20
@@@ -6,12 -6,11 +6,13 @@@
  #define LOG_UPCALL_ENTRY(task)                              \
      (task)->dom->get_log().reset_indent(0);                 \
      (task)->log(rust_log::UPCALL,                           \
-                 "> UPCALL %s - task: 0x%" PRIxPTR           \
 -                "> UPCALL %s - task: %s @0x%" PRIxPTR       \
 -                " retpc: x%" PRIxPTR,                       \
++                "> UPCALL %s - task: %s 0x%" PRIxPTR        \
 +                " retpc: x%" PRIxPTR                        \
 +                " ref_count: %d",                           \
                  __FUNCTION__,                               \
-                 (task), __builtin_return_address(0),        \
+                 (task)->name, (task),                       \
 -                __builtin_return_address(0));               \
++                __builtin_return_address(0),                \
 +                (task->ref_count));                         \
      (task)->dom->get_log().indent();
  #else
  #define LOG_UPCALL_ENTRY(task)                              \