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

Unified Diff: src/compiler/state-values-utils.h

Issue 2509623002: [turbofan] Sparse representation for state values (Closed)
Patch Set: Add missing operator declarations Created 4 years 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/compiler/state-values-utils.h
diff --git a/src/compiler/state-values-utils.h b/src/compiler/state-values-utils.h
index 14b1b9e59963755c2b0e543becb3c46f3220e994..42a99a6ba0afeb2f2f3a05576d076491d4ae1601 100644
--- a/src/compiler/state-values-utils.h
+++ b/src/compiler/state-values-utils.h
@@ -5,12 +5,15 @@
#ifndef V8_COMPILER_STATE_VALUES_UTILS_H_
#define V8_COMPILER_STATE_VALUES_UTILS_H_
+#include <array>
#include "src/compiler/js-graph.h"
#include "src/globals.h"
namespace v8 {
namespace internal {
+class BitVector;
+
namespace compiler {
class Graph;
@@ -19,10 +22,12 @@ class V8_EXPORT_PRIVATE StateValuesCache {
public:
explicit StateValuesCache(JSGraph* js_graph);
- Node* GetNodeForValues(Node** values, size_t count);
+ Node* GetNodeForValues(Node** values, size_t count,
+ const BitVector* liveness);
private:
static const size_t kMaxInputCount = 8;
+ typedef std::array<Node*, kMaxInputCount> WorkingBuffer;
struct NodeKey {
Node* node;
@@ -33,22 +38,23 @@ class V8_EXPORT_PRIVATE StateValuesCache {
struct StateValuesKey : public NodeKey {
// ValueArray - array of nodes ({node} has to be nullptr).
size_t count;
+ uint32_t mask;
Node** values;
- StateValuesKey(size_t count, Node** values)
- : NodeKey(nullptr), count(count), values(values) {}
+ StateValuesKey(size_t count, uint32_t mask, Node** values)
+ : NodeKey(nullptr), count(count), mask(mask), values(values) {}
};
- class ValueArrayIterator;
-
static bool AreKeysEqual(void* key1, void* key2);
static bool IsKeysEqualToNode(StateValuesKey* key, Node* node);
static bool AreValueKeysEqual(StateValuesKey* key1, StateValuesKey* key2);
- Node* BuildTree(ValueArrayIterator* it, size_t max_height);
- NodeVector* GetWorkingSpace(size_t level);
+ Node* BuildTree(size_t& idx, Node** values, size_t count,
+ const BitVector* liveness, size_t level);
+
+ WorkingBuffer& GetWorkingSpace(size_t level);
Node* GetEmptyStateValues();
- Node* GetValuesNodeFromCache(Node** nodes, size_t count);
+ Node* GetValuesNodeFromCache(Node** nodes, size_t count, uint32_t mask);
Graph* graph() { return js_graph_->graph(); }
CommonOperatorBuilder* common() { return js_graph_->common(); }
@@ -57,7 +63,7 @@ class V8_EXPORT_PRIVATE StateValuesCache {
JSGraph* js_graph_;
CustomMatcherZoneHashMap hash_map_;
- ZoneVector<NodeVector*> working_space_; // One working space per level.
+ ZoneVector<WorkingBuffer> working_space_; // One working space per level.
Node* empty_state_values_;
};
@@ -86,17 +92,17 @@ class V8_EXPORT_PRIVATE StateValuesAccess {
MachineType type();
bool done();
void Advance();
+ void MoveToNextSibling();
+ void EnsureValid();
struct StatePos {
Node* node;
+ uint32_t mask;
Jarin 2016/12/08 07:59:43 This needs some explanation of what it means.
Leszek Swirski 2016/12/08 15:44:31 Removed after iterator refactor.
int index;
-
- explicit StatePos(Node* node) : node(node), index(0) {}
- StatePos() {}
};
StatePos* Top();
- void Push(Node* node);
+ void Push(Node* node, uint32_t mask);
void Pop();
static const int kMaxInlineDepth = 8;

Powered by Google App Engine
This is Rietveld 408576698