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

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

Issue 887853004: dart2js: Move parameterStub generation to parameter_stub_generator and add parameter stubs to model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot to save container_builder Created 5 years, 11 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: 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 ea1e4769ed5c17d114a6a289cb64e3d8958e6dd9..e4a57fd8c5c1e3758d3dcce51e408319d5b8e62d 100644
--- a/pkg/compiler/lib/src/js_emitter/model.dart
+++ b/pkg/compiler/lib/src/js_emitter/model.dart
@@ -333,21 +333,20 @@ abstract class Method {
class DartMethod extends Method {
final bool needsTearOff;
final String tearOffName;
- // TODO(herhut): Directly store stubs instead/
- final bool needsStubs;
+ final List<ParameterStubMethod> parameterStubs;
// TODO(herhut): Directly store aliases instead.
final bool canBeApplied;
final bool canBeReflected;
DartMethod(Element element, String name, js.Expression code,
- {this.needsTearOff, this.tearOffName, this.needsStubs, this.canBeApplied,
- this.canBeReflected})
+ {this.needsTearOff, this.tearOffName, this.parameterStubs,
+ this.canBeApplied, this.canBeReflected})
: super(element, name, code) {
assert(needsTearOff != null);
assert(!needsTearOff || tearOffName != null);
assert(canBeApplied != null);
+ assert(parameterStubs != null);
assert(canBeReflected != null);
- assert(needsStubs != null);
}
}
@@ -363,13 +362,13 @@ class InstanceMethod extends DartMethod {
bool canBeApplied,
bool canBeReflected,
this.isClosure,
- bool needsStubs})
+ List<ParameterStubMethod> parameterStubs})
: super(element, name, code,
needsTearOff: needsTearOff,
tearOffName: tearOffName,
canBeApplied: canBeApplied,
canBeReflected: canBeReflected,
- needsStubs: needsStubs) {
+ parameterStubs: parameterStubs) {
herhut 2015/01/30 10:02:22 I would prefer this to be an unnamed parameter. Th
zarah 2015/01/30 12:46:38 Done.
assert(hasSuperAlias != null);
assert(isClosure != null);
}
@@ -386,23 +385,36 @@ class StubMethod extends Method {
: super(element, name, code);
}
+/**
+ * A method that is generated for the different versions of method calls of
floitsch 2015/01/30 12:26:30 For new code please prefer "///" comments.
zarah 2015/01/30 12:46:38 Done.
+ * methods with named parameters,
+ *
+ * For example for a method foo(a, b, {c, d}) that is called as foo(1, 2, c: 3)
+ * we have the stub foo$3$c(a, b, c) => foo$4$c$d(a, b, c, null);
+ */
+class ParameterStubMethod extends StubMethod {
+ final Selector selector;
+ ParameterStubMethod(String name, js.Expression code, this.selector,
+ {Element element})
+ : super(name, code, element: element);
+}
+
abstract class StaticMethod implements Method {
Holder get holder;
}
class StaticDartMethod extends DartMethod implements StaticMethod {
final Holder holder;
-
StaticDartMethod(Element element, String name, this.holder,
js.Expression code,
{bool needsTearOff, String tearOffName, bool canBeApplied,
- bool canBeReflected, bool needsStubs})
+ bool canBeReflected, List<StubMethod> parameterStubs})
: super(element, name, code,
needsTearOff: needsTearOff,
tearOffName : tearOffName,
canBeApplied : canBeApplied,
canBeReflected : canBeReflected,
- needsStubs : needsStubs);
+ parameterStubs : parameterStubs);
herhut 2015/01/30 10:02:22 As above.
zarah 2015/01/30 12:46:38 Done.
}
class StaticStubMethod extends StubMethod implements StaticMethod {

Powered by Google App Engine
This is Rietveld 408576698