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

Unified Diff: src/compiler/load-elimination.cc

Issue 2203693002: [turbofan] Introduce initial support for TypedArrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5254
Patch Set: Fix Retain Created 4 years, 4 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/load-elimination.h ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/load-elimination.cc
diff --git a/src/compiler/load-elimination.cc b/src/compiler/load-elimination.cc
index de625cc94a8b05ed0f43c55c8f98f35e0dc9598b..317766d90598577d5891568835e2396632fb1e77 100644
--- a/src/compiler/load-elimination.cc
+++ b/src/compiler/load-elimination.cc
@@ -63,6 +63,8 @@ Reduction LoadElimination::Reduce(Node* node) {
return ReduceLoadElement(node);
case IrOpcode::kStoreElement:
return ReduceStoreElement(node);
+ case IrOpcode::kStoreTypedElement:
+ return ReduceStoreTypedElement(node);
case IrOpcode::kEffectPhi:
return ReduceEffectPhi(node);
case IrOpcode::kDead:
@@ -455,6 +457,13 @@ Reduction LoadElimination::ReduceStoreElement(Node* node) {
return UpdateState(node, state);
}
+Reduction LoadElimination::ReduceStoreTypedElement(Node* node) {
+ Node* const effect = NodeProperties::GetEffectInput(node);
+ AbstractState const* state = node_states_.Get(effect);
+ if (state == nullptr) return NoChange();
+ return UpdateState(node, state);
+}
+
Reduction LoadElimination::ReduceEffectPhi(Node* node) {
Node* const effect0 = NodeProperties::GetEffectInput(node, 0);
Node* const control = NodeProperties::GetControlInput(node);
@@ -571,15 +580,20 @@ LoadElimination::AbstractState const* LoadElimination::ComputeLoopState(
// static
int LoadElimination::FieldIndexOf(FieldAccess const& access) {
- switch (access.machine_type.representation()) {
+ MachineRepresentation rep = access.machine_type.representation();
+ switch (rep) {
case MachineRepresentation::kNone:
case MachineRepresentation::kBit:
UNREACHABLE();
break;
- case MachineRepresentation::kWord8:
- case MachineRepresentation::kWord16:
case MachineRepresentation::kWord32:
case MachineRepresentation::kWord64:
+ if (rep != MachineType::PointerRepresentation()) {
+ return -1; // We currently only track pointer size fields.
+ }
+ break;
+ case MachineRepresentation::kWord8:
+ case MachineRepresentation::kWord16:
case MachineRepresentation::kFloat32:
return -1; // Currently untracked.
case MachineRepresentation::kFloat64:
« no previous file with comments | « src/compiler/load-elimination.h ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698