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

Unified Diff: src/compiler/code-generator.cc

Issue 2362173003: [turbofan] Improve representation selection for Smi checking. (Closed)
Patch Set: Address comments Created 4 years, 3 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 | « no previous file | src/compiler/effect-control-linearizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-generator.cc
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
index c588ae2358a64c4f6add590a75d30f4a73edc6ab..775861574d1183aa8e234e3071070130c0a4af57 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -880,13 +880,21 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation,
DCHECK(constant_object->IsSmi());
break;
case Constant::kFloat32:
- DCHECK(type.representation() == MachineRepresentation::kFloat32 ||
- CanBeTaggedPointer(type.representation()));
+ if (type.representation() == MachineRepresentation::kTaggedSigned) {
+ DCHECK(IsSmiDouble(constant.ToFloat32()));
+ } else {
+ DCHECK(type.representation() == MachineRepresentation::kFloat32 ||
+ CanBeTaggedPointer(type.representation()));
+ }
constant_object = isolate()->factory()->NewNumber(constant.ToFloat32());
break;
case Constant::kFloat64:
- DCHECK(type.representation() == MachineRepresentation::kFloat64 ||
- CanBeTaggedPointer(type.representation()));
+ if (type.representation() == MachineRepresentation::kTaggedSigned) {
+ DCHECK(IsSmiDouble(constant.ToFloat64()));
+ } else {
+ DCHECK(type.representation() == MachineRepresentation::kFloat64 ||
+ CanBeTaggedPointer(type.representation()));
+ }
constant_object = isolate()->factory()->NewNumber(constant.ToFloat64());
break;
case Constant::kHeapObject:
« no previous file with comments | « no previous file | src/compiler/effect-control-linearizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698