Commit 3336d2e1 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Merge node-aux-data-inl.h into node-aux-data.h.

Google style guide forbids -inl.h headers.

R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/922633002

Cr-Commit-Position: refs/heads/master@{#26611}
parent 222001ac
......@@ -586,7 +586,6 @@ source_set("v8_base") {
"src/compiler/machine-type.h",
"src/compiler/move-optimizer.cc",
"src/compiler/move-optimizer.h",
"src/compiler/node-aux-data-inl.h",
"src/compiler/node-aux-data.h",
"src/compiler/node-cache.cc",
"src/compiler/node-cache.h",
......
......@@ -7,7 +7,6 @@
#include "src/compiler/common-operator.h"
#include "src/compiler/js-generic-lowering.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/node-aux-data-inl.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/operator-properties.h"
......
......@@ -11,7 +11,6 @@
#include "src/compiler/graph-visualizer.h"
#include "src/compiler/js-inlining.h"
#include "src/compiler/js-operator.h"
#include "src/compiler/node-aux-data-inl.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/simplified-operator.h"
......
......@@ -5,7 +5,6 @@
#include "src/compiler/access-builder.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/js-typed-lowering.h"
#include "src/compiler/node-aux-data-inl.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/operator-properties.h"
......
// Copyright 2014 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.
#ifndef V8_COMPILER_NODE_AUX_DATA_INL_H_
#define V8_COMPILER_NODE_AUX_DATA_INL_H_
#include "src/compiler/graph.h"
#include "src/compiler/node.h"
#include "src/compiler/node-aux-data.h"
namespace v8 {
namespace internal {
namespace compiler {
template <class T>
NodeAuxData<T>::NodeAuxData(Zone* zone)
: aux_data_(zone) {}
template <class T>
void NodeAuxData<T>::Set(Node* node, const T& data) {
int id = node->id();
if (id >= static_cast<int>(aux_data_.size())) {
aux_data_.resize(id + 1);
}
aux_data_[id] = data;
}
template <class T>
T NodeAuxData<T>::Get(Node* node) const {
int id = node->id();
if (id >= static_cast<int>(aux_data_.size())) {
return T();
}
return aux_data_[id];
}
}
}
} // namespace v8::internal::compiler
#endif
......@@ -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_
......@@ -4,7 +4,7 @@
#include "src/compiler/source-position.h"
#include "src/compiler/graph.h"
#include "src/compiler/node-aux-data-inl.h"
#include "src/compiler/node-aux-data.h"
namespace v8 {
namespace internal {
......
......@@ -494,7 +494,6 @@
'../../src/compiler/machine-type.h',
'../../src/compiler/move-optimizer.cc',
'../../src/compiler/move-optimizer.h',
'../../src/compiler/node-aux-data-inl.h',
'../../src/compiler/node-aux-data.h',
'../../src/compiler/node-cache.cc',
'../../src/compiler/node-cache.h',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment