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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2981723002: Distinguish between actual closure scopes and non-closure scopes. (Closed)
Patch Set: . Created 3 years, 5 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) 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 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 '../closure.dart'; 7 import '../closure.dart';
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/codegen.dart' show CodegenRegistry; 9 import '../common/codegen.dart' show CodegenRegistry;
10 import '../common/names.dart'; 10 import '../common/names.dart';
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 localsHandler.updateLocal(parameter, argument); 598 localsHandler.updateLocal(parameter, argument);
599 } 599 }
600 600
601 constructor.function.positionalParameters.forEach(handleParameter); 601 constructor.function.positionalParameters.forEach(handleParameter);
602 constructor.function.namedParameters.toList() 602 constructor.function.namedParameters.toList()
603 ..sort(namedOrdering) 603 ..sort(namedOrdering)
604 ..forEach(handleParameter); 604 ..forEach(handleParameter);
605 605
606 // Set the locals handler state as if we were inlining the constructor. 606 // Set the locals handler state as if we were inlining the constructor.
607 ConstructorEntity element = _elementMap.getConstructor(constructor); 607 ConstructorEntity element = _elementMap.getConstructor(constructor);
608 ClosureRepresentationInfo oldScopeInfo = localsHandler.scopeInfo; 608 ScopeInfo oldScopeInfo = localsHandler.scopeInfo;
609 ClosureRepresentationInfo newScopeInfo = 609 ScopeInfo newScopeInfo = closureDataLookup.getScopeInfo(element);
610 closureDataLookup.getScopeInfo(element);
611 localsHandler.scopeInfo = newScopeInfo; 610 localsHandler.scopeInfo = newScopeInfo;
612 localsHandler.enterScope(closureDataLookup.getClosureScope(element)); 611 localsHandler.enterScope(closureDataLookup.getClosureScope(element));
613 inlinedFrom(element, () { 612 inlinedFrom(element, () {
614 _buildInitializers(constructor, constructorChain, fieldValues); 613 _buildInitializers(constructor, constructorChain, fieldValues);
615 }); 614 });
616 localsHandler.scopeInfo = oldScopeInfo; 615 localsHandler.scopeInfo = oldScopeInfo;
617 } 616 }
618 617
619 /// Builds generative constructor body. 618 /// Builds generative constructor body.
620 void buildConstructorBody(ir.Constructor constructor) { 619 void buildConstructorBody(ir.Constructor constructor) {
(...skipping 2885 matching lines...) Expand 10 before | Expand all | Expand 10 after
3506 class KernelTypeBuilder extends TypeBuilder { 3505 class KernelTypeBuilder extends TypeBuilder {
3507 KernelToElementMapForBuilding _elementMap; 3506 KernelToElementMapForBuilding _elementMap;
3508 3507
3509 KernelTypeBuilder(this._elementMap, GraphBuilder builder) : super(builder); 3508 KernelTypeBuilder(this._elementMap, GraphBuilder builder) : super(builder);
3510 3509
3511 @override 3510 @override
3512 InterfaceType getThisType(ClassEntity cls) { 3511 InterfaceType getThisType(ClassEntity cls) {
3513 return _elementMap.elementEnvironment.getThisType(cls); 3512 return _elementMap.elementEnvironment.getThisType(cls);
3514 } 3513 }
3515 } 3514 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_model/closure_visitors.dart ('k') | tests/compiler/dart2js/closure/closure_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698