Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index d0c415e6cd7df6c5a50a7e13aa8c403a119b7db0..fb02d8dbaea7271a88f623f2f8f59c3b9adc22a1 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -9328,11 +9328,32 @@ void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) { |
} |
+bool JSFunction::Inlines(SharedFunctionInfo* candidate) { |
+ DisallowHeapAllocation no_gc; |
+ if (shared() == candidate) return true; |
+ if (code()->kind() != Code::OPTIMIZED_FUNCTION) return false; |
+ DeoptimizationInputData* const data = |
+ DeoptimizationInputData::cast(code()->deoptimization_data()); |
+ if (data->length() == 0) return false; |
+ FixedArray* const literals = data->LiteralArray(); |
+ int const inlined_count = data->InlinedFunctionCount()->value(); |
+ for (int i = 0; i < inlined_count; ++i) { |
+ if (SharedFunctionInfo::cast(literals->get(i)) == candidate) { |
+ return true; |
+ } |
+ } |
+ return false; |
+} |
+ |
+ |
void JSFunction::MarkForOptimization() { |
Isolate* isolate = GetIsolate(); |
+ // Do not optimize if function contains break points. |
+ if (shared()->HasDebugInfo()) return; |
DCHECK(!IsOptimized()); |
DCHECK(shared()->allows_lazy_compilation() || |
!shared()->optimization_disabled()); |
+ DCHECK(!shared()->HasDebugInfo()); |
set_code_no_write_barrier( |
isolate->builtins()->builtin(Builtins::kCompileOptimized)); |
// No write barrier required, since the builtin is part of the root set. |