Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index e0232d58732ed014333c6118af88e3ec2645c6d9..03bac65aedea15782dc54d31c639ddf9d3d026bd 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -5470,9 +5470,11 @@ uint32_t JSFunction::SourceHash() { |
bool JSFunction::IsInlineable() { |
if (IsBuiltin()) return false; |
+ SharedFunctionInfo* shared_info = shared(); |
// Check that the function has a script associated with it. |
- if (!shared()->script()->IsScript()) return false; |
- Code* code = shared()->code(); |
+ if (!shared_info->script()->IsScript()) return false; |
+ if (shared_info->optimization_disabled()) return false; |
+ Code* code = shared_info->code(); |
if (code->kind() == Code::OPTIMIZED_FUNCTION) return true; |
// If we never ran this (unlikely) then lets try to optimize it. |
if (code->kind() != Code::FUNCTION) return true; |