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

Unified Diff: src/compiler/typed-optimization.cc

Issue 2381523002: [Turbofan] Introduce OtherNumberConstant. (Closed)
Patch Set: Better DCHECK in HeapConstantType(). Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/simplified-lowering.cc ('k') | src/compiler/typer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/typed-optimization.cc
diff --git a/src/compiler/typed-optimization.cc b/src/compiler/typed-optimization.cc
index c5e8648ca5457ee18c38cae036eda6652d20aaf8..34661ee9618d99b2888cc495e0975b51e9cab5bc 100644
--- a/src/compiler/typed-optimization.cc
+++ b/src/compiler/typed-optimization.cc
@@ -22,8 +22,9 @@ TypedOptimization::TypedOptimization(Editor* editor,
dependencies_(dependencies),
flags_(flags),
jsgraph_(jsgraph),
- true_type_(Type::Constant(factory()->true_value(), graph()->zone())),
- false_type_(Type::Constant(factory()->false_value(), graph()->zone())),
+ true_type_(Type::HeapConstant(factory()->true_value(), graph()->zone())),
+ false_type_(
+ Type::HeapConstant(factory()->false_value(), graph()->zone())),
type_cache_(TypeCache::Get()) {}
TypedOptimization::~TypedOptimization() {}
@@ -43,8 +44,9 @@ Reduction TypedOptimization::Reduce(Node* node) {
// the Operator::kNoDeopt property).
Type* upper = NodeProperties::GetType(node);
if (upper->IsInhabited()) {
- if (upper->IsConstant()) {
- Node* replacement = jsgraph()->Constant(upper->AsConstant()->Value());
+ if (upper->IsHeapConstant()) {
+ Node* replacement =
+ jsgraph()->Constant(upper->AsHeapConstant()->Value());
ReplaceWithValue(node, replacement);
return Changed(replacement);
} else if (upper->Is(Type::MinusZero())) {
@@ -96,10 +98,11 @@ Reduction TypedOptimization::Reduce(Node* node) {
namespace {
MaybeHandle<Map> GetStableMapFromObjectType(Type* object_type) {
- if (object_type->IsConstant() &&
- object_type->AsConstant()->Value()->IsHeapObject()) {
+ if (object_type->IsHeapConstant() &&
+ object_type->AsHeapConstant()->Value()->IsHeapObject()) {
Handle<Map> object_map(
- Handle<HeapObject>::cast(object_type->AsConstant()->Value())->map());
+ Handle<HeapObject>::cast(object_type->AsHeapConstant()->Value())
+ ->map());
if (object_map->is_stable()) return object_map;
}
return MaybeHandle<Map>();
@@ -121,8 +124,8 @@ Reduction TypedOptimization::ReduceCheckMaps(Node* node) {
for (int i = 1; i < node->op()->ValueInputCount(); ++i) {
Node* const map = NodeProperties::GetValueInput(node, i);
Type* const map_type = NodeProperties::GetType(map);
- if (map_type->IsConstant() &&
- map_type->AsConstant()->Value().is_identical_to(object_map)) {
+ if (map_type->IsHeapConstant() &&
+ map_type->AsHeapConstant()->Value().is_identical_to(object_map)) {
if (object_map->CanTransition()) {
dependencies()->AssumeMapStable(object_map);
}
« no previous file with comments | « src/compiler/simplified-lowering.cc ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698