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