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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart

Issue 201613006: Introduces the new syntax for deferred loading (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.ir_builder; 5 library dart2js.ir_builder;
6 6
7 import 'ir_nodes.dart' as ir; 7 import 'ir_nodes.dart' as ir;
8 import '../elements/elements.dart'; 8 import '../elements/elements.dart';
9 import '../dart2jslib.dart'; 9 import '../dart2jslib.dart';
10 import '../source_file.dart'; 10 import '../source_file.dart';
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 if (canBuild(element)) { 50 if (canBuild(element)) {
51 element = element.implementation; 51 element = element.implementation;
52 52
53 SourceFile sourceFile = elementSourceFile(element); 53 SourceFile sourceFile = elementSourceFile(element);
54 IrBuilder builder = 54 IrBuilder builder =
55 new IrBuilder(elementsMapping, compiler, sourceFile); 55 new IrBuilder(elementsMapping, compiler, sourceFile);
56 ir.Function function; 56 ir.Function function;
57 ElementKind kind = element.kind; 57 ElementKind kind = element.kind;
58 if (kind == ElementKind.GENERATIVE_CONSTRUCTOR) { 58 if (kind == ElementKind.GENERATIVE_CONSTRUCTOR) {
59 // TODO(lry): build ir for constructors. 59 // TODO(lry): build ir for constructors.
60 } else if (element.isDeferredLoaderGetter()) {
61 // TODO(sigurdm): Build ir for deferred loader functions.
60 } else if (kind == ElementKind.GENERATIVE_CONSTRUCTOR_BODY || 62 } else if (kind == ElementKind.GENERATIVE_CONSTRUCTOR_BODY ||
61 kind == ElementKind.FUNCTION || 63 kind == ElementKind.FUNCTION ||
62 kind == ElementKind.GETTER || 64 kind == ElementKind.GETTER ||
63 kind == ElementKind.SETTER) { 65 kind == ElementKind.SETTER) {
64 function = builder.buildFunction(element); 66 function = builder.buildFunction(element);
65 } else if (kind == ElementKind.FIELD) { 67 } else if (kind == ElementKind.FIELD) {
66 // TODO(lry): build ir for lazy initializers of static fields. 68 // TODO(lry): build ir for lazy initializers of static fields.
67 } else { 69 } else {
68 compiler.internalErrorOnElement(element, 70 compiler.internalErrorOnElement(element,
69 'unexpected element kind $kind'); 71 'unexpected element kind $kind');
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 } catch(e) { 435 } catch(e) {
434 if (e == ABORT_IRNODE_BUILDER) return null; 436 if (e == ABORT_IRNODE_BUILDER) return null;
435 rethrow; 437 rethrow;
436 } 438 }
437 } 439 }
438 440
439 void internalError(String reason, {ast.Node node}) { 441 void internalError(String reason, {ast.Node node}) {
440 giveup(); 442 giveup();
441 } 443 }
442 } 444 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698