OLD | NEW |
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/typer.h" | 5 #include "src/compiler/typer.h" |
6 | 6 |
7 #include <iomanip> | 7 #include <iomanip> |
8 | 8 |
9 #include "src/base/flags.h" | 9 #include "src/base/flags.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 static Type* JSLoadPropertyTyper(Type*, Type*, Typer*); | 297 static Type* JSLoadPropertyTyper(Type*, Type*, Typer*); |
298 static Type* JSCallFunctionTyper(Type*, Typer*); | 298 static Type* JSCallFunctionTyper(Type*, Typer*); |
299 | 299 |
300 static Type* ReferenceEqualTyper(Type*, Type*, Typer*); | 300 static Type* ReferenceEqualTyper(Type*, Type*, Typer*); |
301 static Type* StringFromCharCodeTyper(Type*, Typer*); | 301 static Type* StringFromCharCodeTyper(Type*, Typer*); |
302 | 302 |
303 Reduction UpdateType(Node* node, Type* current) { | 303 Reduction UpdateType(Node* node, Type* current) { |
304 if (NodeProperties::IsTyped(node)) { | 304 if (NodeProperties::IsTyped(node)) { |
305 // Widen the type of a previously typed node. | 305 // Widen the type of a previously typed node. |
306 Type* previous = NodeProperties::GetType(node); | 306 Type* previous = NodeProperties::GetType(node); |
307 if (node->opcode() == IrOpcode::kPhi) { | 307 if (node->opcode() == IrOpcode::kPhi || |
| 308 node->opcode() == IrOpcode::kInductionVariablePhi) { |
308 // Speed up termination in the presence of range types: | 309 // Speed up termination in the presence of range types: |
309 current = Weaken(node, current, previous); | 310 current = Weaken(node, current, previous); |
310 } | 311 } |
311 | 312 |
312 CHECK(previous->Is(current)); | 313 CHECK(previous->Is(current)); |
313 | 314 |
314 NodeProperties::SetType(node, current); | 315 NodeProperties::SetType(node, current); |
315 if (!current->Is(previous)) { | 316 if (!current->Is(previous)) { |
316 // If something changed, revisit all uses. | 317 // If something changed, revisit all uses. |
317 return Changed(node); | 318 return Changed(node); |
(...skipping 1990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2308 } | 2309 } |
2309 if (Type::IsInteger(*value)) { | 2310 if (Type::IsInteger(*value)) { |
2310 return Type::Range(value->Number(), value->Number(), zone()); | 2311 return Type::Range(value->Number(), value->Number(), zone()); |
2311 } | 2312 } |
2312 return Type::Constant(value, zone()); | 2313 return Type::Constant(value, zone()); |
2313 } | 2314 } |
2314 | 2315 |
2315 } // namespace compiler | 2316 } // namespace compiler |
2316 } // namespace internal | 2317 } // namespace internal |
2317 } // namespace v8 | 2318 } // namespace v8 |
OLD | NEW |