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

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

Issue 964853002: Let CSP-mode-flag be available as a foreign_helper constant. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/js_lib/js_helper.dart » ('j') | 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) 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 SsaCodeGeneratorTask generator; 8 SsaCodeGeneratorTask generator;
9 SsaBuilderTask builder; 9 SsaBuilderTask builder;
10 SsaOptimizerTask optimizer; 10 SsaOptimizerTask optimizer;
(...skipping 3693 matching lines...) Expand 10 before | Expand all | Expand 10 after
3704 return; 3704 return;
3705 } 3705 }
3706 ast.LiteralString string = argument.asLiteralString(); 3706 ast.LiteralString string = argument.asLiteralString();
3707 if (string == null) { 3707 if (string == null) {
3708 compiler.reportError( 3708 compiler.reportError(
3709 argument, MessageKind.GENERIC, 3709 argument, MessageKind.GENERIC,
3710 {'text': 'Error: Expected a literal string.'}); 3710 {'text': 'Error: Expected a literal string.'});
3711 } 3711 }
3712 String name = string.dartString.slowToString(); 3712 String name = string.dartString.slowToString();
3713 bool value = false; 3713 bool value = false;
3714 if (name == 'MUST_RETAIN_METADATA') { 3714 switch (name) {
3715 value = backend.mustRetainMetadata; 3715 case 'MUST_RETAIN_METADATA':
3716 } else { 3716 value = backend.mustRetainMetadata;
3717 compiler.reportError( 3717 break;
3718 node, MessageKind.GENERIC, 3718 case 'USE_CONTENT_SECURITY_POLICY':
3719 {'text': 'Error: Unknown internal flag "$name".'}); 3719 value = compiler.useContentSecurityPolicy;
3720 break;
3721 default:
3722 compiler.reportError(
3723 node, MessageKind.GENERIC,
3724 {'text': 'Error: Unknown internal flag "$name".'});
3720 } 3725 }
3721 stack.add(graph.addConstantBool(value, compiler)); 3726 stack.add(graph.addConstantBool(value, compiler));
3722 } 3727 }
3723 3728
3724 void handleForeignJsGetName(ast.Send node) { 3729 void handleForeignJsGetName(ast.Send node) {
3725 List<ast.Node> arguments = node.arguments.toList(); 3730 List<ast.Node> arguments = node.arguments.toList();
3726 ast.Node argument; 3731 ast.Node argument;
3727 switch (arguments.length) { 3732 switch (arguments.length) {
3728 case 0: 3733 case 0:
3729 compiler.reportError( 3734 compiler.reportError(
(...skipping 3192 matching lines...) Expand 10 before | Expand all | Expand 10 after
6922 if (unaliased is TypedefType) throw 'unable to unalias $type'; 6927 if (unaliased is TypedefType) throw 'unable to unalias $type';
6923 unaliased.accept(this, builder); 6928 unaliased.accept(this, builder);
6924 } 6929 }
6925 6930
6926 void visitDynamicType(DynamicType type, SsaBuilder builder) { 6931 void visitDynamicType(DynamicType type, SsaBuilder builder) {
6927 JavaScriptBackend backend = builder.compiler.backend; 6932 JavaScriptBackend backend = builder.compiler.backend;
6928 ClassElement cls = backend.findHelper('DynamicRuntimeType'); 6933 ClassElement cls = backend.findHelper('DynamicRuntimeType');
6929 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 6934 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
6930 } 6935 }
6931 } 6936 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/js_lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698