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

Unified Diff: runtime/vm/raw_object.h

Issue 154393003: Implement eager instantiation and canonicalization of type arguments at run (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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
Index: runtime/vm/raw_object.h
===================================================================
--- runtime/vm/raw_object.h (revision 32446)
+++ runtime/vm/raw_object.h (working copy)
@@ -16,9 +16,7 @@
#define CLASS_LIST_NO_OBJECT_NOR_STRING_NOR_ARRAY(V) \
V(Class) \
V(UnresolvedClass) \
- V(AbstractTypeArguments) \
- V(TypeArguments) \
- V(InstantiatedTypeArguments) \
+ V(TypeArguments) \
V(PatchClass) \
V(Function) \
V(ClosureData) \
@@ -537,19 +535,18 @@
};
-class RawAbstractTypeArguments : public RawObject {
+class RawTypeArguments : public RawObject {
private:
- RAW_HEAP_OBJECT_IMPLEMENTATION(AbstractTypeArguments);
-};
-
-
-class RawTypeArguments : public RawAbstractTypeArguments {
- private:
RAW_HEAP_OBJECT_IMPLEMENTATION(TypeArguments);
RawObject** from() {
- return reinterpret_cast<RawObject**>(&ptr()->length_);
+ return reinterpret_cast<RawObject**>(&ptr()->instantiations_);
}
+ // The instantiations_ array remains empty for instantiated type arguments.
+ RawArray* instantiations_; // Array of paired canonical vectors:
+ // Even index: instantiator.
+ // Odd index: instantiated (without bound error).
+ // Instantiations leading to bound errors do not get cached.
RawSmi* length_;
// Variable length data follows here.
@@ -562,22 +559,6 @@
};
-class RawInstantiatedTypeArguments : public RawAbstractTypeArguments {
- private:
- RAW_HEAP_OBJECT_IMPLEMENTATION(InstantiatedTypeArguments);
-
- RawObject** from() {
- return reinterpret_cast<RawObject**>(
- &ptr()->uninstantiated_type_arguments_);
- }
- RawAbstractTypeArguments* uninstantiated_type_arguments_;
- RawAbstractTypeArguments* instantiator_type_arguments_;
- RawObject** to() {
- return reinterpret_cast<RawObject**>(&ptr()->instantiator_type_arguments_);
- }
-};
-
-
class RawPatchClass : public RawObject {
private:
RAW_HEAP_OBJECT_IMPLEMENTATION(PatchClass);
@@ -1174,7 +1155,7 @@
return reinterpret_cast<RawObject**>(&ptr()->type_class_);
}
RawObject* type_class_; // Either resolved class or unresolved class.
- RawAbstractTypeArguments* arguments_;
+ RawTypeArguments* arguments_;
RawLanguageError* error_; // Error object if type is malformed or malbounded.
RawObject** to() {
return reinterpret_cast<RawObject**>(&ptr()->error_);
@@ -1385,7 +1366,7 @@
RawObject** from() {
return reinterpret_cast<RawObject**>(&ptr()->type_arguments_);
}
- RawAbstractTypeArguments* type_arguments_;
+ RawTypeArguments* type_arguments_;
RawSmi* length_;
// Variable length data follows here.
RawObject** data() {
@@ -1417,7 +1398,7 @@
RawObject** from() {
return reinterpret_cast<RawObject**>(&ptr()->type_arguments_);
}
- RawAbstractTypeArguments* type_arguments_;
+ RawTypeArguments* type_arguments_;
RawSmi* length_;
RawArray* data_;
RawObject** to() {

Powered by Google App Engine
This is Rietveld 408576698