| Index: src/compiler.cc
|
| diff --git a/src/compiler.cc b/src/compiler.cc
|
| index ebd4995871e6748c8826511e96bec6c28ff12cd2..3c51baa30e9881d3a8ac739166ba01c2673d1c1f 100644
|
| --- a/src/compiler.cc
|
| +++ b/src/compiler.cc
|
| @@ -127,7 +127,7 @@ void CompilationInfo::Initialize(Isolate* isolate,
|
| ASSERT(language_mode() == CLASSIC_MODE);
|
| SetLanguageMode(shared_info_->language_mode());
|
| }
|
| - set_bailout_reason(kUnknown);
|
| + set_bailout_reason("unknown");
|
| }
|
|
|
|
|
| @@ -342,7 +342,7 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() {
|
| const int kMaxOptCount =
|
| FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000;
|
| if (info()->opt_count() > kMaxOptCount) {
|
| - info()->set_bailout_reason(kOptimizedTooManyTimes);
|
| + info()->set_bailout_reason("optimized too many times");
|
| return AbortOptimization();
|
| }
|
|
|
| @@ -356,14 +356,14 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() {
|
| const int parameter_limit = -LUnallocated::kMinFixedSlotIndex;
|
| Scope* scope = info()->scope();
|
| if ((scope->num_parameters() + 1) > parameter_limit) {
|
| - info()->set_bailout_reason(kTooManyParameters);
|
| + info()->set_bailout_reason("too many parameters");
|
| return AbortOptimization();
|
| }
|
|
|
| const int locals_limit = LUnallocated::kMaxFixedSlotIndex;
|
| if (!info()->osr_ast_id().IsNone() &&
|
| scope->num_parameters() + 1 + scope->num_stack_slots() > locals_limit) {
|
| - info()->set_bailout_reason(kTooManyParametersLocals);
|
| + info()->set_bailout_reason("too many parameters/locals");
|
| return AbortOptimization();
|
| }
|
|
|
| @@ -458,9 +458,9 @@ OptimizingCompiler::Status OptimizingCompiler::OptimizeGraph() {
|
| ASSERT(last_status() == SUCCEEDED);
|
| Timer t(this, &time_taken_to_optimize_);
|
| ASSERT(graph_ != NULL);
|
| - BailoutReason bailout_reason = kNoReason;
|
| + SmartArrayPointer<char> bailout_reason;
|
| if (!graph_->Optimize(&bailout_reason)) {
|
| - if (bailout_reason == kNoReason) graph_builder_->Bailout(bailout_reason);
|
| + if (!bailout_reason.is_empty()) graph_builder_->Bailout(*bailout_reason);
|
| return SetLastStatus(BAILED_OUT);
|
| } else {
|
| chunk_ = LChunk::NewChunk(graph_);
|
| @@ -485,9 +485,7 @@ OptimizingCompiler::Status OptimizingCompiler::GenerateAndInstallCode() {
|
| DisallowDeferredHandleDereference no_deferred_handle_deref;
|
| Handle<Code> optimized_code = chunk_->Codegen();
|
| if (optimized_code.is_null()) {
|
| - if (info()->bailout_reason() != kNoReason) {
|
| - info()->set_bailout_reason(kCodeGenerationFailed);
|
| - }
|
| + info()->set_bailout_reason("code generation failed");
|
| return AbortOptimization();
|
| }
|
| info()->SetCode(optimized_code);
|
| @@ -782,7 +780,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(kEval);
|
| + 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:
|
| @@ -1057,13 +1055,13 @@ void Compiler::InstallOptimizedCode(OptimizingCompiler* optimizing_compiler) {
|
| // the unoptimized code.
|
| OptimizingCompiler::Status status = optimizing_compiler->last_status();
|
| if (info->HasAbortedDueToDependencyChange()) {
|
| - info->set_bailout_reason(kBailedOutDueToDependentMap);
|
| + info->set_bailout_reason("bailed out due to dependent map");
|
| status = optimizing_compiler->AbortOptimization();
|
| } else if (status != OptimizingCompiler::SUCCEEDED) {
|
| - info->set_bailout_reason(kFailedBailedOutLastTime);
|
| + info->set_bailout_reason("failed/bailed out last time");
|
| status = optimizing_compiler->AbortOptimization();
|
| } else if (isolate->DebuggerHasBreakPoints()) {
|
| - info->set_bailout_reason(kDebuggerIsActive);
|
| + info->set_bailout_reason("debugger is active");
|
| status = optimizing_compiler->AbortOptimization();
|
| } else {
|
| status = optimizing_compiler->GenerateAndInstallCode();
|
|
|