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
This commit is contained in:
kmillikin@chromium.org 2009-10-08 11:49:58 +00:00
parent b0bc50aa85
commit 7efd193326
2 changed files with 20 additions and 16 deletions

View File

@ -455,14 +455,16 @@ void VirtualFrame::Enter() {
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);

View File

@ -63,14 +63,16 @@ void VirtualFrame::Enter() {
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);