Index: src/full-codegen.cc |
diff --git a/src/full-codegen.cc b/src/full-codegen.cc |
index f77c82df5129019d1f686a6c6e1ccf23491dc882..d963979ad867f0a8bc2d6c649af00383bed442da 100644 |
--- a/src/full-codegen.cc |
+++ b/src/full-codegen.cc |
@@ -313,7 +313,8 @@ bool FullCodeGenerator::MakeCode(CompilationInfo* info) { |
Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); |
Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info); |
- code->set_optimizable(info->IsOptimizable()); |
+ code->set_optimizable(info->IsOptimizable() && |
+ !info->function()->flags()->Contains(kDontOptimize)); |
code->set_self_optimization_header(cgen.has_self_optimization_header_); |
cgen.PopulateDeoptimizationData(code); |
cgen.PopulateTypeFeedbackInfo(code); |