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

Unified Diff: src/compiler/node-aux-data.h

Issue 922633002: [turbofan] Merge node-aux-data-inl.h into node-aux-data.h. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/compiler/node-aux-data-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/node-aux-data.h
diff --git a/src/compiler/node-aux-data.h b/src/compiler/node-aux-data.h
index a08dc580ff6c000ba70c51fb9a71e3610c8248e8..6c236aa4da75d8be538cd2bdd980e4d4c060f6a4 100644
--- a/src/compiler/node-aux-data.h
+++ b/src/compiler/node-aux-data.h
@@ -5,6 +5,7 @@
#ifndef V8_COMPILER_NODE_AUX_DATA_H_
#define V8_COMPILER_NODE_AUX_DATA_H_
+#include "src/compiler/node.h"
#include "src/zone-containers.h"
namespace v8 {
@@ -12,22 +13,30 @@ namespace internal {
namespace compiler {
// Forward declarations.
-class Graph;
class Node;
template <class T>
class NodeAuxData {
public:
- inline explicit NodeAuxData(Zone* zone);
+ explicit NodeAuxData(Zone* zone) : aux_data_(zone) {}
- inline void Set(Node* node, const T& data);
- inline T Get(Node* node) const;
+ void Set(Node* node, T const& data) {
+ size_t const id = node->id();
+ if (id >= aux_data_.size()) aux_data_.resize(id + 1);
+ aux_data_[id] = data;
+ }
+
+ T Get(Node* node) const {
+ size_t const id = node->id();
+ return (id < aux_data_.size()) ? aux_data_[id] : T();
+ }
private:
ZoneVector<T> aux_data_;
};
-}
-}
-} // namespace v8::internal::compiler
-#endif
+} // namespace compiler
+} // namespace internal
+} // namespace v8
+
+#endif // V8_COMPILER_NODE_AUX_DATA_H_
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/compiler/node-aux-data-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698