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

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

Issue 1083063002: Deprecate visitAssertSend and visitTypePrefixSend (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 5 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/resolved_visitor.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index ec2f1d2d3f95bb80d0a215f04f79a3aeab0b7571..368b6ef27e7155784e1ea5345453784bf479ae7a 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -4574,16 +4574,16 @@ class SsaBuilder extends NewResolvedVisitor {
return false;
}
- visitAssertSend(node) {
+ @override
+ visitAssert(ast.Send node, ast.Node expression, _) {
if (!compiler.enableUserAssertions) {
stack.add(graph.addConstantNull(compiler));
return;
}
- // TODO(johnniwinther): Don't handle assert like a regular static call.
- // It breaks the selector name check since the assert helper method cannot
- // be called `assert` and therefore does not match the selector like a
- // regular method.
- visitStaticSend(node);
+ assert(invariant(node, node.arguments.tail.isEmpty,
+ message: "Invalid assertion: $node"));
+ buildStaticFunctionInvoke(
+ node, backend.assertMethod, CallStructure.ONE_ARG);
}
visitStaticSend(ast.Send node) {
@@ -4618,19 +4618,7 @@ class SsaBuilder extends NewResolvedVisitor {
generateWrongArgumentCountError(node, element, node.arguments);
return;
}
-
- List<HInstruction> inputs =
- makeStaticArgumentList(callStructure,
- node.arguments,
- element.implementation);
-
- if (element == compiler.identicalFunction) {
- pushWithPosition(
- new HIdentity(inputs[0], inputs[1], null, backend.boolType), node);
- return;
- }
-
- pushInvokeStatic(node, element, inputs);
+ buildStaticFunctionInvoke(node, element, callStructure);
} else {
generateGetter(node, element);
List<HInstruction> inputs = <HInstruction>[pop()];
@@ -4642,16 +4630,30 @@ class SsaBuilder extends NewResolvedVisitor {
}
}
+ void buildStaticFunctionInvoke(
+ ast.Send node,
+ FunctionElement element,
+ CallStructure callStructure) {
+ List<HInstruction> inputs = makeStaticArgumentList(
+ callStructure,
+ node.arguments,
+ element.implementation);
+
+ if (element == compiler.identicalFunction) {
+ pushWithPosition(
+ new HIdentity(inputs[0], inputs[1], null, backend.boolType), node);
+ return;
+ } else {
+ pushInvokeStatic(node, element, inputs);
+ }
+ }
+
HConstant addConstantString(String string) {
ast.DartString dartString = new ast.DartString.literal(string);
ConstantValue constant = constantSystem.createString(dartString);
return graph.addConstant(constant, compiler);
}
- visitTypePrefixSend(ast.Send node) {
- compiler.internalError(node, "visitTypePrefixSend should not be called.");
- }
-
visitTypeLiteralSend(ast.Send node) {
DartType type = elements.getTypeLiteralType(node);
if (type.isInterfaceType || type.isTypedef || type.isDynamic) {
« no previous file with comments | « pkg/compiler/lib/src/resolved_visitor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698