Commit 822b493b authored by rmcilroy's avatar rmcilroy Committed by Commit bot

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}
parent d702f707
......@@ -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<Literal, ObjectLiteral::Accessors,
ZoneAllocationPolicy> {
public:
explicit AccessorTable(Zone* zone)
: TemplateHashMap<Literal, ObjectLiteral::Accessors,
ZoneAllocationPolicy>(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:
......
......@@ -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"
......
......@@ -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"
......
......@@ -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<Literal,
ObjectLiteral::Accessors,
ZoneAllocationPolicy> {
public:
explicit AccessorTable(Zone* zone) :
TemplateHashMap<Literal, ObjectLiteral::Accessors,
ZoneAllocationPolicy>(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) {
......
......@@ -7,7 +7,6 @@
#include <stack>
#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"
......
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