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

Side by Side Diff: pkg/compiler/lib/src/js_model/js_strategy.dart

Issue 2981423003: Move .getLocalFunction from KernelToElementMap to KernelToLocalsMap (Closed)
Patch Set: Updated cf. comments Created 3 years, 4 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
« no previous file with comments | « pkg/compiler/lib/src/js_model/elements.dart ('k') | pkg/compiler/lib/src/js_model/locals.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library dart2js.js_model.strategy; 5 library dart2js.js_model.strategy;
6 6
7 import '../closure.dart' show ClosureConversionTask; 7 import '../closure.dart' show ClosureConversionTask;
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/tasks.dart'; 9 import '../common/tasks.dart';
10 import '../common_elements.dart'; 10 import '../common_elements.dart';
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 liveNativeClasses, 376 liveNativeClasses,
377 liveInstanceMembers, 377 liveInstanceMembers,
378 assignedInstanceMembers, 378 assignedInstanceMembers,
379 allTypedefs, 379 allTypedefs,
380 mixinUses, 380 mixinUses,
381 typesImplementedBySubclasses, 381 typesImplementedBySubclasses,
382 classHierarchyNodes, 382 classHierarchyNodes,
383 classSets); 383 classSets);
384 384
385 @override 385 @override
386 void registerClosureClass(ClassEntity cls, bool fromInstanceMember) { 386 void registerClosureClass(ClassEntity cls) {
387 // Tell the hierarchy that this is the super class. then we can use 387 // Tell the hierarchy that this is the super class. then we can use
388 // .getSupertypes(class) 388 // .getSupertypes(class)
389 ClassEntity superclass = fromInstanceMember 389 ClassEntity superclass = commonElements.closureClass;
390 ? commonElements.boundClosureClass
391 : commonElements.closureClass;
392 ClassHierarchyNode parentNode = getClassHierarchyNode(superclass); 390 ClassHierarchyNode parentNode = getClassHierarchyNode(superclass);
393 ClassHierarchyNode node = new ClassHierarchyNode( 391 ClassHierarchyNode node = new ClassHierarchyNode(
394 parentNode, cls, getHierarchyDepth(superclass) + 1); 392 parentNode, cls, getHierarchyDepth(superclass) + 1);
395 addClassHierarchyNode(cls, node); 393 addClassHierarchyNode(cls, node);
396 for (InterfaceType type in getOrderedTypeSet(superclass).types) { 394 for (InterfaceType type in getOrderedTypeSet(superclass).types) {
397 // TODO(efortuna): assert that the FunctionClass is in this ordered set. 395 // TODO(efortuna): assert that the FunctionClass is in this ordered set.
398 // If not, we need to explicitly add node as a subtype of FunctionClass. 396 // If not, we need to explicitly add node as a subtype of FunctionClass.
399 ClassSet subtypeSet = getClassSet(type.element); 397 ClassSet subtypeSet = getClassSet(type.element);
400 subtypeSet.addSubtype(node); 398 subtypeSet.addSubtype(node);
401 } 399 }
402 addClassSet(cls, new ClassSet(node)); 400 addClassSet(cls, new ClassSet(node));
403 elementMap.addClosureClass(cls, new InterfaceType(superclass, const [])); 401 elementMap.addClosureClass(cls, new InterfaceType(superclass, const []));
404 node.isDirectlyInstantiated = true; 402 node.isDirectlyInstantiated = true;
405 } 403 }
406 } 404 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_model/elements.dart ('k') | pkg/compiler/lib/src/js_model/locals.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698