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,14 +455,16 @@ void VirtualFrame::Enter() { ...@@ -455,14 +455,16 @@ void VirtualFrame::Enter() {
Comment cmnt(masm(), "[ Enter JS frame"); Comment cmnt(masm(), "[ Enter JS frame");
#ifdef DEBUG #ifdef DEBUG
// Verify that edi contains a JS function. The following code if (FLAG_debug_code) {
// relies on eax being available for use. // Verify that edi contains a JS function. The following code
__ test(edi, Immediate(kSmiTagMask)); // relies on eax being available for use.
__ Check(not_zero, __ test(edi, Immediate(kSmiTagMask));
"VirtualFrame::Enter - edi is not a function (smi check)."); __ Check(not_zero,
__ CmpObjectType(edi, JS_FUNCTION_TYPE, eax); "VirtualFrame::Enter - edi is not a function (smi check).");
__ Check(equal, __ CmpObjectType(edi, JS_FUNCTION_TYPE, eax);
"VirtualFrame::Enter - edi is not a function (map check)."); __ Check(equal,
"VirtualFrame::Enter - edi is not a function (map check).");
}
#endif #endif
EmitPush(ebp); EmitPush(ebp);
......
...@@ -63,14 +63,16 @@ void VirtualFrame::Enter() { ...@@ -63,14 +63,16 @@ void VirtualFrame::Enter() {
Comment cmnt(masm(), "[ Enter JS frame"); Comment cmnt(masm(), "[ Enter JS frame");
#ifdef DEBUG #ifdef DEBUG
// Verify that rdi contains a JS function. The following code if (FLAG_debug_code) {
// relies on rax being available for use. // Verify that rdi contains a JS function. The following code
Condition not_smi = masm()->CheckNotSmi(rdi); // relies on rax being available for use.
__ Check(not_smi, Condition not_smi = masm()->CheckNotSmi(rdi);
"VirtualFrame::Enter - rdi is not a function (smi check)."); __ Check(not_smi,
__ CmpObjectType(rdi, JS_FUNCTION_TYPE, rax); "VirtualFrame::Enter - rdi is not a function (smi check).");
__ Check(equal, __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rax);
"VirtualFrame::Enter - rdi is not a function (map check)."); __ Check(equal,
"VirtualFrame::Enter - rdi is not a function (map check).");
}
#endif #endif
EmitPush(rbp); 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