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

Side by Side Diff: src/compiler/typer.cc

Issue 930003003: [turbofan] Transfer types from loop phis to OSR values. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/osr.cc ('k') | test/cctest/compiler/test-osr.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 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/base/flags.h" 5 #include "src/base/flags.h"
6 #include "src/bootstrapper.h" 6 #include "src/bootstrapper.h"
7 #include "src/compiler/graph-reducer.h" 7 #include "src/compiler/graph-reducer.h"
8 #include "src/compiler/js-operator.h" 8 #include "src/compiler/js-operator.h"
9 #include "src/compiler/node.h" 9 #include "src/compiler/node.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 return Bounds(Type::None(zone()), Type::Boolean(zone())); 616 return Bounds(Type::None(zone()), Type::Boolean(zone()));
617 } 617 }
618 618
619 619
620 Bounds Typer::Visitor::TypeParameter(Node* node) { 620 Bounds Typer::Visitor::TypeParameter(Node* node) {
621 return Bounds::Unbounded(zone()); 621 return Bounds::Unbounded(zone());
622 } 622 }
623 623
624 624
625 Bounds Typer::Visitor::TypeOsrValue(Node* node) { 625 Bounds Typer::Visitor::TypeOsrValue(Node* node) {
626 // OSR values explicitly have type {None} before OSR form is deconstructed.
627 if (node->InputAt(0)->opcode() == IrOpcode::kOsrLoopEntry) { 626 if (node->InputAt(0)->opcode() == IrOpcode::kOsrLoopEntry) {
627 // Before deconstruction, OSR values have type {None} to avoid polluting
628 // the types of phis and other nodes in the graph.
628 return Bounds(Type::None(), Type::None()); 629 return Bounds(Type::None(), Type::None());
629 } 630 }
630 // TODO(turbofan): preserve the type of OSR values after deconstruction. 631 if (NodeProperties::IsTyped(node)) {
632 // After deconstruction, OSR values may have had a type explicitly set.
633 return NodeProperties::GetBounds(node);
634 }
635 // Otherwise, be conservative.
631 return Bounds::Unbounded(zone()); 636 return Bounds::Unbounded(zone());
632 } 637 }
633 638
634 639
635 Bounds Typer::Visitor::TypeInt32Constant(Node* node) { 640 Bounds Typer::Visitor::TypeInt32Constant(Node* node) {
636 double number = OpParameter<int32_t>(node); 641 double number = OpParameter<int32_t>(node);
637 return Bounds(Type::Intersect( 642 return Bounds(Type::Intersect(
638 Type::Range(number, number, zone()), Type::UntaggedSigned32(), zone())); 643 Type::Range(number, number, zone()), Type::UntaggedSigned32(), zone()));
639 } 644 }
640 645
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after
2179 TYPED_ARRAYS(TYPED_ARRAY_CASE) 2184 TYPED_ARRAYS(TYPED_ARRAY_CASE)
2180 #undef TYPED_ARRAY_CASE 2185 #undef TYPED_ARRAY_CASE
2181 } 2186 }
2182 } 2187 }
2183 return Type::Constant(value, zone()); 2188 return Type::Constant(value, zone());
2184 } 2189 }
2185 2190
2186 } // namespace compiler 2191 } // namespace compiler
2187 } // namespace internal 2192 } // namespace internal
2188 } // namespace v8 2193 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/osr.cc ('k') | test/cctest/compiler/test-osr.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698