Index: src/compilation-info.cc |
diff --git a/src/compilation-info.cc b/src/compilation-info.cc |
index f0930f395ec74489a3598e78497e8d44cc73d5d4..f9b51b569d9027309e74e24171c5e7c5ae60eecb 100644 |
--- a/src/compilation-info.cc |
+++ b/src/compilation-info.cc |
@@ -107,7 +107,6 @@ CompilationInfo::~CompilationInfo() { |
shared_info()->DisableOptimization(bailout_reason()); |
} |
dependencies()->Rollback(); |
- delete deferred_handles_; |
} |
int CompilationInfo::num_parameters() const { |
@@ -131,8 +130,21 @@ bool CompilationInfo::ShouldSelfOptimize() { |
!shared_info()->optimization_disabled(); |
} |
+void CompilationInfo::set_deferred_handles( |
+ std::shared_ptr<DeferredHandles> deferred_handles) { |
+ DCHECK(deferred_handles_.get() == nullptr); |
+ deferred_handles_.swap(deferred_handles); |
+} |
+ |
+void CompilationInfo::set_deferred_handles(DeferredHandles* deferred_handles) { |
+ DCHECK(deferred_handles_.get() == nullptr); |
+ deferred_handles_.reset(deferred_handles); |
+} |
+ |
void CompilationInfo::ReopenHandlesInNewHandleScope() { |
- closure_ = Handle<JSFunction>(*closure_); |
+ if (!closure_.is_null()) { |
+ closure_ = Handle<JSFunction>(*closure_); |
+ } |
} |
bool CompilationInfo::has_simple_parameters() { |