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:
parent
d702f70795
commit
822b493bee
21
src/ast.h
21
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<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:
|
||||||
|
@ -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"
|
||||||
|
|
||||||
|
@ -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"
|
||||||
|
@ -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) {
|
||||||
|
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user