Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Unified Diff: src/runtime.cc

Issue 6524039: Make exception be ignored when trying to optimize. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build-ia32
Patch Set: Unmark function for lazy recompilation if it fails. Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/handles.cc ('k') | test/mjsunit/regress/regress-1145.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 48ff69f5d273071e0615743e2b2760f2abb71e70..c6df893d4701b61db0aa3923a853bb2f72289842 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -7000,7 +7000,7 @@ static MaybeObject* Runtime_LazyRecompile(Arguments args) {
function->ReplaceCode(function->shared()->code());
return function->code();
}
- if (CompileOptimized(function, AstNode::kNoNumber)) {
+ if (CompileOptimized(function, AstNode::kNoNumber, KEEP_EXCEPTION)) {
return function->code();
}
if (FLAG_trace_opt) {
@@ -7169,7 +7169,8 @@ static MaybeObject* Runtime_CompileForOnStackReplacement(Arguments args) {
// Try to compile the optimized code. A true return value from
// CompileOptimized means that compilation succeeded, not necessarily
// that optimization succeeded.
- if (CompileOptimized(function, ast_id) && function->IsOptimized()) {
+ if (CompileOptimized(function, ast_id, CLEAR_EXCEPTION) &&
Lasse Reichstein 2011/02/16 19:06:08 The exception is thrown inside TryInline. Would it
Kevin Millikin (Chromium) 2011/02/17 11:02:34 That would be good to do, but it's blocked on a re
+ function->IsOptimized()) {
DeoptimizationInputData* data = DeoptimizationInputData::cast(
function->code()->deoptimization_data());
if (data->OsrPcOffset()->value() >= 0) {
@@ -7212,6 +7213,9 @@ static MaybeObject* Runtime_CompileForOnStackReplacement(Arguments args) {
ASSERT(function->code()->kind() == Code::OPTIMIZED_FUNCTION);
return Smi::FromInt(ast_id);
} else {
+ if (function->IsMarkedForLazyRecompilation()) {
+ function->set_code(function->shared()->code());
+ }
Lasse Reichstein 2011/02/16 19:06:08 I'm a little wary at this. If I don't unmark the f
Kevin Millikin (Chromium) 2011/02/17 11:02:34 On the other hand, we don't really care about opti
Lasse Reichstein 2011/02/17 11:44:59 It *would* be better to catch those syntax errors
return Smi::FromInt(-1);
}
}
« no previous file with comments | « src/handles.cc ('k') | test/mjsunit/regress/regress-1145.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698