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

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

Issue 1540973005: dart2js: minify 'static:' tag (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 12 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_emitter/full_emitter/class_emitter.dart ('k') | no next file » | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart2js.js_emitter.full_emitter; 5 part of dart2js.js_emitter.full_emitter;
6 6
7 // TODO(ahe): Share these with js_helper.dart. 7 // TODO(ahe): Share these with js_helper.dart.
8 const FUNCTION_INDEX = 0; 8 const FUNCTION_INDEX = 0;
9 const NAME_INDEX = 1; 9 const NAME_INDEX = 1;
10 const CALL_NAME_INDEX = 2; 10 const CALL_NAME_INDEX = 2;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 buildNativeInfoHandler(nativeInfoAccess, constructorAccess, 95 buildNativeInfoHandler(nativeInfoAccess, constructorAccess,
96 subclassReadGenerator, interceptorsByTagAccess, 96 subclassReadGenerator, interceptorsByTagAccess,
97 leafTagsAccess); 97 leafTagsAccess);
98 98
99 Map<String, dynamic> holes = 99 Map<String, dynamic> holes =
100 {'needsClassSupport': emitter.needsClassSupport, 100 {'needsClassSupport': emitter.needsClassSupport,
101 'libraries': librariesAccess, 101 'libraries': librariesAccess,
102 'mangledNames': mangledNamesAccess, 102 'mangledNames': mangledNamesAccess,
103 'mangledGlobalNames': mangledGlobalNamesAccess, 103 'mangledGlobalNames': mangledGlobalNamesAccess,
104 'statics': staticsAccess, 104 'statics': staticsAccess,
105 'staticsPropertyName': namer.staticsPropertyName,
106 'staticsPropertyNameString': js.quoteName(namer.staticsPropertyName),
105 'typeInformation': typeInformationAccess, 107 'typeInformation': typeInformationAccess,
106 'globalFunctions': globalFunctionsAccess, 108 'globalFunctions': globalFunctionsAccess,
107 'enabledInvokeOn': compiler.enabledInvokeOn, 109 'enabledInvokeOn': compiler.enabledInvokeOn,
108 'interceptedNames': interceptedNamesAccess, 110 'interceptedNames': interceptedNamesAccess,
109 'interceptedNamesSet': emitter.generateInterceptedNamesSet(), 111 'interceptedNamesSet': emitter.generateInterceptedNamesSet(),
110 'notInCspMode': !compiler.useContentSecurityPolicy, 112 'notInCspMode': !compiler.useContentSecurityPolicy,
111 'inCspMode': compiler.useContentSecurityPolicy, 113 'inCspMode': compiler.useContentSecurityPolicy,
112 'deferredAction': namer.deferredAction, 114 'deferredAction': namer.deferredAction,
113 'hasIsolateSupport': program.hasIsolateSupport, 115 'hasIsolateSupport': program.hasIsolateSupport,
114 'fieldNamesProperty': js.string(Emitter.FIELD_NAMES_PROPERTY_NAME), 116 'fieldNamesProperty': js.string(Emitter.FIELD_NAMES_PROPERTY_NAME),
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 function processClassData(cls, descriptor, processedClasses) { 521 function processClassData(cls, descriptor, processedClasses) {
520 descriptor = convertToSlowObject(descriptor); // Use a slow object. 522 descriptor = convertToSlowObject(descriptor); // Use a slow object.
521 var previousProperty; 523 var previousProperty;
522 var properties = Object.keys(descriptor); 524 var properties = Object.keys(descriptor);
523 var hasDeferredWork = false; 525 var hasDeferredWork = false;
524 var shouldDeferWork = 526 var shouldDeferWork =
525 supportsDirectProtoAccess && cls != #objectClassName; 527 supportsDirectProtoAccess && cls != #objectClassName;
526 for (var i = 0; i < properties.length; i++) { 528 for (var i = 0; i < properties.length; i++) {
527 var property = properties[i]; 529 var property = properties[i];
528 var firstChar = property.charCodeAt(0); 530 var firstChar = property.charCodeAt(0);
529 if (property === "static") { 531 if (property === #staticsPropertyNameString) {
530 processStatics(#statics[cls] = descriptor.static, 532 processStatics(#statics[cls] = descriptor.#staticsPropertyName,
531 processedClasses); 533 processedClasses);
532 delete descriptor.static; 534 delete descriptor.#staticsPropertyName;
533 } else if (firstChar === 43) { // 43 is "+". 535 } else if (firstChar === 43) { // 43 is "+".
534 mangledNames[previousProperty] = property.substring(1); 536 mangledNames[previousProperty] = property.substring(1);
535 var flag = descriptor[property]; 537 var flag = descriptor[property];
536 if (flag > 0) 538 if (flag > 0)
537 descriptor[previousProperty].$reflectableField = flag; 539 descriptor[previousProperty].$reflectableField = flag;
538 } else if (firstChar === 42) { // 42 is "*" 540 } else if (firstChar === 42) { // 42 is "*"
539 descriptor[previousProperty].$defaultValuesField = 541 descriptor[previousProperty].$defaultValuesField =
540 descriptor[property]; 542 descriptor[property];
541 var optionalMethods = descriptor.$methodsWithOptionalArgumentsField; 543 var optionalMethods = descriptor.$methodsWithOptionalArgumentsField;
542 if (!optionalMethods) { 544 if (!optionalMethods) {
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 (function() { 854 (function() {
853 var result = $array[$index]; 855 var result = $array[$index];
854 if ($check) { 856 if ($check) {
855 throw new Error( 857 throw new Error(
856 name + ": expected value of type \'$type\' at index " + ($index) + 858 name + ": expected value of type \'$type\' at index " + ($index) +
857 " but got " + (typeof result)); 859 " but got " + (typeof result));
858 } 860 }
859 return result; 861 return result;
860 })()'''; 862 })()''';
861 } 863 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/full_emitter/class_emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698