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

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

Issue 1934973002: [turbofan] Extend the type fixup to LoadField as well. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/graph.h" 8 #include "src/compiler/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 16 matching lines...) Expand all
27 } 27 }
28 28
29 Reduction LoadElimination::ReduceLoadField(Node* node) { 29 Reduction LoadElimination::ReduceLoadField(Node* node) {
30 DCHECK_EQ(IrOpcode::kLoadField, node->opcode()); 30 DCHECK_EQ(IrOpcode::kLoadField, node->opcode());
31 FieldAccess const access = FieldAccessOf(node->op()); 31 FieldAccess const access = FieldAccessOf(node->op());
32 Node* object = NodeProperties::GetValueInput(node, 0); 32 Node* object = NodeProperties::GetValueInput(node, 0);
33 for (Node* effect = NodeProperties::GetEffectInput(node);; 33 for (Node* effect = NodeProperties::GetEffectInput(node);;
34 effect = NodeProperties::GetEffectInput(effect)) { 34 effect = NodeProperties::GetEffectInput(effect)) {
35 switch (effect->opcode()) { 35 switch (effect->opcode()) {
36 case IrOpcode::kLoadField: { 36 case IrOpcode::kLoadField: {
37 FieldAccess const effect_access = FieldAccessOf(effect->op());
37 if (object == NodeProperties::GetValueInput(effect, 0) && 38 if (object == NodeProperties::GetValueInput(effect, 0) &&
38 access == FieldAccessOf(effect->op())) { 39 access == effect_access && effect_access.type->Is(access.type)) {
39 Node* const value = effect; 40 Node* const value = effect;
40 ReplaceWithValue(node, value); 41 ReplaceWithValue(node, value);
41 return Replace(value); 42 return Replace(value);
42 } 43 }
43 break; 44 break;
44 } 45 }
45 case IrOpcode::kStoreField: { 46 case IrOpcode::kStoreField: {
46 if (access == FieldAccessOf(effect->op())) { 47 if (access == FieldAccessOf(effect->op())) {
47 if (object == NodeProperties::GetValueInput(effect, 0)) { 48 if (object == NodeProperties::GetValueInput(effect, 0)) {
48 Node* const value = NodeProperties::GetValueInput(effect, 1); 49 Node* const value = NodeProperties::GetValueInput(effect, 1);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 96 }
96 } 97 }
97 } 98 }
98 UNREACHABLE(); 99 UNREACHABLE();
99 return NoChange(); 100 return NoChange();
100 } 101 }
101 102
102 } // namespace compiler 103 } // namespace compiler
103 } // namespace internal 104 } // namespace internal
104 } // namespace v8 105 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698