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

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 2858463002: js_runtime: Split _asyncHelper into separate functions (Closed)
Patch Set: update test Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library js_backend.backend; 5 library js_backend.backend;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/backend_api.dart' 8 import '../common/backend_api.dart'
9 show ForeignResolver, NativeRegistry, ImpactTransformer; 9 show ForeignResolver, NativeRegistry, ImpactTransformer;
10 import '../common/codegen.dart' show CodegenImpact, CodegenWorkItem; 10 import '../common/codegen.dart' show CodegenImpact, CodegenWorkItem;
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 /// supported by the backend. 1284 /// supported by the backend.
1285 bool enableCodegenWithErrorsIfSupported(Spannable node) => true; 1285 bool enableCodegenWithErrorsIfSupported(Spannable node) => true;
1286 1286
1287 jsAst.Expression rewriteAsync( 1287 jsAst.Expression rewriteAsync(
1288 FunctionElement element, jsAst.Expression code) { 1288 FunctionElement element, jsAst.Expression code) {
1289 AsyncRewriterBase rewriter = null; 1289 AsyncRewriterBase rewriter = null;
1290 jsAst.Name name = namer.methodPropertyName(element); 1290 jsAst.Name name = namer.methodPropertyName(element);
1291 switch (element.asyncMarker) { 1291 switch (element.asyncMarker) {
1292 case AsyncMarker.ASYNC: 1292 case AsyncMarker.ASYNC:
1293 rewriter = new AsyncRewriter(reporter, element, 1293 rewriter = new AsyncRewriter(reporter, element,
1294 asyncHelper: 1294 asyncStart:
1295 emitter.staticFunctionAccess(commonElements.asyncHelper), 1295 emitter.staticFunctionAccess(commonElements.asyncHelperStart),
1296 asyncAwait:
1297 emitter.staticFunctionAccess(commonElements.asyncHelperAwait),
1298 asyncReturn:
1299 emitter.staticFunctionAccess(commonElements.asyncHelperReturn),
1300 asyncRethrow:
1301 emitter.staticFunctionAccess(commonElements.asyncHelperRethrow),
1296 wrapBody: emitter.staticFunctionAccess(commonElements.wrapBody), 1302 wrapBody: emitter.staticFunctionAccess(commonElements.wrapBody),
1297 completerFactory: emitter 1303 completerFactory: emitter
1298 .staticFunctionAccess(commonElements.syncCompleterConstructor), 1304 .staticFunctionAccess(commonElements.syncCompleterConstructor),
1299 safeVariableName: namer.safeVariablePrefixForAsyncRewrite, 1305 safeVariableName: namer.safeVariablePrefixForAsyncRewrite,
1300 bodyName: namer.deriveAsyncBodyName(name)); 1306 bodyName: namer.deriveAsyncBodyName(name));
1301 break; 1307 break;
1302 case AsyncMarker.SYNC_STAR: 1308 case AsyncMarker.SYNC_STAR:
1303 rewriter = new SyncStarRewriter(reporter, element, 1309 rewriter = new SyncStarRewriter(reporter, element,
1304 endOfIteration: 1310 endOfIteration:
1305 emitter.staticFunctionAccess(commonElements.endOfIteration), 1311 emitter.staticFunctionAccess(commonElements.endOfIteration),
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 1462
1457 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { 1463 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) {
1458 return !selector.isGetter; 1464 return !selector.isGetter;
1459 } 1465 }
1460 1466
1461 /// Returns `true` if [member] is called from a subclass via `super`. 1467 /// Returns `true` if [member] is called from a subclass via `super`.
1462 bool isAliasedSuperMember(MemberEntity member) { 1468 bool isAliasedSuperMember(MemberEntity member) {
1463 return _aliasedSuperMembers.contains(member); 1469 return _aliasedSuperMembers.contains(member);
1464 } 1470 }
1465 } 1471 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js/rewrite_async.dart ('k') | pkg/compiler/lib/src/js_backend/backend_impact.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698