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

Unified Diff: src/compiler/effect-control-linearizer.cc

Issue 2637363002: [turbofan] Unify Smi checking for Check(Internalized)String. (Closed)
Patch Set: Created 3 years, 11 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/simplified-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/effect-control-linearizer.cc
diff --git a/src/compiler/effect-control-linearizer.cc b/src/compiler/effect-control-linearizer.cc
index b88906cfc1c1adfbbb39bdcdaf72ab72919d7143..6173d88f09e824eb47963dd85ce7c5f047de4f16 100644
--- a/src/compiler/effect-control-linearizer.cc
+++ b/src/compiler/effect-control-linearizer.cc
@@ -1157,17 +1157,13 @@ Node* EffectControlLinearizer::LowerCheckNumber(Node* node, Node* frame_state) {
Node* EffectControlLinearizer::LowerCheckString(Node* node, Node* frame_state) {
Node* value = node->InputAt(0);
- Node* check0 = ObjectIsSmi(value);
- __ DeoptimizeIf(DeoptimizeReason::kSmi, check0, frame_state);
-
Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
Node* value_instance_type =
__ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
- Node* check1 = __ Uint32LessThan(value_instance_type,
- __ Uint32Constant(FIRST_NONSTRING_TYPE));
- __ DeoptimizeUnless(DeoptimizeReason::kWrongInstanceType, check1,
- frame_state);
+ Node* check = __ Uint32LessThan(value_instance_type,
+ __ Uint32Constant(FIRST_NONSTRING_TYPE));
+ __ DeoptimizeUnless(DeoptimizeReason::kWrongInstanceType, check, frame_state);
return value;
}
@@ -1175,19 +1171,15 @@ Node* EffectControlLinearizer::LowerCheckInternalizedString(Node* node,
Node* frame_state) {
Node* value = node->InputAt(0);
- Node* check0 = ObjectIsSmi(value);
- __ DeoptimizeIf(DeoptimizeReason::kSmi, check0, frame_state);
-
Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
Node* value_instance_type =
__ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
- Node* check1 = __ Word32Equal(
+ Node* check = __ Word32Equal(
__ Word32And(value_instance_type,
__ Int32Constant(kIsNotStringMask | kIsNotInternalizedMask)),
__ Int32Constant(kInternalizedTag));
- __ DeoptimizeUnless(DeoptimizeReason::kWrongInstanceType, check1,
- frame_state);
+ __ DeoptimizeUnless(DeoptimizeReason::kWrongInstanceType, check, frame_state);
return value;
}
« no previous file with comments | « no previous file | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698