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

Side by Side Diff: src/compiler/load-elimination.cc

Issue 2604393002: [turbofan] Utilize maps from field type tracking to eliminate map checks. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-native-context-specialization.cc ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/load-elimination.h" 5 #include "src/compiler/load-elimination.h"
6 6
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/js-graph.h" 8 #include "src/compiler/js-graph.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 #include "src/compiler/simplified-operator.h" 10 #include "src/compiler/simplified-operator.h"
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 replacement = graph()->NewNode(common()->TypeGuard(node_type), 737 replacement = graph()->NewNode(common()->TypeGuard(node_type),
738 replacement, control); 738 replacement, control);
739 } 739 }
740 ReplaceWithValue(node, replacement, effect); 740 ReplaceWithValue(node, replacement, effect);
741 return Replace(replacement); 741 return Replace(replacement);
742 } 742 }
743 } 743 }
744 state = state->AddField(object, field_index, node, zone()); 744 state = state->AddField(object, field_index, node, zone());
745 } 745 }
746 } 746 }
747 Handle<Map> field_map;
748 if (access.map.ToHandle(&field_map)) {
749 state = state->AddMaps(node, ZoneHandleSet<Map>(field_map), zone());
750 }
747 return UpdateState(node, state); 751 return UpdateState(node, state);
748 } 752 }
749 753
750 Reduction LoadElimination::ReduceStoreField(Node* node) { 754 Reduction LoadElimination::ReduceStoreField(Node* node) {
751 FieldAccess const& access = FieldAccessOf(node->op()); 755 FieldAccess const& access = FieldAccessOf(node->op());
752 Node* const object = NodeProperties::GetValueInput(node, 0); 756 Node* const object = NodeProperties::GetValueInput(node, 0);
753 Node* const new_value = NodeProperties::GetValueInput(node, 1); 757 Node* const new_value = NodeProperties::GetValueInput(node, 1);
754 Node* const effect = NodeProperties::GetEffectInput(node); 758 Node* const effect = NodeProperties::GetEffectInput(node);
755 AbstractState const* state = node_states_.Get(effect); 759 AbstractState const* state = node_states_.Get(effect);
756 if (state == nullptr) return NoChange(); 760 if (state == nullptr) return NoChange();
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 return jsgraph()->common(); 1068 return jsgraph()->common();
1065 } 1069 }
1066 1070
1067 Graph* LoadElimination::graph() const { return jsgraph()->graph(); } 1071 Graph* LoadElimination::graph() const { return jsgraph()->graph(); }
1068 1072
1069 Factory* LoadElimination::factory() const { return jsgraph()->factory(); } 1073 Factory* LoadElimination::factory() const { return jsgraph()->factory(); }
1070 1074
1071 } // namespace compiler 1075 } // namespace compiler
1072 } // namespace internal 1076 } // namespace internal
1073 } // namespace v8 1077 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-native-context-specialization.cc ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698