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

Unified Diff: pkg/compiler/lib/src/native/enqueue.dart

Issue 954253002: dart2js: add compiler builtins to the core-runtime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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: pkg/compiler/lib/src/native/enqueue.dart
diff --git a/pkg/compiler/lib/src/native/enqueue.dart b/pkg/compiler/lib/src/native/enqueue.dart
index 131ba1844094e411b864e67fefe6ed604501ee8c..462b09e3fb46044a1086c07fbc97c98f1bce7394 100644
--- a/pkg/compiler/lib/src/native/enqueue.dart
+++ b/pkg/compiler/lib/src/native/enqueue.dart
@@ -54,6 +54,18 @@ class NativeEnqueuer {
// TODO(sra): The entry from codegen will not have a resolver.
void registerJsEmbeddedGlobalCall(Send node, ResolverVisitor resolver) {}
+ /**
+ * Handles JS-compiler macro calls, which can be an instantiation point for
+ * types.
+ *
+ * For example, the following code instantiates and returns a String class
+ *
+ * JS_EMBEDDED_GLOBAL('String', 'int2stringMacro', 0)
+ *
+ */
+ // TODO(sra): The entry from codegen will not have a resolver.
+ void registerJsCompilerMacroCall(Send node, ResolverVisitor resolver) {}
+
/// Emits a summary information using the [log] function.
void logSummary(log(message)) {}
@@ -461,6 +473,14 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
flushQueue();
}
+ void registerJsCompilerMacroCall(Send node, ResolverVisitor resolver) {
+ NativeBehavior behavior =
+ NativeBehavior.ofJsCompilerMacroCall(node, compiler, resolver);
+ processNativeBehavior(behavior, node);
+ nativeBehaviors[node] = behavior;
+ flushQueue();
+ }
+
NativeBehavior getNativeBehaviorOf(Send node) => nativeBehaviors[node];
processNativeBehavior(NativeBehavior behavior, cause) {

Powered by Google App Engine
This is Rietveld 408576698