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

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

Issue 1015423002: [turbofan] Remember types for deoptimization during simplified lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address review comments Created 5 years, 9 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/state-values-utils.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/state-values-utils.cc
diff --git a/src/compiler/state-values-utils.cc b/src/compiler/state-values-utils.cc
index 2d643d78ab429478da472acbb3b77853e8456c2a..2c7d0edd7a0951d51a2148e9f9baa6d62d172d00 100644
--- a/src/compiler/state-values-utils.cc
+++ b/src/compiler/state-values-utils.cc
@@ -173,6 +173,7 @@ Node* StateValuesCache::GetNodeForValues(Node** values, size_t count) {
#if DEBUG
for (size_t i = 0; i < count; i++) {
DCHECK_NE(values[i]->opcode(), IrOpcode::kStateValues);
+ DCHECK_NE(values[i]->opcode(), IrOpcode::kTypedStateValues);
}
#endif
if (count == 0) {
@@ -190,7 +191,8 @@ Node* StateValuesCache::GetNodeForValues(Node** values, size_t count) {
Node* tree = BuildTree(&it, height);
// If the 'tree' is a single node, equip it with a StateValues wrapper.
- if (tree->opcode() != IrOpcode::kStateValues) {
+ if (tree->opcode() != IrOpcode::kStateValues &&
+ tree->opcode() != IrOpcode::kTypedStateValues) {
tree = GetValuesNodeFromCache(&tree, 1);
}
@@ -249,7 +251,8 @@ void StateValuesAccess::iterator::Advance() {
return;
}
Top()->index++;
- } else if (node->InputAt(index)->opcode() == IrOpcode::kStateValues) {
+ } else if (node->InputAt(index)->opcode() == IrOpcode::kStateValues ||
+ node->InputAt(index)->opcode() == IrOpcode::kTypedStateValues) {
// Nested state, we need to push to the stack.
Push(node->InputAt(index));
} else {
@@ -265,6 +268,19 @@ Node* StateValuesAccess::iterator::node() {
}
+MachineType StateValuesAccess::iterator::type() {
+ Node* state = Top()->node;
+ if (state->opcode() == IrOpcode::kStateValues) {
+ return kMachAnyTagged;
+ } else {
+ DCHECK_EQ(IrOpcode::kTypedStateValues, state->opcode());
+ const ZoneVector<MachineType>* types =
+ OpParameter<const ZoneVector<MachineType>*>(state);
+ return (*types)[Top()->index];
+ }
+}
+
+
bool StateValuesAccess::iterator::operator!=(iterator& other) {
// We only allow comparison with end().
CHECK(other.done());
@@ -278,13 +294,16 @@ StateValuesAccess::iterator& StateValuesAccess::iterator::operator++() {
}
-Node* StateValuesAccess::iterator::operator*() { return node(); }
+StateValuesAccess::TypedNode StateValuesAccess::iterator::operator*() {
+ return TypedNode(node(), type());
+}
size_t StateValuesAccess::size() {
size_t count = 0;
for (int i = 0; i < node_->InputCount(); i++) {
- if (node_->InputAt(i)->opcode() == IrOpcode::kStateValues) {
+ if (node_->InputAt(i)->opcode() == IrOpcode::kStateValues ||
+ node_->InputAt(i)->opcode() == IrOpcode::kTypedStateValues) {
count += StateValuesAccess(node_->InputAt(i)).size();
} else {
count++;
« no previous file with comments | « src/compiler/state-values-utils.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698