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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 1559233002: WIP: Compute constant expressions in resolution. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 ssa; 5 part of ssa;
6 6
7 class SsaFunctionCompiler implements FunctionCompiler { 7 class SsaFunctionCompiler implements FunctionCompiler {
8 final SsaCodeGeneratorTask generator; 8 final SsaCodeGeneratorTask generator;
9 final SsaBuilderTask builder; 9 final SsaBuilderTask builder;
10 final SsaOptimizerTask optimizer; 10 final SsaOptimizerTask optimizer;
(...skipping 4293 matching lines...) Expand 10 before | Expand all | Expand 10 after
4304 {'text': 'Error: Extra argument to JS_EMBEDDED_GLOBAL.'}); 4304 {'text': 'Error: Extra argument to JS_EMBEDDED_GLOBAL.'});
4305 } 4305 }
4306 return; 4306 return;
4307 } 4307 }
4308 visit(globalNameNode); 4308 visit(globalNameNode);
4309 HInstruction globalNameHNode = pop(); 4309 HInstruction globalNameHNode = pop();
4310 if (!globalNameHNode.isConstantString()) { 4310 if (!globalNameHNode.isConstantString()) {
4311 reporter.reportErrorMessage( 4311 reporter.reportErrorMessage(
4312 arguments[1], MessageKind.GENERIC, 4312 arguments[1], MessageKind.GENERIC,
4313 {'text': 'Error: Expected String as second argument ' 4313 {'text': 'Error: Expected String as second argument '
4314 'to JS_EMBEDDED_GLOBAL.'}); 4314 'to JS_EMBEDDED_GLOBAL. Found: ${globalNameHNode}'});
4315 return; 4315 return;
4316 } 4316 }
4317 HConstant hConstant = globalNameHNode; 4317 HConstant hConstant = globalNameHNode;
4318 StringConstantValue constant = hConstant.constant; 4318 StringConstantValue constant = hConstant.constant;
4319 String globalName = constant.primitiveValue.slowToString(); 4319 String globalName = constant.primitiveValue.slowToString();
4320 js.Template expr = js.js.expressionTemplateYielding( 4320 js.Template expr = js.js.expressionTemplateYielding(
4321 backend.emitter.generateEmbeddedGlobalAccess(globalName)); 4321 backend.emitter.generateEmbeddedGlobalAccess(globalName));
4322 native.NativeBehavior nativeBehavior = 4322 native.NativeBehavior nativeBehavior =
4323 compiler.enqueuer.resolution.nativeEnqueuer.getNativeBehaviorOf(node); 4323 compiler.enqueuer.resolution.nativeEnqueuer.getNativeBehaviorOf(node);
4324 TypeMask ssaType = 4324 TypeMask ssaType =
(...skipping 4673 matching lines...) Expand 10 before | Expand all | Expand 10 after
8998 if (unaliased is TypedefType) throw 'unable to unalias $type'; 8998 if (unaliased is TypedefType) throw 'unable to unalias $type';
8999 unaliased.accept(this, builder); 8999 unaliased.accept(this, builder);
9000 } 9000 }
9001 9001
9002 void visitDynamicType(DynamicType type, SsaBuilder builder) { 9002 void visitDynamicType(DynamicType type, SsaBuilder builder) {
9003 JavaScriptBackend backend = builder.compiler.backend; 9003 JavaScriptBackend backend = builder.compiler.backend;
9004 ClassElement cls = backend.findHelper('DynamicRuntimeType'); 9004 ClassElement cls = backend.findHelper('DynamicRuntimeType');
9005 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 9005 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
9006 } 9006 }
9007 } 9007 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/serialization/constant_serialization.dart ('k') | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698