Revision: 3652
Author: [email protected]
Date: Tue Jan 19 06:17:34 2010
Log: Add conditional counter update to IA-32
Review URL: http://codereview.chromium.org/554001
http://code.google.com/p/v8/source/detail?r=3652

Modified:
 /branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc
 /branches/bleeding_edge/src/ia32/macro-assembler-ia32.h

=======================================
--- /branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc Wed Jan 6 03:09:30 2010 +++ /branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc Tue Jan 19 06:17:34 2010
@@ -1452,6 +1452,36 @@
     }
   }
 }
+
+
+void MacroAssembler::IncrementCounter(Condition cc,
+                                      StatsCounter* counter,
+                                      int value) {
+  ASSERT(value > 0);
+  if (FLAG_native_code_counters && counter->Enabled()) {
+    Label skip;
+    j(NegateCondition(cc), &skip);
+    pushfd();
+    IncrementCounter(counter, value);
+    popfd();
+    bind(&skip);
+  }
+}
+
+
+void MacroAssembler::DecrementCounter(Condition cc,
+                                      StatsCounter* counter,
+                                      int value) {
+  ASSERT(value > 0);
+  if (FLAG_native_code_counters && counter->Enabled()) {
+    Label skip;
+    j(NegateCondition(cc), &skip);
+    pushfd();
+    DecrementCounter(counter, value);
+    popfd();
+    bind(&skip);
+  }
+}


 void MacroAssembler::Assert(Condition cc, const char* msg) {
=======================================
--- /branches/bleeding_edge/src/ia32/macro-assembler-ia32.h Tue Jan 12 00:48:26 2010 +++ /branches/bleeding_edge/src/ia32/macro-assembler-ia32.h Tue Jan 19 06:17:34 2010
@@ -392,6 +392,8 @@
   void SetCounter(StatsCounter* counter, int value);
   void IncrementCounter(StatsCounter* counter, int value);
   void DecrementCounter(StatsCounter* counter, int value);
+  void IncrementCounter(Condition cc, StatsCounter* counter, int value);
+  void DecrementCounter(Condition cc, StatsCounter* counter, int value);


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

Reply via email to