| Index: src/compiler.cc
|
| diff --git a/src/compiler.cc b/src/compiler.cc
|
| index 7b0b92152931dc3da1e9036cc585b631de054c5c..d9a9365112b8f0e5733f2c4ca89e9b67f5977d34 100644
|
| --- a/src/compiler.cc
|
| +++ b/src/compiler.cc
|
| @@ -114,6 +114,7 @@ void CompilationInfo::Initialize(Isolate* isolate, Mode mode, Zone* zone) {
|
| return;
|
| }
|
| mode_ = V8::UseCrankshaft() ? mode : NONOPT;
|
| + abort_due_to_dependency_ = false;
|
| if (script_->type()->value() == Script::TYPE_NATIVE) {
|
| MarkAsNative();
|
| }
|
| @@ -427,6 +428,12 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() {
|
| }
|
| }
|
|
|
| + if (info()->HasAbortedDueToDependencyChange()) {
|
| + info_->set_bailout_reason("bailed out due to dependency change");
|
| + info_->AbortOptimization();
|
| + return SetLastStatus(BAILED_OUT);
|
| + }
|
| +
|
| return SetLastStatus(SUCCEEDED);
|
| }
|
|
|
| @@ -434,6 +441,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_);
|
| @@ -454,6 +462,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);
|
| @@ -794,6 +804,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());
|
| @@ -1038,7 +1049,7 @@ void Compiler::InstallOptimizedCode(OptimizingCompiler* optimizing_compiler) {
|
| // If crankshaft succeeded, install the optimized code else install
|
| // the unoptimized code.
|
| OptimizingCompiler::Status status = optimizing_compiler->last_status();
|
| - if (info->HasAbortedDueToDependentMap()) {
|
| + if (info->HasAbortedDueToDependencyChange()) {
|
| info->set_bailout_reason("bailed out due to dependent map");
|
| status = optimizing_compiler->AbortOptimization();
|
| } else if (status != OptimizingCompiler::SUCCEEDED) {
|
|
|