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

Side by Side Diff: runtime/vm/object.cc

Issue 2772143002: Reland "VM: Handle null-comparisons in the flow graph type propagation" (Closed)
Patch Set: address comments Created 3 years, 8 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 | « runtime/vm/object.h ('k') | runtime/vm/object_store.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/become.h" 10 #include "vm/become.h"
(...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 cls = Class::New<Instance>(kIllegalCid); 1602 cls = Class::New<Instance>(kIllegalCid);
1603 RegisterClass(cls, Symbols::Int(), core_lib); 1603 RegisterClass(cls, Symbols::Int(), core_lib);
1604 cls.set_num_type_arguments(0); 1604 cls.set_num_type_arguments(0);
1605 cls.set_num_own_type_arguments(0); 1605 cls.set_num_own_type_arguments(0);
1606 cls.set_is_prefinalized(); 1606 cls.set_is_prefinalized();
1607 pending_classes.Add(cls); 1607 pending_classes.Add(cls);
1608 type = Type::NewNonParameterizedType(cls); 1608 type = Type::NewNonParameterizedType(cls);
1609 object_store->set_int_type(type); 1609 object_store->set_int_type(type);
1610 1610
1611 cls = Class::New<Instance>(kIllegalCid); 1611 cls = Class::New<Instance>(kIllegalCid);
1612 RegisterPrivateClass(cls, Symbols::Int64(), core_lib);
1613 cls.set_num_type_arguments(0);
1614 cls.set_num_own_type_arguments(0);
1615 cls.set_is_prefinalized();
1616 pending_classes.Add(cls);
1617 type = Type::NewNonParameterizedType(cls);
1618 object_store->set_int64_type(type);
1619
1620 cls = Class::New<Instance>(kIllegalCid);
1612 RegisterClass(cls, Symbols::Double(), core_lib); 1621 RegisterClass(cls, Symbols::Double(), core_lib);
1613 cls.set_num_type_arguments(0); 1622 cls.set_num_type_arguments(0);
1614 cls.set_num_own_type_arguments(0); 1623 cls.set_num_own_type_arguments(0);
1615 cls.set_is_prefinalized(); 1624 cls.set_is_prefinalized();
1616 pending_classes.Add(cls); 1625 pending_classes.Add(cls);
1617 type = Type::NewNonParameterizedType(cls); 1626 type = Type::NewNonParameterizedType(cls);
1618 object_store->set_double_type(type); 1627 object_store->set_double_type(type);
1619 1628
1620 name = Symbols::_String().raw(); 1629 name = Symbols::_String().raw();
1621 cls = Class::New<Instance>(kIllegalCid); 1630 cls = Class::New<Instance>(kIllegalCid);
(...skipping 14814 matching lines...) Expand 10 before | Expand all | Expand 10 after
16436 (type_class() == Isolate::Current()->object_store()->bool_class()); 16445 (type_class() == Isolate::Current()->object_store()->bool_class());
16437 } 16446 }
16438 16447
16439 16448
16440 bool AbstractType::IsIntType() const { 16449 bool AbstractType::IsIntType() const {
16441 return !IsFunctionType() && HasResolvedTypeClass() && 16450 return !IsFunctionType() && HasResolvedTypeClass() &&
16442 (type_class() == Type::Handle(Type::IntType()).type_class()); 16451 (type_class() == Type::Handle(Type::IntType()).type_class());
16443 } 16452 }
16444 16453
16445 16454
16455 bool AbstractType::IsInt64Type() const {
16456 return !IsFunctionType() && HasResolvedTypeClass() &&
16457 (type_class() == Type::Handle(Type::Int64Type()).type_class());
16458 }
16459
16460
16446 bool AbstractType::IsDoubleType() const { 16461 bool AbstractType::IsDoubleType() const {
16447 return !IsFunctionType() && HasResolvedTypeClass() && 16462 return !IsFunctionType() && HasResolvedTypeClass() &&
16448 (type_class() == Type::Handle(Type::Double()).type_class()); 16463 (type_class() == Type::Handle(Type::Double()).type_class());
16449 } 16464 }
16450 16465
16451 16466
16452 bool AbstractType::IsFloat32x4Type() const { 16467 bool AbstractType::IsFloat32x4Type() const {
16453 return !IsFunctionType() && HasResolvedTypeClass() && 16468 return !IsFunctionType() && HasResolvedTypeClass() &&
16454 (type_class() == Type::Handle(Type::Float32x4()).type_class()); 16469 (type_class() == Type::Handle(Type::Float32x4()).type_class());
16455 } 16470 }
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
16681 RawType* Type::BoolType() { 16696 RawType* Type::BoolType() {
16682 return Isolate::Current()->object_store()->bool_type(); 16697 return Isolate::Current()->object_store()->bool_type();
16683 } 16698 }
16684 16699
16685 16700
16686 RawType* Type::IntType() { 16701 RawType* Type::IntType() {
16687 return Isolate::Current()->object_store()->int_type(); 16702 return Isolate::Current()->object_store()->int_type();
16688 } 16703 }
16689 16704
16690 16705
16706 RawType* Type::Int64Type() {
16707 return Isolate::Current()->object_store()->int64_type();
16708 }
16709
16710
16691 RawType* Type::SmiType() { 16711 RawType* Type::SmiType() {
16692 return Isolate::Current()->object_store()->smi_type(); 16712 return Isolate::Current()->object_store()->smi_type();
16693 } 16713 }
16694 16714
16695 16715
16696 RawType* Type::MintType() { 16716 RawType* Type::MintType() {
16697 return Isolate::Current()->object_store()->mint_type(); 16717 return Isolate::Current()->object_store()->mint_type();
16698 } 16718 }
16699 16719
16700 16720
(...skipping 6407 matching lines...) Expand 10 before | Expand all | Expand 10 after
23108 return UserTag::null(); 23128 return UserTag::null();
23109 } 23129 }
23110 23130
23111 23131
23112 const char* UserTag::ToCString() const { 23132 const char* UserTag::ToCString() const {
23113 const String& tag_label = String::Handle(label()); 23133 const String& tag_label = String::Handle(label());
23114 return tag_label.ToCString(); 23134 return tag_label.ToCString();
23115 } 23135 }
23116 23136
23117 } // namespace dart 23137 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698