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

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

Issue 896763003: dart2js: emit noSuchMethod stubs in the new emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot to save. 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
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/nsm_emitter.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/program_builder.dart
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder.dart
index 912ab3754d8d9cd0035b4a5a56a02f0fde1027b7..0dc764952703597e1a20be8b8f13fa2f6172b674 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder.dart
@@ -290,7 +290,7 @@ class ProgramBuilder {
String name = namer.getNameOfClass(element);
return new Class(
- element, name, null, [], instanceFields, [], [], [], null,
+ element, name, null, [], instanceFields, [], [], [], [], null,
isDirectlyInstantiated: true,
onlyForRti: false,
isNative: element.isNative);
@@ -302,6 +302,9 @@ class ProgramBuilder {
List<Method> methods = [];
List<StubMethod> callStubs = <StubMethod>[];
+ ClassStubGenerator classStubGenerator =
+ new ClassStubGenerator(_compiler, namer, backend);
+
void visitMember(ClassElement enclosing, Element member) {
assert(invariant(element, member.isDeclaration));
assert(invariant(element, element == enclosing));
@@ -316,10 +319,9 @@ class ProgramBuilder {
Set<Selector> selectors =
_compiler.codegenWorld.invokedNames[member.name];
if (selectors != null && !selectors.isEmpty) {
- ClassStubGenerator generator =
- new ClassStubGenerator(_compiler, namer, backend);
+
Map<String, js.Expression> callStubsForMember =
- generator.generateCallStubsForGetter(member, selectors);
+ classStubGenerator.generateCallStubsForGetter(member, selectors);
callStubsForMember.forEach((String name, js.Expression code) {
callStubs.add(_buildStubMethod(name, code, element: member));
});
@@ -327,6 +329,17 @@ class ProgramBuilder {
}
}
+ List<StubMethod> noSuchMethodStubs = <StubMethod>[];
+ if (element == _compiler.objectClass) {
+ Map<String, Selector> selectors =
+ classStubGenerator.computeSelectorsForNsmHandlers();
+ selectors.forEach((String name, Selector selector) {
+ noSuchMethodStubs
+ .add(classStubGenerator.generateStubForNoSuchMethod(name,
+ selector));
+ });
+ }
+
ClassElement implementation = element.implementation;
// MixinApplications run through the members of their mixin. Here, we are
@@ -377,6 +390,7 @@ class ProgramBuilder {
name, holder, methods, instanceFields,
staticFieldsForReflection,
callStubs,
+ noSuchMethodStubs,
isChecks,
typeTests.functionTypeIndex,
isDirectlyInstantiated: isInstantiated,
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/nsm_emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698