From 822b493beed0888a3ef582577eb3269ab2918c3a Mon Sep 17 00:00:00 2001 From: rmcilroy Date: Wed, 14 Oct 2015 05:22:09 -0700 Subject: [PATCH] Move AccessorTable from full-codegen.h to ast.h. It is used by AstGraphBuilder (TF) and BytecodeGenerator (Ignition), so is no longer a full-codegen datastructure. Removes full-codegen.h dependency from compiler/ and interpreter/ Review URL: https://codereview.chromium.org/1393393003 Cr-Commit-Position: refs/heads/master@{#31256} --- src/ast.h | 21 +++++++++++++++++++++ src/compiler/ast-graph-builder.cc | 1 - src/compiler/js-inlining.cc | 1 - src/full-codegen/full-codegen.h | 22 ---------------------- src/interpreter/bytecode-generator.cc | 1 - 5 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/ast.h b/src/ast.h index ffae46225b..13d0b8a233 100644 --- a/src/ast.h +++ b/src/ast.h @@ -1514,6 +1514,27 @@ class ObjectLiteral final : public MaterializedLiteral { }; +// A map from property names to getter/setter pairs allocated in the zone. +class AccessorTable : public TemplateHashMap { + public: + explicit AccessorTable(Zone* zone) + : TemplateHashMap(Literal::Match, + ZoneAllocationPolicy(zone)), + zone_(zone) {} + + Iterator lookup(Literal* literal) { + Iterator it = find(literal, true, ZoneAllocationPolicy(zone_)); + if (it->second == NULL) it->second = new (zone_) ObjectLiteral::Accessors(); + return it; + } + + private: + Zone* zone_; +}; + + // Node for capturing a regexp literal. class RegExpLiteral final : public MaterializedLiteral { public: diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc index d0ebd6bf6f..28d55ffa3e 100644 --- a/src/compiler/ast-graph-builder.cc +++ b/src/compiler/ast-graph-builder.cc @@ -15,7 +15,6 @@ #include "src/compiler/node-properties.h" #include "src/compiler/operator-properties.h" #include "src/compiler/state-values-utils.h" -#include "src/full-codegen/full-codegen.h" #include "src/parser.h" #include "src/scopes.h" diff --git a/src/compiler/js-inlining.cc b/src/compiler/js-inlining.cc index 14c7393ed9..291f4874a0 100644 --- a/src/compiler/js-inlining.cc +++ b/src/compiler/js-inlining.cc @@ -18,7 +18,6 @@ #include "src/compiler/node-matchers.h" #include "src/compiler/node-properties.h" #include "src/compiler/operator-properties.h" -#include "src/full-codegen/full-codegen.h" #include "src/isolate-inl.h" #include "src/parser.h" #include "src/rewriter.h" diff --git a/src/full-codegen/full-codegen.h b/src/full-codegen/full-codegen.h index 8b4e89fa03..009fc03e14 100644 --- a/src/full-codegen/full-codegen.h +++ b/src/full-codegen/full-codegen.h @@ -972,28 +972,6 @@ class FullCodeGenerator: public AstVisitor { }; -// A map from property names to getter/setter pairs allocated in the zone. -class AccessorTable: public TemplateHashMap { - public: - explicit AccessorTable(Zone* zone) : - TemplateHashMap(Literal::Match, - ZoneAllocationPolicy(zone)), - zone_(zone) { } - - Iterator lookup(Literal* literal) { - Iterator it = find(literal, true, ZoneAllocationPolicy(zone_)); - if (it->second == NULL) it->second = new(zone_) ObjectLiteral::Accessors(); - return it; - } - - private: - Zone* zone_; -}; - - class BackEdgeTable { public: BackEdgeTable(Code* code, DisallowHeapAllocation* required) { diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc index 5f321201df..0946a6455f 100644 --- a/src/interpreter/bytecode-generator.cc +++ b/src/interpreter/bytecode-generator.cc @@ -7,7 +7,6 @@ #include #include "src/compiler.h" -#include "src/full-codegen/full-codegen.h" #include "src/interpreter/control-flow-builders.h" #include "src/objects.h" #include "src/parser.h"