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

Unified Diff: runtime/lib/object.cc

Issue 2509013002: Allocate generic types in new-space before canonicalizing. (Closed)
Patch Set: formatting 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/class_finalizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/object.cc
diff --git a/runtime/lib/object.cc b/runtime/lib/object.cc
index 276d0d2cf9442882b13f7ac4f1613dd297042f29..6a7db559ec3a78d1293d9cb85edde40dde3c54b7 100644
--- a/runtime/lib/object.cc
+++ b/runtime/lib/object.cc
@@ -123,7 +123,7 @@ DEFINE_NATIVE_ENTRY(Object_runtimeType, 1) {
} else if (instance.IsDouble()) {
return Type::Double();
}
- return instance.GetType();
+ return instance.GetType(Heap::kNew);
}
@@ -147,8 +147,10 @@ DEFINE_NATIVE_ENTRY(Object_haveSameRuntimeType, 2) {
const Class& cls = Class::Handle(left.clazz());
if (cls.IsClosureClass()) {
// TODO(vegorov): provide faster implementation for closure classes.
- const AbstractType& left_type = AbstractType::Handle(left.GetType());
- const AbstractType& right_type = AbstractType::Handle(right.GetType());
+ const AbstractType& left_type =
+ AbstractType::Handle(left.GetType(Heap::kNew));
+ const AbstractType& right_type =
+ AbstractType::Handle(right.GetType(Heap::kNew));
return Bool::Get(left_type.raw() == right_type.raw()).raw();
}
@@ -182,7 +184,7 @@ DEFINE_NATIVE_ENTRY(Object_instanceOf, 4) {
const char* result_str = is_instance_of ? "true" : "false";
OS::Print("Native Object.instanceOf: result %s\n", result_str);
const AbstractType& instance_type =
- AbstractType::Handle(zone, instance.GetType());
+ AbstractType::Handle(zone, instance.GetType(Heap::kNew));
OS::Print(" instance type: %s\n",
String::Handle(zone, instance_type.Name()).ToCString());
OS::Print(" test type: %s\n",
@@ -318,7 +320,7 @@ DEFINE_NATIVE_ENTRY(Object_as, 3) {
const char* result_str = is_instance_of ? "true" : "false";
OS::Print("Object.as: result %s\n", result_str);
const AbstractType& instance_type =
- AbstractType::Handle(zone, instance.GetType());
+ AbstractType::Handle(zone, instance.GetType(Heap::kNew));
OS::Print(" instance type: %s\n",
String::Handle(zone, instance_type.Name()).ToCString());
OS::Print(" cast type: %s\n",
@@ -333,7 +335,7 @@ DEFINE_NATIVE_ENTRY(Object_as, 3) {
ASSERT(caller_frame != NULL);
const TokenPosition location = caller_frame->GetTokenPos();
const AbstractType& instance_type =
- AbstractType::Handle(zone, instance.GetType());
+ AbstractType::Handle(zone, instance.GetType(Heap::kNew));
if (!type.IsInstantiated()) {
// Instantiate type before reporting the error.
type = type.InstantiateFrom(instantiator_type_arguments, NULL, NULL, NULL,
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/class_finalizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698