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

Side by Side Diff: src/compiler/js-global-object-specialization.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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-builtin-reducer.cc ('k') | src/compiler/js-native-context-specialization.h » ('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/js-global-object-specialization.h" 5 #include "src/compiler/js-global-object-specialization.h"
6 6
7 #include "src/compilation-dependencies.h" 7 #include "src/compilation-dependencies.h"
8 #include "src/compiler/access-builder.h" 8 #include "src/compiler/access-builder.h"
9 #include "src/compiler/common-operator.h" 9 #include "src/compiler/common-operator.h"
10 #include "src/compiler/js-graph.h" 10 #include "src/compiler/js-graph.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 break; 200 break;
201 } 201 }
202 case PropertyCellType::kConstantType: { 202 case PropertyCellType::kConstantType: {
203 // Record a code dependency on the cell, and just deoptimize if the new 203 // Record a code dependency on the cell, and just deoptimize if the new
204 // values' type doesn't match the type of the previous value in the cell. 204 // values' type doesn't match the type of the previous value in the cell.
205 dependencies()->AssumePropertyCell(property_cell); 205 dependencies()->AssumePropertyCell(property_cell);
206 Type* property_cell_value_type; 206 Type* property_cell_value_type;
207 MachineRepresentation representation = MachineRepresentation::kTagged; 207 MachineRepresentation representation = MachineRepresentation::kTagged;
208 if (property_cell_value->IsHeapObject()) { 208 if (property_cell_value->IsHeapObject()) {
209 // Check that the {value} is a HeapObject. 209 // Check that the {value} is a HeapObject.
210 value = effect = graph()->NewNode(simplified()->CheckTaggedPointer(), 210 value = effect = graph()->NewNode(simplified()->CheckHeapObject(),
211 value, effect, control); 211 value, effect, control);
212 212
213 // Check {value} map agains the {property_cell} map. 213 // Check {value} map agains the {property_cell} map.
214 Handle<Map> property_cell_value_map( 214 Handle<Map> property_cell_value_map(
215 Handle<HeapObject>::cast(property_cell_value)->map(), isolate()); 215 Handle<HeapObject>::cast(property_cell_value)->map(), isolate());
216 effect = graph()->NewNode( 216 effect = graph()->NewNode(
217 simplified()->CheckMaps(1), value, 217 simplified()->CheckMaps(1), value,
218 jsgraph()->HeapConstant(property_cell_value_map), effect, control); 218 jsgraph()->HeapConstant(property_cell_value_map), effect, control);
219 property_cell_value_type = Type::OtherInternal(); 219 property_cell_value_type = Type::OtherInternal();
220 representation = MachineRepresentation::kTaggedPointer; 220 representation = MachineRepresentation::kTaggedPointer;
221 } else { 221 } else {
222 // Check that the {value} is a Smi. 222 // Check that the {value} is a Smi.
223 value = effect = graph()->NewNode(simplified()->CheckTaggedSigned(), 223 value = effect =
224 value, effect, control); 224 graph()->NewNode(simplified()->CheckSmi(), value, effect, control);
225 property_cell_value_type = Type::SignedSmall(); 225 property_cell_value_type = Type::SignedSmall();
226 representation = MachineRepresentation::kTaggedSigned; 226 representation = MachineRepresentation::kTaggedSigned;
227 } 227 }
228 effect = graph()->NewNode( 228 effect = graph()->NewNode(
229 simplified()->StoreField(ForPropertyCellValue( 229 simplified()->StoreField(ForPropertyCellValue(
230 representation, property_cell_value_type, name)), 230 representation, property_cell_value_type, name)),
231 jsgraph()->HeapConstant(property_cell), value, effect, control); 231 jsgraph()->HeapConstant(property_cell), value, effect, control);
232 break; 232 break;
233 } 233 }
234 case PropertyCellType::kMutable: { 234 case PropertyCellType::kMutable: {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 } 300 }
301 301
302 302
303 SimplifiedOperatorBuilder* JSGlobalObjectSpecialization::simplified() const { 303 SimplifiedOperatorBuilder* JSGlobalObjectSpecialization::simplified() const {
304 return jsgraph()->simplified(); 304 return jsgraph()->simplified();
305 } 305 }
306 306
307 } // namespace compiler 307 } // namespace compiler
308 } // namespace internal 308 } // namespace internal
309 } // namespace v8 309 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-builtin-reducer.cc ('k') | src/compiler/js-native-context-specialization.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698