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

Unified Diff: src/compiler.cc

Issue 10868106: Print reason for disabling optimization. Kill --trace-bailout flag. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Created 8 years, 4 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/compiler.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 88510d521016eda450f3dd8c58faa2bcbdcc2ab3..1087d0036748805bdc2d4a551dc2c51b51f0cbd8 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -242,6 +242,7 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() {
const int kMaxOptCount =
FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000;
if (info()->shared_info()->opt_count() > kMaxOptCount) {
+ info()->set_bailout_reason("optimized too many times");
return AbortOptimization();
}
@@ -253,11 +254,16 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() {
// The encoding is as a signed value, with parameters and receiver using
// the negative indices and locals the non-negative ones.
const int parameter_limit = -LUnallocated::kMinFixedIndex;
- const int locals_limit = LUnallocated::kMaxFixedIndex;
Scope* scope = info()->scope();
- if ((scope->num_parameters() + 1) > parameter_limit ||
- (!info()->osr_ast_id().IsNone() &&
- scope->num_parameters() + 1 + scope->num_stack_slots() > locals_limit)) {
+ if ((scope->num_parameters() + 1) > parameter_limit) {
+ info()->set_bailout_reason("too many parameters");
+ return AbortOptimization();
+ }
+
+ const int locals_limit = LUnallocated::kMaxFixedIndex;
+ if (!info()->osr_ast_id().IsNone() &&
+ scope->num_parameters() + 1 + scope->num_stack_slots() > locals_limit) {
+ info()->set_bailout_reason("too many parameters/locals");
return AbortOptimization();
}
@@ -367,7 +373,10 @@ OptimizingCompiler::Status OptimizingCompiler::GenerateAndInstallCode() {
ASSERT(chunk_ != NULL);
ASSERT(graph_ != NULL);
Handle<Code> optimized_code = chunk_->Codegen();
- if (optimized_code.is_null()) return AbortOptimization();
+ if (optimized_code.is_null()) {
+ info()->set_bailout_reason("code generation failed");
+ return AbortOptimization();
+ }
info()->SetCode(optimized_code);
RecordOptimizationStats();
return SetLastStatus(SUCCEEDED);
@@ -637,7 +646,7 @@ Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source,
if (!result.is_null()) {
// Explicitly disable optimization for eval code. We're not yet prepared
// to handle eval-code in the optimizing compiler.
- result->DisableOptimization();
+ result->DisableOptimization("eval");
// If caller is strict mode, the result must be in strict mode or
// extended mode as well, but not the other way around. Consider:
@@ -880,6 +889,8 @@ void Compiler::InstallOptimizedCode(OptimizingCompiler* optimizing_compiler) {
// the unoptimized code.
OptimizingCompiler::Status status = optimizing_compiler->last_status();
if (status != OptimizingCompiler::SUCCEEDED) {
+ optimizing_compiler->info()->set_bailout_reason(
+ "failed/bailed out last time");
status = optimizing_compiler->AbortOptimization();
} else {
status = optimizing_compiler->GenerateAndInstallCode();
« no previous file with comments | « src/compiler.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698