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

Unified Diff: pkg/compiler/lib/src/cps_ir/builtin_operator.dart

Issue 1285173002: dart2js cps: Rewrite more List operations into JS array operations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: receiverIsNotNull -> optional param Created 5 years, 4 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/cps_ir/builtin_operator.dart
diff --git a/pkg/compiler/lib/src/cps_ir/builtin_operator.dart b/pkg/compiler/lib/src/cps_ir/builtin_operator.dart
index 9077c9f118c3974d3ea489f9e30530a363e1037b..28397eb68bc52a7f7558c4a456f6ffb850a98cc7 100644
--- a/pkg/compiler/lib/src/cps_ir/builtin_operator.dart
+++ b/pkg/compiler/lib/src/cps_ir/builtin_operator.dart
@@ -104,3 +104,29 @@ enum BuiltinOperator {
/// Compiles to `typeof x === 'number' && Math.floor(x) === x`
IsNumberAndFloor,
}
+
+/// A method supported natively in the CPS and Tree IRs using the
+/// `ApplyBuiltinMethod` instructions.
+///
+/// These methods all operate on a distinguished 'object' argument, and
+/// take zero or more additional arguments.
+///
+/// These methods may mutate and depend on the state of the object argument,
+/// but may not depend on or mutate any other state. An exception is thrown
+/// if the object is null, but otherwise they cannot throw or diverge.
+enum BuiltinMethod {
+ /// Add an item to a native list.
+ ///
+ /// Takes any number of arguments, each argument will be added to the
+ /// list on the order given (as per the JS `push` method).
+ ///
+ /// Compiles to `object.push(x1, ..., xN)`.
+ Push,
+
+ /// Remove and return the last item from a native list.
+ ///
+ /// Takes no arguments.
+ ///
+ /// Compiles to `object.pop()`.
+ Pop,
+}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_fragment.dart » ('j') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698