Reviewers: Mads Ager, Description: Checking and reporting for stack overflow in the right places.
Please review this at http://codereview.chromium.org/12986 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/compiler.cc Index: src/compiler.cc =================================================================== --- src/compiler.cc (revision 919) +++ src/compiler.cc (working copy) @@ -74,11 +74,6 @@ // Generate code and return it. Handle<Code> result = CodeGenerator::MakeCode(literal, script, is_eval); - // Check for stack-overflow exception. - if (result.is_null()) { - Top::StackOverflow(); - Top::ReportPendingMessages(); - } return result; } @@ -123,6 +118,8 @@ // Check for stack-overflow exceptions. if (code.is_null()) { + Top::StackOverflow(); + Top::ReportPendingMessages(); return Handle<JSFunction>::null(); } @@ -211,8 +208,6 @@ } } - if (result.is_null()) Top::ReportPendingMessages(); - return result; } @@ -243,8 +238,6 @@ } } - if (result.is_null()) Top::ReportPendingMessages(); - return result; } @@ -294,7 +287,10 @@ // Compile the code. Handle<Code> code = MakeCode(lit, script, false); + // Check for stack-overflow exception. if (code.is_null()) { + Top::StackOverflow(); + Top::ReportPendingMessages(); return false; } --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
