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

Unified Diff: pkg/compiler/lib/src/js_backend/type_variable_handler.dart

Issue 2034973003: Handle deferred access of unserialized code. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: dartfmt Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/deferred_load.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/type_variable_handler.dart
diff --git a/pkg/compiler/lib/src/js_backend/type_variable_handler.dart b/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
index b3b4354a4b011ed143e96166652b0d02a5ef607f..faf8539e04d80b5bb455dbf323291792540bb2c1 100644
--- a/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
+++ b/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
@@ -9,7 +9,7 @@ part of js_backend;
*/
class TypeVariableHandler {
final Compiler _compiler;
- FunctionElement _typeVariableConstructor;
+ ConstructorElement _typeVariableConstructor;
/**
* Set to 'true' on first encounter of a class with type variables.
@@ -77,43 +77,23 @@ class TypeVariableHandler {
for (TypeVariableType currentTypeVariable in cls.typeVariables) {
TypeVariableElement typeVariableElement = currentTypeVariable.element;
- AstConstant name = new AstConstant(
- typeVariableElement,
- typeVariableElement.node,
- new StringConstantExpression(currentTypeVariable.name),
- _backend.constantSystem
- .createString(new DartString.literal(currentTypeVariable.name)));
jsAst.Expression boundIndex =
_metadataCollector.reifyType(typeVariableElement.bound);
ConstantValue boundValue = new SyntheticConstantValue(
SyntheticConstantKind.TYPEVARIABLE_REFERENCE, boundIndex);
ConstantExpression boundExpression =
new SyntheticConstantExpression(boundValue);
- AstConstant bound = new AstConstant(typeVariableElement,
- typeVariableElement.node, boundExpression, boundValue);
- AstConstant type = new AstConstant(
- typeVariableElement,
- typeVariableElement.node,
- new TypeConstantExpression(cls.rawType),
- _backend.constantSystem.createType(_backend.compiler, cls.rawType));
- List<AstConstant> arguments = [type, name, bound];
-
- // TODO(johnniwinther): Support a less front-end specific creation of
- // constructed constants.
- AstConstant constant =
- CompileTimeConstantEvaluator.makeConstructedConstant(
- _compiler,
- _backend.constants,
- typeVariableElement,
- typeVariableElement.node,
- typeVariableType,
- _typeVariableConstructor,
- typeVariableType,
- _typeVariableConstructor,
- const CallStructure.unnamed(3),
- arguments,
- arguments);
- ConstantValue value = constant.value;
+ ConstantExpression constant = new ConstructedConstantExpression(
+ _typeVariableConstructor.enclosingClass.thisType,
+ _typeVariableConstructor,
+ const CallStructure.unnamed(3), [
+ new TypeConstantExpression(cls.rawType),
+ new StringConstantExpression(currentTypeVariable.name),
+ new SyntheticConstantExpression(boundValue)
+ ]);
+
+ _backend.constants.evaluate(constant);
+ ConstantValue value = _backend.constants.getConstantValue(constant);
_backend.registerCompileTimeConstant(value, _compiler.globalDependencies);
_backend.addCompileTimeConstantForEmission(value);
_backend.constants.addCompileTimeConstantForEmission(value);
« no previous file with comments | « pkg/compiler/lib/src/deferred_load.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698