Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index f706c7d03bedee9d4e4bb79033396a2f5aeb3615..1523ea2f87607d906248056aa825c5e54767c810 100644 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -61,7 +61,8 @@ CompilationInfo::CompilationInfo(Handle<Script> script, Zone* zone) |
extension_(NULL), |
pre_parse_data_(NULL), |
osr_ast_id_(AstNode::kNoNumber), |
- zone_(zone) { |
+ zone_(zone), |
+ hidden_extensions_(NULL) { |
Initialize(BASE); |
} |
@@ -79,7 +80,8 @@ CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info, |
extension_(NULL), |
pre_parse_data_(NULL), |
osr_ast_id_(AstNode::kNoNumber), |
- zone_(zone) { |
+ zone_(zone), |
+ hidden_extensions_(NULL) { |
Initialize(BASE); |
} |
@@ -97,11 +99,20 @@ CompilationInfo::CompilationInfo(Handle<JSFunction> closure, Zone* zone) |
extension_(NULL), |
pre_parse_data_(NULL), |
osr_ast_id_(AstNode::kNoNumber), |
- zone_(zone) { |
+ zone_(zone), |
+ hidden_extensions_(NULL) { |
Initialize(BASE); |
} |
+CompilationInfo::~CompilationInfo() { |
+ if (hidden_extensions_) { |
+ HandleScopeImplementer* impl = isolate_->handle_scope_implementer(); |
+ impl->DeleteHiddenExtensions(hidden_extensions_); |
+ } |
+} |
+ |
+ |
// Disable optimization for the rest of the compilation pipeline. |
void CompilationInfo::DisableOptimization() { |
bool is_optimizable_closure = |