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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.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/js_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 9151b71b64d9c5716c39bb68541acdd54f0cf6f0..73c4b5056e0686e69f36702368915e4bae86348e 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -107,6 +107,7 @@ class JavaScriptBackend extends Backend {
ClassElement noSideEffectsClass;
ClassElement noThrowsClass;
ClassElement noInlineClass;
+ ClassElement irRepresentationClass;
Element getInterceptorMethod;
Element interceptedNames;
@@ -158,6 +159,18 @@ class JavaScriptBackend extends Backend {
*/
final Map<String, Selector> oneShotInterceptors;
+ final Map<Element, bool> _enforceIrElements = <Element, bool>{};
ngeoffray 2013/12/17 12:52:33 Because this is for testing: maybe do it lazily, i
+
+ bool enforceIrRepresentation(Element element) {
+ // Testing [:== true:]is required because the lookup might return [:null:].
+ return _enforceIrElements[element] == true;
+ }
+
+ bool enforceAstRepresentation(Element element) {
+ // Testing [:== false:]is required because the lookup might return [:null:].
+ return _enforceIrElements[element] == false;
+ }
+
/**
* The members of instantiated interceptor classes: maps a member name to the
* list of members that have that name. This map is used by the codegen to
@@ -521,6 +534,7 @@ class JavaScriptBackend extends Backend {
noSideEffectsClass = compiler.findHelper('NoSideEffects');
noThrowsClass = compiler.findHelper('NoThrows');
noInlineClass = compiler.findHelper('NoInline');
+ irRepresentationClass = compiler.findHelper('IrRepresentation');
}
void validateInterceptorImplementsAllObjectMethods(
@@ -1794,6 +1808,10 @@ class JavaScriptBackend extends Backend {
compiler.reportHere(element, "Has no side effects");
}
compiler.world.registerSideEffectsFree(element);
+ } else if (cls == irRepresentationClass) {
ngeoffray 2013/12/17 12:52:33 Do it lazily?
lukas 2013/12/17 13:03:43 Which part exactly? Note that the code is guarded
+ ConstructedConstant classConstant = value;
+ BoolConstant constant = classConstant.fields[0];
+ _enforceIrElements[element] = constant.value;
}
}
if (hasNoThrows && !hasNoInline) {

Powered by Google App Engine
This is Rietveld 408576698