Index: src/ast.h |
diff --git a/src/ast.h b/src/ast.h |
index ffae46225b525afc9718222bf4fbc82d0490bd02..13d0b8a233861fdf656717481d53dbc398c41bf8 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<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: |