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

Unified Diff: lib/compiler/implementation/compile_time_constants.dart

Issue 10911062: Codegen support for the argument definition test. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
Index: lib/compiler/implementation/compile_time_constants.dart
===================================================================
--- lib/compiler/implementation/compile_time_constants.dart (revision 11792)
+++ lib/compiler/implementation/compile_time_constants.dart (working copy)
@@ -21,6 +21,7 @@
bool isPrimitive() => false;
/** Returns true if the constant is a list, a map or a constructed object. */
bool isObject() => false;
+ bool isSentinel() => false;
bool isNaN() => false;
@@ -34,6 +35,27 @@
abstract List<Constant> getDependencies();
}
+class SentinelConstant extends Constant {
+ const SentinelConstant();
+ static final SENTINEL = const SentinelConstant();
+
+ void _writeJsCode(CodeBuffer buffer, ConstantHandler handler) {
+ handler.compiler.internalError(
+ "The parameter sentinel constant does not need specific JS code");
+ }
+
+ void _writeCanonicalizedJsCode(CodeBuffer buffer, ConstantHandler handler) {
+ buffer.add(handler.compiler.namer.CURRENT_ISOLATE);
+ }
+
+ List<Constant> getDependencies() => const <Constant>[];
+
+ // Just use a randome value.
+ int hashCode() => 9264297841582447;
+
+ bool isSentinel() => true;
+}
+
class FunctionConstant extends Constant {
Element element;

Powered by Google App Engine
This is Rietveld 408576698