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

Side by Side Diff: pkg/compiler/lib/src/kernel/kernel.dart

Issue 2531303002: Decouple WorkItem from Compiler (Closed)
Patch Set: Updated cf. comments. Created 4 years 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:collection' show Queue; 6 import 'dart:collection' show Queue;
7 7
8 import 'package:kernel/ast.dart' as ir; 8 import 'package:kernel/ast.dart' as ir;
9 import 'package:kernel/checks.dart' show CheckParentPointers; 9 import 'package:kernel/checks.dart' show CheckParentPointers;
10 10
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 internalError(function, "Deferred loader."); 401 internalError(function, "Deferred loader.");
402 } 402 }
403 if (function.isLocal) { 403 if (function.isLocal) {
404 internalError(function, "Local function."); 404 internalError(function, "Local function.");
405 } 405 }
406 if (isSyntheticError(function)) { 406 if (isSyntheticError(function)) {
407 internalError(function, "Synthetic error function: $function."); 407 internalError(function, "Synthetic error function: $function.");
408 } 408 }
409 function = function.declaration; 409 function = function.declaration;
410 return functions.putIfAbsent(function, () { 410 return functions.putIfAbsent(function, () {
411 compiler.analyzeElement(function); 411 compiler.resolution.ensureResolved(function);
412 compiler.enqueuer.resolution.emptyDeferredQueueForTesting(); 412 compiler.enqueuer.resolution.emptyDeferredQueueForTesting();
413 function = function.implementation; 413 function = function.implementation;
414 ir.Member member; 414 ir.Member member;
415 ir.Constructor constructor; 415 ir.Constructor constructor;
416 ir.Procedure procedure; 416 ir.Procedure procedure;
417 ir.Name name = irName(function.name, function); 417 ir.Name name = irName(function.name, function);
418 bool isNative = isNativeMethod(function); 418 bool isNative = isNativeMethod(function);
419 if (function.isGenerativeConstructor) { 419 if (function.isGenerativeConstructor) {
420 member = constructor = new ir.Constructor(null, 420 member = constructor = new ir.Constructor(null,
421 name: name, 421 name: name,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 void endFactoryScope(FunctionElement function) { 499 void endFactoryScope(FunctionElement function) {
500 factoryTypeParameters.clear(); 500 factoryTypeParameters.clear();
501 } 501 }
502 502
503 ir.Field fieldToIr(FieldElement field) { 503 ir.Field fieldToIr(FieldElement field) {
504 if (isSyntheticError(field)) { 504 if (isSyntheticError(field)) {
505 internalError(field, "Synthetic error field: $field."); 505 internalError(field, "Synthetic error field: $field.");
506 } 506 }
507 field = field.declaration; 507 field = field.declaration;
508 return fields.putIfAbsent(field, () { 508 return fields.putIfAbsent(field, () {
509 compiler.analyzeElement(field); 509 compiler.resolution.ensureResolved(field);
510 compiler.enqueuer.resolution.emptyDeferredQueueForTesting(); 510 compiler.enqueuer.resolution.emptyDeferredQueueForTesting();
511 field = field.implementation; 511 field = field.implementation;
512 ir.DartType type = 512 ir.DartType type =
513 field.isMalformed ? const ir.InvalidType() : typeToIr(field.type); 513 field.isMalformed ? const ir.InvalidType() : typeToIr(field.type);
514 ir.Field fieldNode = new ir.Field(irName(field.memberName.text, field), 514 ir.Field fieldNode = new ir.Field(irName(field.memberName.text, field),
515 type: type, 515 type: type,
516 initializer: null, 516 initializer: null,
517 isFinal: field.isFinal, 517 isFinal: field.isFinal,
518 isStatic: field.isStatic || field.isTopLevel, 518 isStatic: field.isStatic || field.isTopLevel,
519 isConst: field.isConst); 519 isConst: field.isConst);
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 } 754 }
755 755
756 class ConstructorTarget { 756 class ConstructorTarget {
757 final ConstructorElement element; 757 final ConstructorElement element;
758 final DartType type; 758 final DartType type;
759 759
760 ConstructorTarget(this.element, this.type); 760 ConstructorTarget(this.element, this.type);
761 761
762 String toString() => "ConstructorTarget($element, $type)"; 762 String toString() => "ConstructorTarget($element, $type)";
763 } 763 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/type_variable_handler.dart ('k') | pkg/compiler/lib/src/resolution/registry.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698