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

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

Issue 2278213003: Rename the global inference task and reduce it's API surface by introducing the (Closed)
Patch Set: Created 4 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 library js_backend.backend; 5 library js_backend.backend;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; 9 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames;
10 10
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 326
327 /// If [true], the compiler will emit code that logs whenever a method is 327 /// If [true], the compiler will emit code that logs whenever a method is
328 /// called. When TRACE_METHOD is 'console' this will be logged 328 /// called. When TRACE_METHOD is 'console' this will be logged
329 /// directly in the JavaScript console. When TRACE_METHOD is 'post' the 329 /// directly in the JavaScript console. When TRACE_METHOD is 'post' the
330 /// information will be sent to a server via a POST request. 330 /// information will be sent to a server via a POST request.
331 static const String TRACE_METHOD = const String.fromEnvironment('traceCalls'); 331 static const String TRACE_METHOD = const String.fromEnvironment('traceCalls');
332 static const bool TRACE_CALLS = 332 static const bool TRACE_CALLS =
333 TRACE_METHOD == 'post' || TRACE_METHOD == 'console'; 333 TRACE_METHOD == 'post' || TRACE_METHOD == 'console';
334 Element traceHelper; 334 Element traceHelper;
335 335
336 TypeMask get stringType => compiler.typesTask.stringType; 336 TypeMask get stringType => compiler.commonMasks.stringType;
337 TypeMask get doubleType => compiler.typesTask.doubleType; 337 TypeMask get doubleType => compiler.commonMasks.doubleType;
338 TypeMask get intType => compiler.typesTask.intType; 338 TypeMask get intType => compiler.commonMasks.intType;
339 TypeMask get uint32Type => compiler.typesTask.uint32Type; 339 TypeMask get uint32Type => compiler.commonMasks.uint32Type;
340 TypeMask get uint31Type => compiler.typesTask.uint31Type; 340 TypeMask get uint31Type => compiler.commonMasks.uint31Type;
341 TypeMask get positiveIntType => compiler.typesTask.positiveIntType; 341 TypeMask get positiveIntType => compiler.commonMasks.positiveIntType;
342 TypeMask get numType => compiler.typesTask.numType; 342 TypeMask get numType => compiler.commonMasks.numType;
343 TypeMask get boolType => compiler.typesTask.boolType; 343 TypeMask get boolType => compiler.commonMasks.boolType;
344 TypeMask get dynamicType => compiler.typesTask.dynamicType; 344 TypeMask get dynamicType => compiler.commonMasks.dynamicType;
345 TypeMask get nullType => compiler.typesTask.nullType; 345 TypeMask get nullType => compiler.commonMasks.nullType;
346 TypeMask get emptyType => const TypeMask.nonNullEmpty(); 346 TypeMask get emptyType => const TypeMask.nonNullEmpty();
347 347
348 TypeMask _indexablePrimitiveTypeCache; 348 TypeMask _indexablePrimitiveTypeCache;
349 TypeMask get indexablePrimitiveType { 349 TypeMask get indexablePrimitiveType {
350 if (_indexablePrimitiveTypeCache == null) { 350 if (_indexablePrimitiveTypeCache == null) {
351 _indexablePrimitiveTypeCache = 351 _indexablePrimitiveTypeCache =
352 new TypeMask.nonNullSubtype(helpers.jsIndexableClass, compiler.world); 352 new TypeMask.nonNullSubtype(helpers.jsIndexableClass, compiler.world);
353 } 353 }
354 return _indexablePrimitiveTypeCache; 354 return _indexablePrimitiveTypeCache;
355 } 355 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 if (_unmodifiableArrayTypeCache == null) { 395 if (_unmodifiableArrayTypeCache == null) {
396 _unmodifiableArrayTypeCache = new TypeMask.nonNullExact( 396 _unmodifiableArrayTypeCache = new TypeMask.nonNullExact(
397 helpers.jsUnmodifiableArrayClass, compiler.world); 397 helpers.jsUnmodifiableArrayClass, compiler.world);
398 } 398 }
399 return _fixedArrayTypeCache; 399 return _fixedArrayTypeCache;
400 } 400 }
401 401
402 TypeMask _nonNullTypeCache; 402 TypeMask _nonNullTypeCache;
403 TypeMask get nonNullType { 403 TypeMask get nonNullType {
404 if (_nonNullTypeCache == null) { 404 if (_nonNullTypeCache == null) {
405 _nonNullTypeCache = compiler.typesTask.dynamicType.nonNullable(); 405 _nonNullTypeCache = compiler.commonMasks.dynamicType.nonNullable();
Harry Terkelsen 2016/08/25 23:06:25 just replace compiler.commonMasks.dynamicType with
Siggi Cherem (dart-lang) 2016/08/25 23:19:33 Actually - nonNullType is defined in commonMasks a
406 } 406 }
407 return _nonNullTypeCache; 407 return _nonNullTypeCache;
408 } 408 }
409 409
410 /// Maps special classes to their implementation (JSXxx) class. 410 /// Maps special classes to their implementation (JSXxx) class.
411 Map<ClassElement, ClassElement> implementationClasses; 411 Map<ClassElement, ClassElement> implementationClasses;
412 412
413 bool needToInitializeIsolateAffinityTag = false; 413 bool needToInitializeIsolateAffinityTag = false;
414 bool needToInitializeDispatchProperty = false; 414 bool needToInitializeDispatchProperty = false;
415 415
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 compiler, namer, generateSourceMap, useStartupEmitter); 619 compiler, namer, generateSourceMap, useStartupEmitter);
620 typeVariableHandler = new TypeVariableHandler(compiler); 620 typeVariableHandler = new TypeVariableHandler(compiler);
621 customElementsAnalysis = new CustomElementsAnalysis(this); 621 customElementsAnalysis = new CustomElementsAnalysis(this);
622 lookupMapAnalysis = new LookupMapAnalysis(this, reporter); 622 lookupMapAnalysis = new LookupMapAnalysis(this, reporter);
623 jsInteropAnalysis = new JsInteropAnalysis(this); 623 jsInteropAnalysis = new JsInteropAnalysis(this);
624 624
625 noSuchMethodRegistry = new NoSuchMethodRegistry(this); 625 noSuchMethodRegistry = new NoSuchMethodRegistry(this);
626 constantCompilerTask = new JavaScriptConstantTask(compiler); 626 constantCompilerTask = new JavaScriptConstantTask(compiler);
627 impactTransformer = new JavaScriptImpactTransformer(this); 627 impactTransformer = new JavaScriptImpactTransformer(this);
628 patchResolverTask = new PatchResolverTask(compiler); 628 patchResolverTask = new PatchResolverTask(compiler);
629 functionCompiler = new SsaFunctionCompiler( 629 functionCompiler =
630 this, sourceInformationStrategy, useKernel); 630 new SsaFunctionCompiler(this, sourceInformationStrategy, useKernel);
631 serialization = new JavaScriptBackendSerialization(this); 631 serialization = new JavaScriptBackendSerialization(this);
632 } 632 }
633 633
634 ConstantSystem get constantSystem => constants.constantSystem; 634 ConstantSystem get constantSystem => constants.constantSystem;
635 635
636 DiagnosticReporter get reporter => compiler.reporter; 636 DiagnosticReporter get reporter => compiler.reporter;
637 637
638 CoreClasses get coreClasses => compiler.coreClasses; 638 CoreClasses get coreClasses => compiler.coreClasses;
639 639
640 CoreTypes get coreTypes => compiler.coreTypes; 640 CoreTypes get coreTypes => compiler.coreTypes;
(...skipping 2557 matching lines...) Expand 10 before | Expand all | Expand 10 after
3198 3198
3199 @override 3199 @override
3200 void onImpactUsed(ImpactUseCase impactUse) { 3200 void onImpactUsed(ImpactUseCase impactUse) {
3201 if (impactUse == DeferredLoadTask.IMPACT_USE && !supportSerialization) { 3201 if (impactUse == DeferredLoadTask.IMPACT_USE && !supportSerialization) {
3202 // TODO(johnniwinther): Allow emptying when serialization has been 3202 // TODO(johnniwinther): Allow emptying when serialization has been
3203 // performed. 3203 // performed.
3204 resolution.emptyCache(); 3204 resolution.emptyCache();
3205 } 3205 }
3206 } 3206 }
3207 } 3207 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698