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

Unified Diff: sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart

Issue 108333007: tests for inlining between IR and AST functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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
Index: sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart b/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart
index 4132db247bd0d23f14ed74937d4294ac47356547..351e18bc84348dbcb638c4fa344238873fe490ef 100644
--- a/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart
@@ -83,6 +83,7 @@ class IrBuilderTask extends CompilerTask {
unlinkTreeAndToken(element);
}
}
+ ensureIr(element);
});
});
}
@@ -114,9 +115,23 @@ class IrBuilderTask extends CompilerTask {
// TODO(lry): support native functions (also in [visitReturn]).
if (function.isNative()) return false;
+ // Methods annotated @IrRepresentation(false).
+ if (backend.enforceAstRepresentation(function)) return false;
+
return true;
}
+ /**
+ * If no IR was built for [element], ensure it is not annotated
+ * @IrRepresentation(true).
+ */
+ bool ensureIr(Element element) {
+ // Ensure that the method is not annotated
+ if (!compiler.irBuilder.hasIr(element) &&
ngeoffray 2013/12/17 12:52:33 Since this is for testing purposes, should you ass
lukas 2013/12/17 13:03:43 Then the "ir_representation_test.dart" would compi
+ compiler.backend.enforceIrRepresentation(element))
+ compiler.internalError("coult not build IR", element: element);
+ }
+
void unlinkTreeAndToken(element) {
// Ensure the function signature has been computed (requires the AST).
assert(element is !FunctionElementX || element.functionSignature != null);

Powered by Google App Engine
This is Rietveld 408576698