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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart

Issue 569583002: Make dart2js deferred loading work in cps mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 6 years, 3 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 | « samples/samples.status ('k') | sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
index ca0a1e40c06332c19da0d6dd265f991bf470faad..7fcc79e71fa0938e5380ad95ce8284d9df0e18e9 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
@@ -83,7 +83,10 @@ class ClassEmitter extends CodeEmitterHelper {
jsAst.Expression constructorAst = js('function(#) { #; }',
[fields,
fields.map((name) => js('this.# = #', [name, name]))]);
- task.emitPrecompiledConstructor(constructorName, constructorAst);
+ OutputUnit outputUnit =
+ compiler.deferredLoadTask.outputUnitForElement(classElement);
+ task.emitPrecompiledConstructor(
+ outputUnit, constructorName, constructorAst);
}
/// Returns `true` if fields added.
@@ -522,11 +525,13 @@ class ClassEmitter extends CodeEmitterHelper {
String className = namer.getNameOfClass(cls);
String receiver = backend.isInterceptorClass(cls) ? 'receiver' : 'this';
List<String> args = backend.isInterceptedMethod(member) ? ['receiver'] : [];
- task.precompiledFunction.add(
+ OutputUnit outputUnit =
+ compiler.deferredLoadTask.outputUnitForElement(member);
+ task.cspPrecompiledFunctionFor(outputUnit).add(
js('#.prototype.# = function(#) { return #.# }',
[className, getterName, args, receiver, fieldName]));
if (backend.isAccessibleByReflection(member)) {
- task.precompiledFunction.add(
+ task.cspPrecompiledFunctionFor(outputUnit).add(
js('#.prototype.#.${namer.reflectableField} = 1',
[className, getterName]));
}
@@ -539,12 +544,14 @@ class ClassEmitter extends CodeEmitterHelper {
String className = namer.getNameOfClass(cls);
String receiver = backend.isInterceptorClass(cls) ? 'receiver' : 'this';
List<String> args = backend.isInterceptedMethod(member) ? ['receiver'] : [];
- task.precompiledFunction.add(
+ OutputUnit outputUnit =
+ compiler.deferredLoadTask.outputUnitForElement(member);
+ task.cspPrecompiledFunctionFor(outputUnit).add(
// TODO: remove 'return'?
js('#.prototype.# = function(#, v) { return #.# = v; }',
[className, setterName, args, receiver, fieldName]));
if (backend.isAccessibleByReflection(member)) {
- task.precompiledFunction.add(
+ task.cspPrecompiledFunctionFor(outputUnit).add(
js('#.prototype.#.${namer.reflectableField} = 1',
[className, setterName]));
}
« no previous file with comments | « samples/samples.status ('k') | sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698