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

Side by Side Diff: src/compiler/typed-optimization.cc

Issue 2820603002: Revert of Merged: Squashed multiple commits. (Closed)
Patch Set: Created 3 years, 8 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/typed-optimization.h ('k') | src/compiler/typer.cc » ('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/typed-optimization.h" 5 #include "src/compiler/typed-optimization.h"
6 6
7 #include "src/compilation-dependencies.h" 7 #include "src/compilation-dependencies.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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 ReplaceWithValue(node, replacement); 71 ReplaceWithValue(node, replacement);
72 return Changed(replacement); 72 return Changed(replacement);
73 } 73 }
74 } 74 }
75 } 75 }
76 switch (node->opcode()) { 76 switch (node->opcode()) {
77 case IrOpcode::kCheckHeapObject: 77 case IrOpcode::kCheckHeapObject:
78 return ReduceCheckHeapObject(node); 78 return ReduceCheckHeapObject(node);
79 case IrOpcode::kCheckMaps: 79 case IrOpcode::kCheckMaps:
80 return ReduceCheckMaps(node); 80 return ReduceCheckMaps(node);
81 case IrOpcode::kCheckNumber:
82 return ReduceCheckNumber(node);
83 case IrOpcode::kCheckString: 81 case IrOpcode::kCheckString:
84 return ReduceCheckString(node); 82 return ReduceCheckString(node);
85 case IrOpcode::kLoadField: 83 case IrOpcode::kLoadField:
86 return ReduceLoadField(node); 84 return ReduceLoadField(node);
87 case IrOpcode::kNumberCeil: 85 case IrOpcode::kNumberCeil:
88 case IrOpcode::kNumberRound: 86 case IrOpcode::kNumberRound:
89 case IrOpcode::kNumberTrunc: 87 case IrOpcode::kNumberTrunc:
90 return ReduceNumberRoundop(node); 88 return ReduceNumberRoundop(node);
91 case IrOpcode::kNumberFloor: 89 case IrOpcode::kNumberFloor:
92 return ReduceNumberFloor(node); 90 return ReduceNumberFloor(node);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 map_type->AsHeapConstant()->Value().is_identical_to(object_map)) { 142 map_type->AsHeapConstant()->Value().is_identical_to(object_map)) {
145 if (object_map->CanTransition()) { 143 if (object_map->CanTransition()) {
146 dependencies()->AssumeMapStable(object_map); 144 dependencies()->AssumeMapStable(object_map);
147 } 145 }
148 return Replace(effect); 146 return Replace(effect);
149 } 147 }
150 } 148 }
151 } 149 }
152 return NoChange(); 150 return NoChange();
153 } 151 }
154
155 Reduction TypedOptimization::ReduceCheckNumber(Node* node) {
156 Node* const input = NodeProperties::GetValueInput(node, 0);
157 Type* const input_type = NodeProperties::GetType(input);
158 if (input_type->Is(Type::Number())) {
159 ReplaceWithValue(node, input);
160 return Replace(input);
161 }
162 return NoChange();
163 }
164 152
165 Reduction TypedOptimization::ReduceCheckString(Node* node) { 153 Reduction TypedOptimization::ReduceCheckString(Node* node) {
166 Node* const input = NodeProperties::GetValueInput(node, 0); 154 Node* const input = NodeProperties::GetValueInput(node, 0);
167 Type* const input_type = NodeProperties::GetType(input); 155 Type* const input_type = NodeProperties::GetType(input);
168 if (input_type->Is(Type::String())) { 156 if (input_type->Is(Type::String())) {
169 ReplaceWithValue(node, input); 157 ReplaceWithValue(node, input);
170 return Replace(input); 158 return Replace(input);
171 } 159 }
172 return NoChange(); 160 return NoChange();
173 } 161 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 316
329 Isolate* TypedOptimization::isolate() const { return jsgraph()->isolate(); } 317 Isolate* TypedOptimization::isolate() const { return jsgraph()->isolate(); }
330 318
331 SimplifiedOperatorBuilder* TypedOptimization::simplified() const { 319 SimplifiedOperatorBuilder* TypedOptimization::simplified() const {
332 return jsgraph()->simplified(); 320 return jsgraph()->simplified();
333 } 321 }
334 322
335 } // namespace compiler 323 } // namespace compiler
336 } // namespace internal 324 } // namespace internal
337 } // namespace v8 325 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/typed-optimization.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698