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

Unified 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, 9 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 | « runtime/vm/object.h ('k') | runtime/vm/object_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index fce2db3f0afe8697421673e7ce99db2f9389fb4e..c85189f9071a166c221a56a297fa6b89b941c197 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -1609,6 +1609,15 @@ RawError* Object::Init(Isolate* isolate, kernel::Program* kernel_program) {
object_store->set_int_type(type);
cls = Class::New<Instance>(kIllegalCid);
+ RegisterPrivateClass(cls, Symbols::Int64(), core_lib);
+ cls.set_num_type_arguments(0);
+ cls.set_num_own_type_arguments(0);
+ cls.set_is_prefinalized();
+ pending_classes.Add(cls);
+ type = Type::NewNonParameterizedType(cls);
+ object_store->set_int64_type(type);
+
+ cls = Class::New<Instance>(kIllegalCid);
RegisterClass(cls, Symbols::Double(), core_lib);
cls.set_num_type_arguments(0);
cls.set_num_own_type_arguments(0);
@@ -16443,6 +16452,12 @@ bool AbstractType::IsIntType() const {
}
+bool AbstractType::IsInt64Type() const {
+ return !IsFunctionType() && HasResolvedTypeClass() &&
+ (type_class() == Type::Handle(Type::Int64Type()).type_class());
+}
+
+
bool AbstractType::IsDoubleType() const {
return !IsFunctionType() && HasResolvedTypeClass() &&
(type_class() == Type::Handle(Type::Double()).type_class());
@@ -16688,6 +16703,11 @@ RawType* Type::IntType() {
}
+RawType* Type::Int64Type() {
+ return Isolate::Current()->object_store()->int64_type();
+}
+
+
RawType* Type::SmiType() {
return Isolate::Current()->object_store()->smi_type();
}
« 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