Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: src/compiler.cc

Issue 10640012: Add a second kind of HandleScope that ties the lifetime of Handles created in its scope to the life… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 =

Powered by Google App Engine
This is Rietveld 408576698