Small optimization
authorNathan Binkert <binkertn@umich.edu>
Tue, 14 Oct 2003 02:19:43 +0000 (22:19 -0400)
committerNathan Binkert <binkertn@umich.edu>
Tue, 14 Oct 2003 02:19:43 +0000 (22:19 -0400)
cpu/pc_event.cc:
cpu/pc_event.hh:
    Do a quick check to see if there is anything to service
    before the function is called

--HG--
extra : convert_revision : 16e9b6284ece8b7a53ccf0ca200fab9ba780c50c

cpu/pc_event.cc
cpu/pc_event.hh

index 7b72f5c088521035b30b90b111c379ecd1aa9b5a..8c584a4920a26fae2ca6db0672c4c2be0c88efdb 100644 (file)
@@ -84,7 +84,7 @@ PCEventQueue::schedule(PCEvent *event)
 }
 
 bool
-PCEventQueue::service(ExecContext *xc)
+PCEventQueue::doService(ExecContext *xc)
 {
     Addr pc = xc->regs.pc;
     int serviced = 0;
index 08c6fa59aceb9f19472fb5845b1661ed173654a0..d452bc03045af27350c4b340ab6a169317f4cd2e 100644 (file)
@@ -98,13 +98,21 @@ class PCEventQueue
   protected:
     map_t pc_map;
 
+    bool doService(ExecContext *xc);
+
   public:
     PCEventQueue();
     ~PCEventQueue();
 
     bool remove(PCEvent *event);
     bool schedule(PCEvent *event);
-    bool service(ExecContext *xc);
+    bool service(ExecContext *xc)
+    {
+        if (pc_map.empty())
+            return false;
+
+        return doService(xc);
+    }
 
     range_t equal_range(Addr pc);
     range_t equal_range(PCEvent *event) { return equal_range(event->pc()); }