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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/simplified-lowering.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/effect-control-linearizer.h" 5 #include "src/compiler/effect-control-linearizer.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/compiler/access-builder.h" 8 #include "src/compiler/access-builder.h"
9 #include "src/compiler/compiler-source-position-table.h" 9 #include "src/compiler/compiler-source-position-table.h"
10 #include "src/compiler/js-graph.h" 10 #include "src/compiler/js-graph.h"
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 __ DeoptimizeUnless(DeoptimizeReason::kNotAHeapNumber, check1, frame_state); 1150 __ DeoptimizeUnless(DeoptimizeReason::kNotAHeapNumber, check1, frame_state);
1151 __ Goto(&done); 1151 __ Goto(&done);
1152 1152
1153 __ Bind(&done); 1153 __ Bind(&done);
1154 return value; 1154 return value;
1155 } 1155 }
1156 1156
1157 Node* EffectControlLinearizer::LowerCheckString(Node* node, Node* frame_state) { 1157 Node* EffectControlLinearizer::LowerCheckString(Node* node, Node* frame_state) {
1158 Node* value = node->InputAt(0); 1158 Node* value = node->InputAt(0);
1159 1159
1160 Node* check0 = ObjectIsSmi(value);
1161 __ DeoptimizeIf(DeoptimizeReason::kSmi, check0, frame_state);
1162
1163 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value); 1160 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
1164 Node* value_instance_type = 1161 Node* value_instance_type =
1165 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map); 1162 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
1166 1163
1167 Node* check1 = __ Uint32LessThan(value_instance_type, 1164 Node* check = __ Uint32LessThan(value_instance_type,
1168 __ Uint32Constant(FIRST_NONSTRING_TYPE)); 1165 __ Uint32Constant(FIRST_NONSTRING_TYPE));
1169 __ DeoptimizeUnless(DeoptimizeReason::kWrongInstanceType, check1, 1166 __ DeoptimizeUnless(DeoptimizeReason::kWrongInstanceType, check, frame_state);
1170 frame_state);
1171 return value; 1167 return value;
1172 } 1168 }
1173 1169
1174 Node* EffectControlLinearizer::LowerCheckInternalizedString(Node* node, 1170 Node* EffectControlLinearizer::LowerCheckInternalizedString(Node* node,
1175 Node* frame_state) { 1171 Node* frame_state) {
1176 Node* value = node->InputAt(0); 1172 Node* value = node->InputAt(0);
1177 1173
1178 Node* check0 = ObjectIsSmi(value);
1179 __ DeoptimizeIf(DeoptimizeReason::kSmi, check0, frame_state);
1180
1181 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value); 1174 Node* value_map = __ LoadField(AccessBuilder::ForMap(), value);
1182 Node* value_instance_type = 1175 Node* value_instance_type =
1183 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map); 1176 __ LoadField(AccessBuilder::ForMapInstanceType(), value_map);
1184 1177
1185 Node* check1 = __ Word32Equal( 1178 Node* check = __ Word32Equal(
1186 __ Word32And(value_instance_type, 1179 __ Word32And(value_instance_type,
1187 __ Int32Constant(kIsNotStringMask | kIsNotInternalizedMask)), 1180 __ Int32Constant(kIsNotStringMask | kIsNotInternalizedMask)),
1188 __ Int32Constant(kInternalizedTag)); 1181 __ Int32Constant(kInternalizedTag));
1189 __ DeoptimizeUnless(DeoptimizeReason::kWrongInstanceType, check1, 1182 __ DeoptimizeUnless(DeoptimizeReason::kWrongInstanceType, check, frame_state);
1190 frame_state);
1191 1183
1192 return value; 1184 return value;
1193 } 1185 }
1194 1186
1195 Node* EffectControlLinearizer::LowerCheckIf(Node* node, Node* frame_state) { 1187 Node* EffectControlLinearizer::LowerCheckIf(Node* node, Node* frame_state) {
1196 Node* value = node->InputAt(0); 1188 Node* value = node->InputAt(0);
1197 __ DeoptimizeUnless(DeoptimizeReason::kNoReason, value, frame_state); 1189 __ DeoptimizeUnless(DeoptimizeReason::kNoReason, value, frame_state);
1198 return value; 1190 return value;
1199 } 1191 }
1200 1192
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after
2704 return isolate()->factory(); 2696 return isolate()->factory();
2705 } 2697 }
2706 2698
2707 Isolate* EffectControlLinearizer::isolate() const { 2699 Isolate* EffectControlLinearizer::isolate() const {
2708 return jsgraph()->isolate(); 2700 return jsgraph()->isolate();
2709 } 2701 }
2710 2702
2711 } // namespace compiler 2703 } // namespace compiler
2712 } // namespace internal 2704 } // namespace internal
2713 } // namespace v8 2705 } // namespace v8
OLDNEW
« 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