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

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1340093002: dart2js cps: Use more precise type inference for direct index access. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove unused field Created 5 years, 3 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 js_backend; 5 part of js_backend;
6 6
7 const VERBOSE_OPTIMIZER_HINTS = false; 7 const VERBOSE_OPTIMIZER_HINTS = false;
8 8
9 class JavaScriptItemCompilationContext extends ItemCompilationContext { 9 class JavaScriptItemCompilationContext extends ItemCompilationContext {
10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>();
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 ClassElement noSideEffectsClass; 325 ClassElement noSideEffectsClass;
326 ClassElement noThrowsClass; 326 ClassElement noThrowsClass;
327 ClassElement noInlineClass; 327 ClassElement noInlineClass;
328 ClassElement forceInlineClass; 328 ClassElement forceInlineClass;
329 ClassElement irRepresentationClass; 329 ClassElement irRepresentationClass;
330 330
331 Element getInterceptorMethod; 331 Element getInterceptorMethod;
332 332
333 ClassElement jsInvocationMirrorClass; 333 ClassElement jsInvocationMirrorClass;
334 334
335 ClassElement typedArrayClass;
336 ClassElement typedArrayOfIntClass;
337
335 /// If [true], the compiler will emit code that logs whenever a method is 338 /// If [true], the compiler will emit code that logs whenever a method is
336 /// called. When TRACE_METHOD is 'console' this will be logged 339 /// called. When TRACE_METHOD is 'console' this will be logged
337 /// directly in the JavaScript console. When TRACE_METHOD is 'post' the 340 /// directly in the JavaScript console. When TRACE_METHOD is 'post' the
338 /// information will be sent to a server via a POST request. 341 /// information will be sent to a server via a POST request.
339 static const String TRACE_METHOD = const String.fromEnvironment('traceCalls'); 342 static const String TRACE_METHOD = const String.fromEnvironment('traceCalls');
340 static const bool TRACE_CALLS = 343 static const bool TRACE_CALLS =
341 TRACE_METHOD == 'post' || TRACE_METHOD == 'console'; 344 TRACE_METHOD == 'post' || TRACE_METHOD == 'console';
342 Element traceHelper; 345 Element traceHelper;
343 346
344 TypeMask get stringType => compiler.typesTask.stringType; 347 TypeMask get stringType => compiler.typesTask.stringType;
(...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after
2148 preserveLibraryNamesMarker = find(library, 'preserveLibraryNames'); 2151 preserveLibraryNamesMarker = find(library, 'preserveLibraryNames');
2149 } else if (uri == DART_JS_NAMES) { 2152 } else if (uri == DART_JS_NAMES) {
2150 preserveNamesMarker = find(library, 'preserveNames'); 2153 preserveNamesMarker = find(library, 'preserveNames');
2151 } else if (uri == DART_EMBEDDED_NAMES) { 2154 } else if (uri == DART_EMBEDDED_NAMES) {
2152 jsGetNameEnum = find(library, 'JsGetName'); 2155 jsGetNameEnum = find(library, 'JsGetName');
2153 jsBuiltinEnum = find(library, 'JsBuiltin'); 2156 jsBuiltinEnum = find(library, 'JsBuiltin');
2154 } else if (uri == Uris.dart_html) { 2157 } else if (uri == Uris.dart_html) {
2155 htmlLibraryIsLoaded = true; 2158 htmlLibraryIsLoaded = true;
2156 } else if (uri == PACKAGE_LOOKUP_MAP) { 2159 } else if (uri == PACKAGE_LOOKUP_MAP) {
2157 lookupMapAnalysis.init(library); 2160 lookupMapAnalysis.init(library);
2161 } else if (uri == Uris.dart__native_typed_data) {
karlklose 2015/09/15 08:17:07 This is already done in Compiler.onLibraryScanned
asgerf 2015/09/15 10:46:14 NativeTypeData is not the same as NativeTypedArray
2162 typedArrayClass = findClass('NativeTypedArray');
2163 typedArrayOfIntClass = findClass('NativeTypedArrayOfInt');
2158 } 2164 }
2159 annotations.onLibraryScanned(library); 2165 annotations.onLibraryScanned(library);
2160 }); 2166 });
2161 } 2167 }
2162 2168
2163 Future onLibrariesLoaded(LoadedLibraries loadedLibraries) { 2169 Future onLibrariesLoaded(LoadedLibraries loadedLibraries) {
2164 if (!loadedLibraries.containsLibrary(Uris.dart_core)) { 2170 if (!loadedLibraries.containsLibrary(Uris.dart_core)) {
2165 return new Future.value(); 2171 return new Future.value();
2166 } 2172 }
2167 2173
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
3160 } 3166 }
3161 } 3167 }
3162 3168
3163 /// Records that [constant] is used by the element behind [registry]. 3169 /// Records that [constant] is used by the element behind [registry].
3164 class Dependency { 3170 class Dependency {
3165 final ConstantValue constant; 3171 final ConstantValue constant;
3166 final Element annotatedElement; 3172 final Element annotatedElement;
3167 3173
3168 const Dependency(this.constant, this.annotatedElement); 3174 const Dependency(this.constant, this.annotatedElement);
3169 } 3175 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698