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

Unified Diff: runtime/lib/integers.cc

Issue 1913663002: vm: Generate 'and' instruction for Smi values. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: xxx Created 4 years, 6 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 | « runtime/lib/bigint.dart ('k') | runtime/lib/integers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/integers.cc
diff --git a/runtime/lib/integers.cc b/runtime/lib/integers.cc
index 351cbbf6dd7cc39c353d256de23e79381449e8f0..d30da190d4258fec339550fc07dccbc2986444cd 100644
--- a/runtime/lib/integers.cc
+++ b/runtime/lib/integers.cc
@@ -285,6 +285,19 @@ static RawInteger* ShiftOperationHelper(Token::Kind kind,
}
+DEFINE_NATIVE_ENTRY(Smi_bitAndFromSmi, 2) {
+ const Smi& left = Smi::CheckedHandle(arguments->NativeArgAt(0));
+ GET_NON_NULL_NATIVE_ARGUMENT(Smi, right, arguments->NativeArgAt(1));
+ if (FLAG_trace_intrinsified_natives) {
+ OS::Print("Smi_bitAndFromSmi %s & %s\n",
+ left.ToCString(), right.ToCString());
+ }
+ const Smi& left_value = Smi::Cast(left);
+ const Smi& right_value = Smi::Cast(right);
+ return Smi::New(left_value.Value() & right_value.Value());
+}
+
+
DEFINE_NATIVE_ENTRY(Smi_shrFromInt, 2) {
const Smi& amount = Smi::CheckedHandle(arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(Integer, value, arguments->NativeArgAt(1));
« no previous file with comments | « runtime/lib/bigint.dart ('k') | runtime/lib/integers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698