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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart

Issue 2871583002: Pass InterceptorData through ResolutionWorldBuilder and access it through ClosedWorld (Closed)
Patch Set: Created 3 years, 7 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_emitter.program_builder; 5 library dart2js.js_emitter.program_builder;
6 6
7 import '../../closure.dart' show ClosureTask, ClosureFieldElement; 7 import '../../closure.dart' show ClosureTask, ClosureFieldElement;
8 import '../../common.dart'; 8 import '../../common.dart';
9 import '../../common/names.dart' show Names, Selectors; 9 import '../../common/names.dart' show Names, Selectors;
10 import '../../constants/values.dart' 10 import '../../constants/values.dart'
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 } 286 }
287 287
288 js.Expression _buildTypeToInterceptorMap() { 288 js.Expression _buildTypeToInterceptorMap() {
289 InterceptorStubGenerator stubGenerator = new InterceptorStubGenerator( 289 InterceptorStubGenerator stubGenerator = new InterceptorStubGenerator(
290 _options, 290 _options,
291 _commonElements, 291 _commonElements,
292 _task, 292 _task,
293 _nativeCodegenEnqueuer, 293 _nativeCodegenEnqueuer,
294 _constantHandler, 294 _constantHandler,
295 _namer, 295 _namer,
296 _interceptorData,
297 _oneShotInterceptorData, 296 _oneShotInterceptorData,
298 _customElementsCodegenAnalysis, 297 _customElementsCodegenAnalysis,
299 _worldBuilder, 298 _worldBuilder,
300 _closedWorld); 299 _closedWorld);
301 return stubGenerator.generateTypeToInterceptorMap(); 300 return stubGenerator.generateTypeToInterceptorMap();
302 } 301 }
303 302
304 MainFragment _buildMainFragment(LibrariesMap librariesMap) { 303 MainFragment _buildMainFragment(LibrariesMap librariesMap) {
305 // Construct the main output from the libraries and the registered holders. 304 // Construct the main output from the libraries and the registered holders.
306 MainFragment result = new MainFragment( 305 MainFragment result = new MainFragment(
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 // TODO(jacobr): check whether the class has any active static fields 589 // TODO(jacobr): check whether the class has any active static fields
591 // if it does not we can suppress it completely. 590 // if it does not we can suppress it completely.
592 onlyForRti = true; 591 onlyForRti = true;
593 } 592 }
594 bool isClosureBaseClass = element == _commonElements.closureClass; 593 bool isClosureBaseClass = element == _commonElements.closureClass;
595 594
596 List<Method> methods = []; 595 List<Method> methods = [];
597 List<StubMethod> callStubs = <StubMethod>[]; 596 List<StubMethod> callStubs = <StubMethod>[];
598 597
599 ClassStubGenerator classStubGenerator = new ClassStubGenerator( 598 ClassStubGenerator classStubGenerator = new ClassStubGenerator(
600 _task.emitter, 599 _task.emitter, _commonElements, _namer, _worldBuilder, _closedWorld,
601 _commonElements,
602 _namer,
603 _worldBuilder,
604 _interceptorData,
605 _closedWorld,
606 enableMinification: _options.enableMinification); 600 enableMinification: _options.enableMinification);
607 RuntimeTypeGenerator runtimeTypeGenerator = new RuntimeTypeGenerator( 601 RuntimeTypeGenerator runtimeTypeGenerator = new RuntimeTypeGenerator(
608 _commonElements, 602 _commonElements,
609 _closureToClassMapper, 603 _closureToClassMapper,
610 _task, 604 _task,
611 _namer, 605 _namer,
612 _nativeData, 606 _nativeData,
613 _rtiChecks, 607 _rtiChecks,
614 _rtiEncoder, 608 _rtiEncoder,
615 _rtiNeed, 609 _rtiNeed,
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 } 923 }
930 924
931 Iterable<StaticStubMethod> _generateGetInterceptorMethods() { 925 Iterable<StaticStubMethod> _generateGetInterceptorMethods() {
932 InterceptorStubGenerator stubGenerator = new InterceptorStubGenerator( 926 InterceptorStubGenerator stubGenerator = new InterceptorStubGenerator(
933 _options, 927 _options,
934 _commonElements, 928 _commonElements,
935 _task, 929 _task,
936 _nativeCodegenEnqueuer, 930 _nativeCodegenEnqueuer,
937 _constantHandler, 931 _constantHandler,
938 _namer, 932 _namer,
939 _interceptorData,
940 _oneShotInterceptorData, 933 _oneShotInterceptorData,
941 _customElementsCodegenAnalysis, 934 _customElementsCodegenAnalysis,
942 _worldBuilder, 935 _worldBuilder,
943 _closedWorld); 936 _closedWorld);
944 937
945 String holderName = 938 String holderName =
946 _namer.globalObjectForLibrary(_commonElements.interceptorsLibrary); 939 _namer.globalObjectForLibrary(_commonElements.interceptorsLibrary);
947 // TODO(floitsch): we shouldn't update the registry in the middle of 940 // TODO(floitsch): we shouldn't update the registry in the middle of
948 // generating the interceptor methods. 941 // generating the interceptor methods.
949 Holder holder = _registry.registerHolder(holderName); 942 Holder holder = _registry.registerHolder(holderName);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 } 1001 }
1009 1002
1010 Iterable<StaticStubMethod> _generateOneShotInterceptors() { 1003 Iterable<StaticStubMethod> _generateOneShotInterceptors() {
1011 InterceptorStubGenerator stubGenerator = new InterceptorStubGenerator( 1004 InterceptorStubGenerator stubGenerator = new InterceptorStubGenerator(
1012 _options, 1005 _options,
1013 _commonElements, 1006 _commonElements,
1014 _task, 1007 _task,
1015 _nativeCodegenEnqueuer, 1008 _nativeCodegenEnqueuer,
1016 _constantHandler, 1009 _constantHandler,
1017 _namer, 1010 _namer,
1018 _interceptorData,
1019 _oneShotInterceptorData, 1011 _oneShotInterceptorData,
1020 _customElementsCodegenAnalysis, 1012 _customElementsCodegenAnalysis,
1021 _worldBuilder, 1013 _worldBuilder,
1022 _closedWorld); 1014 _closedWorld);
1023 1015
1024 String holderName = 1016 String holderName =
1025 _namer.globalObjectForLibrary(_commonElements.interceptorsLibrary); 1017 _namer.globalObjectForLibrary(_commonElements.interceptorsLibrary);
1026 // TODO(floitsch): we shouldn't update the registry in the middle of 1018 // TODO(floitsch): we shouldn't update the registry in the middle of
1027 // generating the interceptor methods. 1019 // generating the interceptor methods.
1028 Holder holder = _registry.registerHolder(holderName); 1020 Holder holder = _registry.registerHolder(holderName);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 Constant constant = new Constant(name, holder, constantValue); 1091 Constant constant = new Constant(name, holder, constantValue);
1100 _constants[constantValue] = constant; 1092 _constants[constantValue] = constant;
1101 } 1093 }
1102 } 1094 }
1103 1095
1104 Holder _registerStaticStateHolder() { 1096 Holder _registerStaticStateHolder() {
1105 return _registry.registerHolder(_namer.staticStateHolder, 1097 return _registry.registerHolder(_namer.staticStateHolder,
1106 isStaticStateHolder: true); 1098 isStaticStateHolder: true);
1107 } 1099 }
1108 } 1100 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698