Revision: 3036
Author: [email protected]
Date: Thu Oct  8 04:49:58 2009
Log: Guard the debug check at the start of every JS function with
--debug-code so it is not normally compiled in debug builds.

Review URL: http://codereview.chromium.org/268014
http://code.google.com/p/v8/source/detail?r=3036

Modified:
  /branches/bleeding_edge/src/ia32/virtual-frame-ia32.cc
  /branches/bleeding_edge/src/x64/virtual-frame-x64.cc

=======================================
--- /branches/bleeding_edge/src/ia32/virtual-frame-ia32.cc      Wed Oct  7  
07:55:41 2009
+++ /branches/bleeding_edge/src/ia32/virtual-frame-ia32.cc      Thu Oct  8  
04:49:58 2009
@@ -455,14 +455,16 @@
    Comment cmnt(masm(), "[ Enter JS frame");

  #ifdef DEBUG
-  // Verify that edi contains a JS function.  The following code
-  // relies on eax being available for use.
-  __ test(edi, Immediate(kSmiTagMask));
-  __ Check(not_zero,
-           "VirtualFrame::Enter - edi is not a function (smi check).");
-  __ CmpObjectType(edi, JS_FUNCTION_TYPE, eax);
-  __ Check(equal,
-           "VirtualFrame::Enter - edi is not a function (map check).");
+  if (FLAG_debug_code) {
+    // Verify that edi contains a JS function.  The following code
+    // relies on eax being available for use.
+    __ test(edi, Immediate(kSmiTagMask));
+    __ Check(not_zero,
+             "VirtualFrame::Enter - edi is not a function (smi check).");
+    __ CmpObjectType(edi, JS_FUNCTION_TYPE, eax);
+    __ Check(equal,
+             "VirtualFrame::Enter - edi is not a function (map check).");
+  }
  #endif

    EmitPush(ebp);
=======================================
--- /branches/bleeding_edge/src/x64/virtual-frame-x64.cc        Wed Oct  7  
07:55:41 2009
+++ /branches/bleeding_edge/src/x64/virtual-frame-x64.cc        Thu Oct  8  
04:49:58 2009
@@ -63,14 +63,16 @@
    Comment cmnt(masm(), "[ Enter JS frame");

  #ifdef DEBUG
-  // Verify that rdi contains a JS function.  The following code
-  // relies on rax being available for use.
-  Condition not_smi = masm()->CheckNotSmi(rdi);
-  __ Check(not_smi,
-           "VirtualFrame::Enter - rdi is not a function (smi check).");
-  __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rax);
-  __ Check(equal,
-           "VirtualFrame::Enter - rdi is not a function (map check).");
+  if (FLAG_debug_code) {
+    // Verify that rdi contains a JS function.  The following code
+    // relies on rax being available for use.
+    Condition not_smi = masm()->CheckNotSmi(rdi);
+    __ Check(not_smi,
+             "VirtualFrame::Enter - rdi is not a function (smi check).");
+    __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rax);
+    __ Check(equal,
+             "VirtualFrame::Enter - rdi is not a function (map check).");
+  }
  #endif

    EmitPush(rbp);

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

Reply via email to