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

Unified Diff: pkg/compiler/lib/src/js_emitter/model.dart

Issue 940053002: dart2js: add function type to the model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Created 5 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/model.dart
diff --git a/pkg/compiler/lib/src/js_emitter/model.dart b/pkg/compiler/lib/src/js_emitter/model.dart
index f2a5cc9b0de09a4c349fbb9bb91a8154fef662a5..8d3ba956bfe12e739466831ac728bfccb831b7e5 100644
--- a/pkg/compiler/lib/src/js_emitter/model.dart
+++ b/pkg/compiler/lib/src/js_emitter/model.dart
@@ -347,7 +347,13 @@ class DartMethod extends Method {
final List<ParameterStubMethod> parameterStubs;
final bool canBeApplied;
final bool canBeReflected;
- final DartType type;
+
+ // Is non-null if [needsTearOff] or [canBeReflected].
+ //
+ // If the type is encoded in the metadata table this field contains an index
+ // into the table. Otherwise the type contains type variables in which case
+ // this field holds a function computing the function signature.
+ final js.Expression functionType;
// Signature information for this method. This is only required and stored
// here if the method [canBeApplied] or [canBeReflected]
@@ -360,10 +366,10 @@ class DartMethod extends Method {
final String callName;
DartMethod(Element element, String name, js.Expression code,
- this.parameterStubs, this.callName, this.type,
+ this.parameterStubs, this.callName,
{this.needsTearOff, this.tearOffName, this.canBeApplied,
this.canBeReflected, this.requiredParameterCount,
- this.optionalParameterDefaultValues})
+ this.optionalParameterDefaultValues, this.functionType})
: super(element, name, code) {
assert(needsTearOff != null);
assert(!needsTearOff || tearOffName != null);
@@ -386,7 +392,7 @@ class InstanceMethod extends DartMethod {
InstanceMethod(Element element, String name, js.Expression code,
List<ParameterStubMethod> parameterStubs,
- String callName, DartType type,
+ String callName,
{bool needsTearOff,
String tearOffName,
this.aliasName,
@@ -394,14 +400,16 @@ class InstanceMethod extends DartMethod {
bool canBeReflected,
int requiredParameterCount,
/* List | Map */ optionalParameterDefaultValues,
- this.isClosure})
- : super(element, name, code, parameterStubs, callName, type,
+ this.isClosure,
+ js.Expression functionType})
+ : super(element, name, code, parameterStubs, callName,
needsTearOff: needsTearOff,
tearOffName: tearOffName,
canBeApplied: canBeApplied,
canBeReflected: canBeReflected,
requiredParameterCount: requiredParameterCount,
- optionalParameterDefaultValues: optionalParameterDefaultValues) {
+ optionalParameterDefaultValues: optionalParameterDefaultValues,
+ functionType: functionType) {
assert(isClosure != null);
}
}
@@ -445,17 +453,19 @@ class StaticDartMethod extends DartMethod implements StaticMethod {
StaticDartMethod(Element element, String name, this.holder,
js.Expression code, List<ParameterStubMethod> parameterStubs,
- String callName, DartType type,
+ String callName,
{bool needsTearOff, String tearOffName, bool canBeApplied,
bool canBeReflected, int requiredParameterCount,
- /* List | Map */ optionalParameterDefaultValues})
- : super(element, name, code, parameterStubs, callName, type,
+ /* List | Map */ optionalParameterDefaultValues,
+ js.Expression functionType})
+ : super(element, name, code, parameterStubs, callName,
needsTearOff: needsTearOff,
tearOffName : tearOffName,
canBeApplied : canBeApplied,
canBeReflected : canBeReflected,
requiredParameterCount: requiredParameterCount,
- optionalParameterDefaultValues: optionalParameterDefaultValues);
+ optionalParameterDefaultValues: optionalParameterDefaultValues,
+ functionType: functionType);
}
class StaticStubMethod extends StubMethod implements StaticMethod {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698