Checking and reporting for stack overflow in the right places.

Review URL: http://codereview.chromium.org/12986

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
olehougaard 2008-12-05 09:57:36 +00:00
parent ed4e792cd5
commit 9378b1afb4

View File

@ -74,11 +74,6 @@ static Handle<Code> MakeCode(FunctionLiteral* literal,
// 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 @@ static Handle<JSFunction> MakeFunction(bool is_global,
// Check for stack-overflow exceptions.
if (code.is_null()) {
Top::StackOverflow();
Top::ReportPendingMessages();
return Handle<JSFunction>::null();
}
@ -211,8 +208,6 @@ Handle<JSFunction> Compiler::Compile(Handle<String> source,
}
}
if (result.is_null()) Top::ReportPendingMessages();
return result;
}
@ -243,8 +238,6 @@ Handle<JSFunction> Compiler::CompileEval(Handle<String> source,
}
}
if (result.is_null()) Top::ReportPendingMessages();
return result;
}
@ -294,7 +287,10 @@ bool Compiler::CompileLazy(Handle<SharedFunctionInfo> shared,
// 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;
}