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

Unified Diff: src/parsing/parse-info.h

Issue 2632123006: Reland: [Parse] ParseInfo owns the parsing Zone. (Closed)
Patch Set: Created 3 years, 11 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/parsing/parse-info.h
diff --git a/src/parsing/parse-info.h b/src/parsing/parse-info.h
index 87052a5a7e1d053341658a12cb63f458d1e014c7..a5fd1a55d333076f4a70e86947bffcce9aea00da 100644
--- a/src/parsing/parse-info.h
+++ b/src/parsing/parse-info.h
@@ -5,6 +5,8 @@
#ifndef V8_PARSING_PARSE_INFO_H_
#define V8_PARSING_PARSE_INFO_H_
+#include <memory>
+
#include "include/v8.h"
#include "src/globals.h"
#include "src/handles.h"
@@ -16,6 +18,7 @@ class Extension;
namespace internal {
+class AccountingAllocator;
class AstRawString;
class AstValueFactory;
class DeclarationScope;
@@ -29,13 +32,18 @@ class Zone;
// A container for the inputs, configuration options, and outputs of parsing.
class V8_EXPORT_PRIVATE ParseInfo {
public:
- explicit ParseInfo(Zone* zone);
- ParseInfo(Zone* zone, Handle<Script> script);
- ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared);
+ explicit ParseInfo(AccountingAllocator* zone_allocator);
+ ParseInfo(Handle<Script> script);
+ ParseInfo(Handle<SharedFunctionInfo> shared);
+
+ // TODO(rmcilroy): Remove once Hydrogen no longer needs this.
+ ParseInfo(Handle<SharedFunctionInfo> shared, std::shared_ptr<Zone> zone);
~ParseInfo();
- Zone* zone() const { return zone_; }
+ Zone* zone() const { return zone_.get(); }
marja 2017/01/17 15:39:08 Based on this CL, it's not possible to see whether
rmcilroy 2017/01/19 12:48:29 Given that the existing zone which was created alw
+
+ std::shared_ptr<Zone> zone_shared() const { return zone_; }
// Convenience accessor methods for flags.
#define FLAG_ACCESSOR(flag, getter, setter) \
@@ -224,7 +232,7 @@ class V8_EXPORT_PRIVATE ParseInfo {
};
//------------- Inputs to parsing and scope analysis -----------------------
- Zone* zone_;
+ std::shared_ptr<Zone> zone_;
unsigned flags_;
ScriptCompiler::ExternalSourceStream* source_stream_;
ScriptCompiler::StreamedSource::Encoding source_stream_encoding_;

Powered by Google App Engine
This is Rietveld 408576698