| Index: src/compiler.cc
|
| diff --git a/src/compiler.cc b/src/compiler.cc
|
| index 5ed274a7a20f4ae734db91772bcdfb7d7e64e536..f6e5daac854228dec0381fdd64b317330109833b 100644
|
| --- a/src/compiler.cc
|
| +++ b/src/compiler.cc
|
| @@ -120,6 +120,7 @@ void CompilationInfo::Initialize(Isolate* isolate,
|
| return;
|
| }
|
| mode_ = V8::UseCrankshaft() ? mode : NONOPT;
|
| + abort_due_to_dependency_ = false;
|
| if (script_->type()->value() == Script::TYPE_NATIVE) {
|
| MarkAsNative();
|
| }
|
| @@ -446,6 +447,12 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() {
|
| }
|
| }
|
|
|
| + if (info()->HasAbortedDueToDependencyChange()) {
|
| + info_->set_bailout_reason(kBailedOutDueToDependencyChange);
|
| + info_->AbortOptimization();
|
| + return SetLastStatus(BAILED_OUT);
|
| + }
|
| +
|
| return SetLastStatus(SUCCEEDED);
|
| }
|
|
|
| @@ -454,6 +461,7 @@ OptimizingCompiler::Status OptimizingCompiler::OptimizeGraph() {
|
| DisallowHeapAllocation no_allocation;
|
| DisallowHandleAllocation no_handles;
|
| DisallowHandleDereference no_deref;
|
| + DisallowCodeDependencyChange no_dependency_change;
|
|
|
| ASSERT(last_status() == SUCCEEDED);
|
| Timer t(this, &time_taken_to_optimize_);
|
| @@ -474,6 +482,8 @@ OptimizingCompiler::Status OptimizingCompiler::OptimizeGraph() {
|
|
|
| OptimizingCompiler::Status OptimizingCompiler::GenerateAndInstallCode() {
|
| ASSERT(last_status() == SUCCEEDED);
|
| + ASSERT(!info()->HasAbortedDueToDependencyChange());
|
| + DisallowCodeDependencyChange no_dependency_change;
|
| { // Scope for timer.
|
| Timer timer(this, &time_taken_to_codegen_);
|
| ASSERT(chunk_ != NULL);
|
| @@ -815,6 +825,7 @@ static bool InstallFullCode(CompilationInfo* info) {
|
| // was flushed. By setting the code object last we avoid this.
|
| Handle<SharedFunctionInfo> shared = info->shared_info();
|
| Handle<Code> code = info->code();
|
| + CHECK(code->kind() == Code::FUNCTION);
|
| Handle<JSFunction> function = info->closure();
|
| Handle<ScopeInfo> scope_info =
|
| ScopeInfo::Create(info->scope(), info->zone());
|
| @@ -1059,7 +1070,7 @@ 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(kBailedOutDueToDependencyChange);
|
| status = optimizing_compiler->AbortOptimization();
|
| } else if (status != OptimizingCompiler::SUCCEEDED) {
|
| info->set_bailout_reason(kFailedBailedOutLastTime);
|
|
|