Chromium Code Reviews| Index: src/compiler.cc |
| diff --git a/src/compiler.cc b/src/compiler.cc |
| index f706c7d03bedee9d4e4bb79033396a2f5aeb3615..9bd533fc4393ada549bc724b9c38585aed6e25bf 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), |
| + persistent_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), |
| + persistent_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), |
| + persistent_extensions_(NULL) { |
| Initialize(BASE); |
| } |
| +CompilationInfo::~CompilationInfo() { |
| + if (persistent_extensions_) { |
| + HandleScopeImplementer* impl = isolate_->handle_scope_implementer(); |
| + impl->ReleaseExtensions(persistent_extensions_); |
|
danno
2012/06/24 11:07:03
should be "delete persistent_extensions_" and the
|
| + } |
| +} |
| + |
| + |
| // Disable optimization for the rest of the compilation pipeline. |
| void CompilationInfo::DisableOptimization() { |
| bool is_optimizable_closure = |