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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3036 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b0bc50aa
......@@ -455,6 +455,7 @@ void VirtualFrame::Enter() {
Comment cmnt(masm(), "[ Enter JS frame");
#ifdef DEBUG
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));
......@@ -463,6 +464,7 @@ void VirtualFrame::Enter() {
__ CmpObjectType(edi, JS_FUNCTION_TYPE, eax);
__ Check(equal,
"VirtualFrame::Enter - edi is not a function (map check).");
}
#endif
EmitPush(ebp);
......
......@@ -63,6 +63,7 @@ void VirtualFrame::Enter() {
Comment cmnt(masm(), "[ Enter JS frame");
#ifdef DEBUG
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);
......@@ -71,6 +72,7 @@ void VirtualFrame::Enter() {
__ CmpObjectType(rdi, JS_FUNCTION_TYPE, rax);
__ Check(equal,
"VirtualFrame::Enter - rdi is not a function (map check).");
}
#endif
EmitPush(rbp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment