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}
This commit is contained in:
rmcilroy 2015-10-14 05:22:09 -07:00 committed by Commit bot
parent d702f70795
commit 822b493bee
5 changed files with 21 additions and 25 deletions

View File

@ -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. // Node for capturing a regexp literal.
class RegExpLiteral final : public MaterializedLiteral { class RegExpLiteral final : public MaterializedLiteral {
public: public:

View File

@ -15,7 +15,6 @@
#include "src/compiler/node-properties.h" #include "src/compiler/node-properties.h"
#include "src/compiler/operator-properties.h" #include "src/compiler/operator-properties.h"
#include "src/compiler/state-values-utils.h" #include "src/compiler/state-values-utils.h"
#include "src/full-codegen/full-codegen.h"
#include "src/parser.h" #include "src/parser.h"
#include "src/scopes.h" #include "src/scopes.h"

View File

@ -18,7 +18,6 @@
#include "src/compiler/node-matchers.h" #include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties.h" #include "src/compiler/node-properties.h"
#include "src/compiler/operator-properties.h" #include "src/compiler/operator-properties.h"
#include "src/full-codegen/full-codegen.h"
#include "src/isolate-inl.h" #include "src/isolate-inl.h"
#include "src/parser.h" #include "src/parser.h"
#include "src/rewriter.h" #include "src/rewriter.h"

View File

@ -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 { class BackEdgeTable {
public: public:
BackEdgeTable(Code* code, DisallowHeapAllocation* required) { BackEdgeTable(Code* code, DisallowHeapAllocation* required) {

View File

@ -7,7 +7,6 @@
#include <stack> #include <stack>
#include "src/compiler.h" #include "src/compiler.h"
#include "src/full-codegen/full-codegen.h"
#include "src/interpreter/control-flow-builders.h" #include "src/interpreter/control-flow-builders.h"
#include "src/objects.h" #include "src/objects.h"
#include "src/parser.h" #include "src/parser.h"