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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_NODE_AUX_DATA_H_ 5 #ifndef V8_COMPILER_NODE_AUX_DATA_H_
6 #define V8_COMPILER_NODE_AUX_DATA_H_ 6 #define V8_COMPILER_NODE_AUX_DATA_H_
7 7
8 #include "src/compiler/node.h"
8 #include "src/zone-containers.h" 9 #include "src/zone-containers.h"
9 10
10 namespace v8 { 11 namespace v8 {
11 namespace internal { 12 namespace internal {
12 namespace compiler { 13 namespace compiler {
13 14
14 // Forward declarations. 15 // Forward declarations.
15 class Graph;
16 class Node; 16 class Node;
17 17
18 template <class T> 18 template <class T>
19 class NodeAuxData { 19 class NodeAuxData {
20 public: 20 public:
21 inline explicit NodeAuxData(Zone* zone); 21 explicit NodeAuxData(Zone* zone) : aux_data_(zone) {}
22 22
23 inline void Set(Node* node, const T& data); 23 void Set(Node* node, T const& data) {
24 inline T Get(Node* node) const; 24 size_t const id = node->id();
25 if (id >= aux_data_.size()) aux_data_.resize(id + 1);
26 aux_data_[id] = data;
27 }
28
29 T Get(Node* node) const {
30 size_t const id = node->id();
31 return (id < aux_data_.size()) ? aux_data_[id] : T();
32 }
25 33
26 private: 34 private:
27 ZoneVector<T> aux_data_; 35 ZoneVector<T> aux_data_;
28 }; 36 };
29 }
30 }
31 } // namespace v8::internal::compiler
32 37
33 #endif 38 } // namespace compiler
39 } // namespace internal
40 } // namespace v8
41
42 #endif // V8_COMPILER_NODE_AUX_DATA_H_
OLDNEW
« 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