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

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

Issue 2679303003: Reland of land: [Parse] ParseInfo owns the parsing Zone. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « src/parsing/parse-info.h ('k') | src/runtime/runtime-internal.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parse-info.cc
diff --git a/src/parsing/parse-info.cc b/src/parsing/parse-info.cc
index 8bffb33573b75eebdddfbbe6f1aeb50907620b4e..487c36702c9743ddffef33760c1e381b0e3867a3 100644
--- a/src/parsing/parse-info.cc
+++ b/src/parsing/parse-info.cc
@@ -9,12 +9,13 @@
#include "src/heap/heap-inl.h"
#include "src/objects-inl.h"
#include "src/objects/scope-info.h"
+#include "src/zone/zone.h"
namespace v8 {
namespace internal {
-ParseInfo::ParseInfo(Zone* zone)
- : zone_(zone),
+ParseInfo::ParseInfo(AccountingAllocator* zone_allocator)
+ : zone_(std::make_shared<Zone>(zone_allocator, ZONE_NAME)),
flags_(0),
source_stream_(nullptr),
source_stream_encoding_(ScriptCompiler::StreamedSource::ONE_BYTE),
@@ -37,8 +38,8 @@
function_name_(nullptr),
literal_(nullptr) {}
-ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared)
- : ParseInfo(zone) {
+ParseInfo::ParseInfo(Handle<SharedFunctionInfo> shared)
+ : ParseInfo(shared->GetIsolate()->allocator()) {
isolate_ = shared->GetIsolate();
set_toplevel(shared->is_toplevel());
@@ -68,7 +69,14 @@
}
}
-ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) {
+ParseInfo::ParseInfo(Handle<SharedFunctionInfo> shared,
+ std::shared_ptr<Zone> zone)
+ : ParseInfo(shared) {
+ zone_.swap(zone);
+}
+
+ParseInfo::ParseInfo(Handle<Script> script)
+ : ParseInfo(script->GetIsolate()->allocator()) {
isolate_ = script->GetIsolate();
set_allow_lazy_parsing();
« no previous file with comments | « src/parsing/parse-info.h ('k') | src/runtime/runtime-internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698