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

Unified Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2836733002: dart2js: patch file support cleanup (Closed)
Patch Set: remove js_array change Created 3 years, 8 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/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/graph_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder_kernel.dart
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index e9d03deed2f83414c9c4e723a87a5b58f8249b86..6e1c994162e72dd815019d53163c0417f2897d1a 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -2416,21 +2416,15 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
return;
}
String name = _foreignConstantStringArgument(invocation, 0, 'JS_GET_FLAG');
- bool value = false;
- switch (name) {
- case 'MUST_RETAIN_METADATA':
- value = mirrorsData.mustRetainMetadata;
- break;
- case 'USE_CONTENT_SECURITY_POLICY':
- value = options.useContentSecurityPolicy;
- break;
- default:
- reporter.reportErrorMessage(
- astAdapter.getNode(invocation),
- MessageKind.GENERIC,
- {'text': 'Error: Unknown internal flag "$name".'});
- }
- stack.add(graph.addConstantBool(value, closedWorld));
+ bool value = getFlagValue(name);
+ if (value == null) {
+ reporter.reportErrorMessage(
+ astAdapter.getNode(invocation),
+ MessageKind.GENERIC,
+ {'text': 'Error: Unknown internal flag "$name".'});
+ } else {
+ stack.add(graph.addConstantBool(value, closedWorld));
+ }
}
void handleJsInterceptorConstant(ir.StaticInvocation invocation) {
@@ -2503,8 +2497,7 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
push(new HForeignCode(nativeBehavior.codeTemplate, ssaType, inputs,
isStatement: !nativeBehavior.codeTemplate.isExpression,
effects: nativeBehavior.sideEffects,
- nativeBehavior: nativeBehavior)
- ..sourceInformation = sourceInformation);
+ nativeBehavior: nativeBehavior)..sourceInformation = sourceInformation);
}
void handleJsStringConcat(ir.StaticInvocation invocation) {
@@ -2608,8 +2601,9 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
_pushDynamicInvocation(
invocation,
astAdapter.typeOfInvocation(invocation, closedWorld),
- <HInstruction>[receiver]..addAll(
- _visitArgumentsForDynamicTarget(selector, invocation.arguments)));
+ <HInstruction>[receiver]
+ ..addAll(
+ _visitArgumentsForDynamicTarget(selector, invocation.arguments)));
}
bool _handleEqualsNull(ir.MethodInvocation invocation) {
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/graph_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698