Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Unified Diff: src/ast/ast-type-bounds.h

Issue 1968383002: Remove Expression::bounds_, in order to conserve memory during parsing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove Expression::bounds_ Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/ast/ast-type-bounds.h
diff --git a/src/ast/ast-type-bounds.h b/src/ast/ast-type-bounds.h
new file mode 100644
index 0000000000000000000000000000000000000000..ec26fdfc024f7380f0534b9b4ba660b732a47b44
--- /dev/null
+++ b/src/ast/ast-type-bounds.h
@@ -0,0 +1,40 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// A container to associate type bounds with AST Expression nodes.
+
+#ifndef V8_AST_AST_TYPE_BOUNDS_H_
+#define V8_AST_AST_TYPE_BOUNDS_H_
+
+#include "src/types.h"
+#include "src/zone-containers.h"
+
+namespace v8 {
+namespace internal {
+
+class Expression;
+
+class AstTypeBounds {
+ public:
+ explicit AstTypeBounds(Zone* zone) : bounds_map_(zone) {}
+ ~AstTypeBounds() {}
+
+ Bounds get(Expression* expression) const {
+ ZoneMap<Expression*, Bounds>::const_iterator i =
+ bounds_map_.find(expression);
+ return (i != bounds_map_.end()) ? i->second : Bounds::Unbounded();
+ }
+
+ void set(Expression* expression, Bounds bounds) {
+ bounds_map_[expression] = bounds;
+ }
+
+ private:
+ ZoneMap<Expression*, Bounds> bounds_map_;
+};
+
+} // namespace internal
+} // namespace v8
+
+#endif // V8_AST_AST_TYPE_BOUNDS_H_

Powered by Google App Engine
This is Rietveld 408576698