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

Side by Side Diff: src/compiler/access-info.cc

Issue 2488183002: [turbofan] Address a couple of Type-related TODOs. (Closed)
Patch Set: Now with green bots. Created 4 years, 1 month 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/access-builder.cc ('k') | src/compiler/js-global-object-specialization.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 <ostream> 5 #include <ostream>
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/compilation-dependencies.h" 8 #include "src/compilation-dependencies.h"
9 #include "src/compiler/access-info.h" 9 #include "src/compiler/access-info.h"
10 #include "src/compiler/type-cache.h" 10 #include "src/compiler/type-cache.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 case DATA: { 293 case DATA: {
294 int index = descriptors->GetFieldIndex(number); 294 int index = descriptors->GetFieldIndex(number);
295 Representation details_representation = details.representation(); 295 Representation details_representation = details.representation();
296 FieldIndex field_index = FieldIndex::ForPropertyIndex( 296 FieldIndex field_index = FieldIndex::ForPropertyIndex(
297 *map, index, details_representation.IsDouble()); 297 *map, index, details_representation.IsDouble());
298 Type* field_type = Type::NonInternal(); 298 Type* field_type = Type::NonInternal();
299 MachineRepresentation field_representation = 299 MachineRepresentation field_representation =
300 MachineRepresentation::kTagged; 300 MachineRepresentation::kTagged;
301 MaybeHandle<Map> field_map; 301 MaybeHandle<Map> field_map;
302 if (details_representation.IsSmi()) { 302 if (details_representation.IsSmi()) {
303 field_type = type_cache_.kSmi; 303 field_type = Type::SignedSmall();
304 field_representation = MachineRepresentation::kTaggedSigned; 304 field_representation = MachineRepresentation::kTaggedSigned;
305 } else if (details_representation.IsDouble()) { 305 } else if (details_representation.IsDouble()) {
306 field_type = type_cache_.kFloat64; 306 field_type = type_cache_.kFloat64;
307 field_representation = MachineRepresentation::kFloat64; 307 field_representation = MachineRepresentation::kFloat64;
308 } else if (details_representation.IsHeapObject()) { 308 } else if (details_representation.IsHeapObject()) {
309 // Extract the field type from the property details (make sure its 309 // Extract the field type from the property details (make sure its
310 // representation is TaggedPointer to reflect the heap object case). 310 // representation is TaggedPointer to reflect the heap object case).
311 field_representation = MachineRepresentation::kTaggedPointer; 311 field_representation = MachineRepresentation::kTaggedPointer;
312 Handle<FieldType> descriptors_field_type( 312 Handle<FieldType> descriptors_field_type(
313 descriptors->GetFieldType(number), isolate()); 313 descriptors->GetFieldType(number), isolate());
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 // TODO(bmeurer): Handle transition to data constant? 490 // TODO(bmeurer): Handle transition to data constant?
491 if (details.type() != DATA) return false; 491 if (details.type() != DATA) return false;
492 int const index = details.field_index(); 492 int const index = details.field_index();
493 Representation details_representation = details.representation(); 493 Representation details_representation = details.representation();
494 FieldIndex field_index = FieldIndex::ForPropertyIndex( 494 FieldIndex field_index = FieldIndex::ForPropertyIndex(
495 *transition_map, index, details_representation.IsDouble()); 495 *transition_map, index, details_representation.IsDouble());
496 Type* field_type = Type::NonInternal(); 496 Type* field_type = Type::NonInternal();
497 MaybeHandle<Map> field_map; 497 MaybeHandle<Map> field_map;
498 MachineRepresentation field_representation = MachineRepresentation::kTagged; 498 MachineRepresentation field_representation = MachineRepresentation::kTagged;
499 if (details_representation.IsSmi()) { 499 if (details_representation.IsSmi()) {
500 field_type = type_cache_.kSmi; 500 field_type = Type::SignedSmall();
501 field_representation = MachineRepresentation::kTaggedSigned; 501 field_representation = MachineRepresentation::kTaggedSigned;
502 } else if (details_representation.IsDouble()) { 502 } else if (details_representation.IsDouble()) {
503 field_type = type_cache_.kFloat64; 503 field_type = type_cache_.kFloat64;
504 field_representation = MachineRepresentation::kFloat64; 504 field_representation = MachineRepresentation::kFloat64;
505 } else if (details_representation.IsHeapObject()) { 505 } else if (details_representation.IsHeapObject()) {
506 // Extract the field type from the property details (make sure its 506 // Extract the field type from the property details (make sure its
507 // representation is TaggedPointer to reflect the heap object case). 507 // representation is TaggedPointer to reflect the heap object case).
508 field_representation = MachineRepresentation::kTaggedPointer; 508 field_representation = MachineRepresentation::kTaggedPointer;
509 Handle<FieldType> descriptors_field_type( 509 Handle<FieldType> descriptors_field_type(
510 transition_map->instance_descriptors()->GetFieldType(number), 510 transition_map->instance_descriptors()->GetFieldType(number),
(...skipping 20 matching lines...) Expand all
531 } 531 }
532 return false; 532 return false;
533 } 533 }
534 534
535 535
536 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); } 536 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); }
537 537
538 } // namespace compiler 538 } // namespace compiler
539 } // namespace internal 539 } // namespace internal
540 } // namespace v8 540 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/access-builder.cc ('k') | src/compiler/js-global-object-specialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698