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

Unified Diff: pkg/fletchc/lib/src/fletch_selector.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 11 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
« no previous file with comments | « pkg/fletchc/lib/src/fletch_registry.dart ('k') | pkg/fletchc/lib/src/fletch_system_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/fletchc/lib/src/fletch_selector.dart
diff --git a/pkg/fletchc/lib/src/fletch_selector.dart b/pkg/fletchc/lib/src/fletch_selector.dart
deleted file mode 100644
index 78a2e73ed4962a591db3d9590a5d9f24ee54ecb6..0000000000000000000000000000000000000000
--- a/pkg/fletchc/lib/src/fletch_selector.dart
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE.md file.
-
-library fletchc.fletch_selector;
-
-enum SelectorKind {
- Method,
- Getter,
- Setter,
-}
-
-class FletchSelector {
- final int encodedSelector;
-
- const FletchSelector(this.encodedSelector);
-
- int get id => decodeId(encodedSelector);
-
- SelectorKind get kind => SelectorKind.values[encodedSelector >> 8 & 3];
-
- int get arity => encodedSelector & 255;
-
- static const MAX_ARITY = (1 << 8) - 1;
- static const MAX_UNIQUE_SELECTORS = (1 << 22) - 1;
- static const ID_SHIFT = 10;
-
- // Encode a fletch selector. The result is a 32bit integer with the following
- // layout (lower to higher):
- // - 8 bit arity
- // - 2 bit kind
- // - 22 bit id
- static int encode(int id, SelectorKind kind, int arity) {
- if (arity > MAX_ARITY) throw "Only arity up to 255 is supported";
- if (id > MAX_UNIQUE_SELECTORS) {
- throw "Only ${MAX_UNIQUE_SELECTORS + 1} unique identifiers is supported";
- }
- return arity | (kind.index << 8) | (id << ID_SHIFT);
- }
-
- static int encodeMethod(int id, int arity) {
- return encode(id, SelectorKind.Method, arity);
- }
-
- static int encodeGetter(int id) => encode(id, SelectorKind.Getter, 0);
-
- static int encodeSetter(int id) => encode(id, SelectorKind.Setter, 1);
-
- static int decodeId(int selector) => selector >> ID_SHIFT;
-}
« no previous file with comments | « pkg/fletchc/lib/src/fletch_registry.dart ('k') | pkg/fletchc/lib/src/fletch_system_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698