diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-09-18 14:34:04 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-10-04 11:15:27 +0000 |
commit | e6430e577f105ad8813c92e75c54660c4985026e (patch) | |
tree | 88115e5d1fb471fea807111924dcccbeadbf9e4f /chromium/v8/src/compiler/graph.h | |
parent | 53d399fe6415a96ea6986ec0d402a9c07da72453 (diff) | |
download | qtwebengine-chromium-e6430e577f105ad8813c92e75c54660c4985026e.tar.gz |
BASELINE: Update Chromium to 61.0.3163.99
Change-Id: I8452f34574d88ca2b27af9bd56fc9ff3f16b1367
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/v8/src/compiler/graph.h')
-rw-r--r-- | chromium/v8/src/compiler/graph.h | 59 |
1 files changed, 7 insertions, 52 deletions
diff --git a/chromium/v8/src/compiler/graph.h b/chromium/v8/src/compiler/graph.h index 60af4789bcd..3c5c9c4de81 100644 --- a/chromium/v8/src/compiler/graph.h +++ b/chromium/v8/src/compiler/graph.h @@ -5,6 +5,8 @@ #ifndef V8_COMPILER_GRAPH_H_ #define V8_COMPILER_GRAPH_H_ +#include <array> + #include "src/base/compiler-specific.h" #include "src/globals.h" #include "src/zone/zone-containers.h" @@ -62,58 +64,11 @@ class V8_EXPORT_PRIVATE Graph final : public NON_EXPORTED_BASE(ZoneObject) { Node* NewNode(const Operator* op, int input_count, Node* const* inputs, bool incomplete = false); - // Factories for nodes with static input counts. - Node* NewNode(const Operator* op) { - return NewNode(op, 0, static_cast<Node* const*>(nullptr)); - } - Node* NewNode(const Operator* op, Node* n1) { return NewNode(op, 1, &n1); } - Node* NewNode(const Operator* op, Node* n1, Node* n2) { - Node* nodes[] = {n1, n2}; - return NewNode(op, arraysize(nodes), nodes); - } - Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3) { - Node* nodes[] = {n1, n2, n3}; - return NewNode(op, arraysize(nodes), nodes); - } - Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4) { - Node* nodes[] = {n1, n2, n3, n4}; - return NewNode(op, arraysize(nodes), nodes); - } - Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, - Node* n5) { - Node* nodes[] = {n1, n2, n3, n4, n5}; - return NewNode(op, arraysize(nodes), nodes); - } - Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, - Node* n5, Node* n6) { - Node* nodes[] = {n1, n2, n3, n4, n5, n6}; - return NewNode(op, arraysize(nodes), nodes); - } - Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, - Node* n5, Node* n6, Node* n7) { - Node* nodes[] = {n1, n2, n3, n4, n5, n6, n7}; - return NewNode(op, arraysize(nodes), nodes); - } - Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, - Node* n5, Node* n6, Node* n7, Node* n8) { - Node* nodes[] = {n1, n2, n3, n4, n5, n6, n7, n8}; - return NewNode(op, arraysize(nodes), nodes); - } - Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, - Node* n5, Node* n6, Node* n7, Node* n8, Node* n9) { - Node* nodes[] = {n1, n2, n3, n4, n5, n6, n7, n8, n9}; - return NewNode(op, arraysize(nodes), nodes); - } - Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, - Node* n5, Node* n6, Node* n7, Node* n8, Node* n9, Node* n10) { - Node* nodes[] = {n1, n2, n3, n4, n5, n6, n7, n8, n9, n10}; - return NewNode(op, arraysize(nodes), nodes); - } - Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, - Node* n5, Node* n6, Node* n7, Node* n8, Node* n9, Node* n10, - Node* n11) { - Node* nodes[] = {n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11}; - return NewNode(op, arraysize(nodes), nodes); + // Factory template for nodes with static input counts. + template <typename... Nodes> + Node* NewNode(const Operator* op, Nodes*... nodes) { + std::array<Node*, sizeof...(nodes)> nodes_arr{{nodes...}}; + return NewNode(op, nodes_arr.size(), nodes_arr.data()); } // Clone the {node}, and assign a new node id to the copy. |