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

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

Issue 2686243004: Handler the last native annotations (Closed)
Patch Set: Cleanup. Created 3 years, 10 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/backend_api.dart'; 8 import '../common/backend_api.dart';
9 import '../common/names.dart'; 9 import '../common/names.dart';
10 import '../compile_time_constants.dart'; 10 import '../compile_time_constants.dart';
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 constructor, 370 constructor,
371 "Unexpected constructor $constructor in " 371 "Unexpected constructor $constructor in "
372 "KernelWorldBuilder._getConstructorConstant"); 372 "KernelWorldBuilder._getConstructorConstant");
373 }); 373 });
374 } 374 }
375 375
376 ConstantExpression _getFieldConstant(KField field) { 376 ConstantExpression _getFieldConstant(KField field) {
377 return _fieldConstantMap.putIfAbsent(field, () { 377 return _fieldConstantMap.putIfAbsent(field, () {
378 ir.Field node = _fieldList[field.fieldIndex]; 378 ir.Field node = _fieldList[field.fieldIndex];
379 if (node.isConst) { 379 if (node.isConst) {
380 return node.initializer.accept(new Constantifier(this)); 380 return new Constantifier(this).visit(node.initializer);
381 } 381 }
382 throw new SpannableAssertionFailure( 382 throw new SpannableAssertionFailure(
383 field, 383 field,
384 "Unexpected field $field in " 384 "Unexpected field $field in "
385 "KernelWorldBuilder._getConstructorConstant"); 385 "KernelWorldBuilder._getConstructorConstant");
386 }); 386 });
387 } 387 }
388 } 388 }
389 389
390 /// Environment for fast lookup of program libraries. 390 /// Environment for fast lookup of program libraries.
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 } 815 }
816 816
817 InterfaceType getMixinTypeForClass(KClass cls) { 817 InterfaceType getMixinTypeForClass(KClass cls) {
818 KClassEnv env = builder._classEnvs[cls.classIndex]; 818 KClassEnv env = builder._classEnvs[cls.classIndex];
819 ir.Supertype mixedInType = env.cls.mixedInType; 819 ir.Supertype mixedInType = env.cls.mixedInType;
820 if (mixedInType == null) return null; 820 if (mixedInType == null) return null;
821 return builder.createInterfaceType( 821 return builder.createInterfaceType(
822 mixedInType.classNode, mixedInType.typeArguments); 822 mixedInType.classNode, mixedInType.typeArguments);
823 } 823 }
824 } 824 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698