Commit 95121196 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Cleanup] Remove some unused functions and variables from ParseInfo.

Removes some unused functions in ParseInfo and makes the associated fields unique_ptr instead
of shared_ptr. Also removes an unused zone in Compiler.

Change-Id: Idf1fbfb523cfc2b9a265d2855b1167770203cfd5
Reviewed-on: https://chromium-review.googlesource.com/1185193
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55342}
parent d5d0484d
......@@ -1654,7 +1654,6 @@ MaybeHandle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
natives);
// Compile the function and add it to the isolate cache.
Zone compile_zone(isolate->allocator(), ZONE_NAME);
if (origin_options.IsModule()) parse_info.set_module();
parse_info.set_extension(extension);
parse_info.set_eager(compile_options == ScriptCompiler::kEagerCompile);
......
......@@ -7,6 +7,7 @@
#include "src/ast/ast-source-ranges.h"
#include "src/ast/ast-value-factory.h"
#include "src/ast/ast.h"
#include "src/base/template-utils.h"
#include "src/heap/heap-inl.h"
#include "src/objects-inl.h"
#include "src/objects/scope-info.h"
......@@ -16,7 +17,7 @@ namespace v8 {
namespace internal {
ParseInfo::ParseInfo(Isolate* isolate, AccountingAllocator* zone_allocator)
: zone_(std::make_shared<Zone>(zone_allocator, ZONE_NAME)),
: zone_(base::make_unique<Zone>(zone_allocator, ZONE_NAME)),
flags_(0),
extension_(nullptr),
script_scope_(nullptr),
......@@ -130,11 +131,6 @@ void ParseInfo::UpdateBackgroundParseStatisticsOnMainThread(Isolate* isolate) {
set_runtime_call_stats(main_call_stats);
}
void ParseInfo::ShareZone(ParseInfo* other) {
DCHECK_EQ(0, zone_->allocation_size());
zone_ = other->zone_;
}
Handle<Script> ParseInfo::CreateScript(Isolate* isolate, Handle<String> source,
ScriptOriginOptions origin_options,
NativesFlag natives) {
......@@ -175,11 +171,6 @@ AstValueFactory* ParseInfo::GetOrCreateAstValueFactory() {
return ast_value_factory();
}
void ParseInfo::ShareAstValueFactory(ParseInfo* other) {
DCHECK(!ast_value_factory_.get());
ast_value_factory_ = other->ast_value_factory_;
}
void ParseInfo::AllocateSourceRangeMap() {
DCHECK(block_coverage_enabled());
set_source_range_map(new (zone()) SourceRangeMap(zone()));
......
......@@ -54,12 +54,6 @@ class V8_EXPORT_PRIVATE ParseInfo {
Zone* zone() const { return zone_.get(); }
// Sets this parse info to share the same zone as |other|
void ShareZone(ParseInfo* other);
// Sets this parse info to share the same ast value factory as |other|
void ShareAstValueFactory(ParseInfo* other);
// Convenience accessor methods for flags.
#define FLAG_ACCESSOR(flag, getter, setter) \
bool getter() const { return GetFlag(flag); } \
......@@ -253,7 +247,7 @@ class V8_EXPORT_PRIVATE ParseInfo {
};
//------------- Inputs to parsing and scope analysis -----------------------
std::shared_ptr<Zone> zone_;
std::unique_ptr<Zone> zone_;
unsigned flags_;
v8::Extension* extension_;
DeclarationScope* script_scope_;
......@@ -275,7 +269,7 @@ class V8_EXPORT_PRIVATE ParseInfo {
//----------- Inputs+Outputs of parsing and scope analysis -----------------
std::unique_ptr<Utf16CharacterStream> character_stream_;
ConsumedPreParsedScopeData consumed_preparsed_scope_data_;
std::shared_ptr<AstValueFactory> ast_value_factory_;
std::unique_ptr<AstValueFactory> ast_value_factory_;
const class AstStringConstants* ast_string_constants_;
const AstRawString* function_name_;
RuntimeCallStats* runtime_call_stats_;
......@@ -284,7 +278,6 @@ class V8_EXPORT_PRIVATE ParseInfo {
//----------- Output of parsing and scope analysis ------------------------
FunctionLiteral* literal_;
std::shared_ptr<DeferredHandles> deferred_handles_;
PendingCompilationErrorHandler pending_error_handler_;
void SetFlag(Flag f) { flags_ |= f; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment