Version 2.13.0-92.0.dev
Merge commit '40b469cc30c96a9883e4848b1c98a5144d09161c' into 'dev'
diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json
index a203927..45febc4 100644
--- a/.dart_tool/package_config.json
+++ b/.dart_tool/package_config.json
@@ -11,7 +11,7 @@
"constraint, update this by running tools/generate_package_config.dart."
],
"configVersion": 2,
- "generated": "2021-02-25T12:53:17.111860",
+ "generated": "2021-03-01T09:26:17.118461",
"generator": "tools/generate_package_config.dart",
"packages": [
{
diff --git a/DEPS b/DEPS
index 35ba597..383b118 100644
--- a/DEPS
+++ b/DEPS
@@ -101,7 +101,7 @@
"dart_style_tag": "1.3.11", # Please see the note above before updating.
"chromedriver_tag": "83.0.4103.39",
- "dartdoc_rev" : "9e61a4f11091aaa8998525a2692b14148dc24ab5",
+ "dartdoc_rev" : "174021f3d76c2a8500b54977c80f32c5bbc099f1",
"ffi_rev": "f3346299c55669cc0db48afae85b8110088bf8da",
"fixnum_rev": "16d3890c6dc82ca629659da1934e412292508bba",
"file_rev": "0e09370f581ab6388d46fda4cdab66638c0171a1",
diff --git a/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart
new file mode 100644
index 0000000..d77e883
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart
@@ -0,0 +1,50 @@
+// Copyright (c) 2021, the Dart 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 file.
+
+// Tests function invocations that immediately return simple expressions.
+
+import "package:expect/expect.dart";
+
+const binary = binaryFn(2, 1);
+int binaryFn(int a, int b) => a - b;
+
+const optional = optionalFn(2);
+const optional1 = optionalFn(2, 1);
+int optionalFn(int c, [int d = 0]) => c + d;
+
+const named = namedFn(2, f: 2);
+const named1 = namedFn(2);
+int namedFn(int e, {int f = 3}) => e + f;
+
+const type = typeFn(6);
+T typeFn<T>(T x) => x;
+
+const str = stringFn("str");
+String stringFn(String s) => s + "ing";
+
+const eq = equalFn(2, 2);
+bool equalFn(int a, int b) => a == b;
+
+const negative = unary(2);
+int unary(int a) => -a;
+
+const boolean = boolFn(true, false);
+bool boolFn(bool a, bool b) => a || b;
+
+const doubleResult = doubleFn(2.2, 2);
+double doubleFn(double a, double b) => a * b;
+
+void main() {
+ Expect.equals(binary, 1);
+ Expect.equals(optional, 2);
+ Expect.equals(optional1, 3);
+ Expect.equals(named, 4);
+ Expect.equals(named1, 5);
+ Expect.equals(type, 6);
+ Expect.equals(str, "string");
+ Expect.equals(eq, true);
+ Expect.equals(negative, -2);
+ Expect.equals(boolean, true);
+ Expect.equals(doubleResult, 4.4);
+}
diff --git a/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.strong.expect b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.strong.expect
new file mode 100644
index 0000000..977caaa
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.strong.expect
@@ -0,0 +1,63 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+import "package:expect/expect.dart" as exp;
+
+import "package:expect/expect.dart";
+
+static const field core::int binary = #C1;
+static const field core::int optional = #C2;
+static const field core::int optional1 = #C3;
+static const field core::int named = #C4;
+static const field core::int named1 = #C5;
+static const field core::int type = #C6;
+static const field core::String str = #C7;
+static const field core::bool eq = #C8;
+static const field core::int negative = #C9;
+static const field core::bool boolean = #C8;
+static const field core::double doubleResult = #C10;
+static method binaryFn(core::int a, core::int b) → core::int
+ return a.{core::num::-}(b);
+static method optionalFn(core::int c, [core::int d = #C11]) → core::int
+ return c.{core::num::+}(d);
+static method namedFn(core::int e, {core::int f = #C3}) → core::int
+ return e.{core::num::+}(f);
+static method typeFn<T extends core::Object? = dynamic>(self::typeFn::T% x) → self::typeFn::T%
+ return x;
+static method stringFn(core::String s) → core::String
+ return s.{core::String::+}("ing");
+static method equalFn(core::int a, core::int b) → core::bool
+ return a.{core::num::==}(b);
+static method unary(core::int a) → core::int
+ return a.{core::int::unary-}();
+static method boolFn(core::bool a, core::bool b) → core::bool
+ return a || b;
+static method doubleFn(core::double a, core::double b) → core::double
+ return a.{core::double::*}(b);
+static method main() → void {
+ exp::Expect::equals(#C1, 1);
+ exp::Expect::equals(#C2, 2);
+ exp::Expect::equals(#C3, 3);
+ exp::Expect::equals(#C4, 4);
+ exp::Expect::equals(#C5, 5);
+ exp::Expect::equals(#C6, 6);
+ exp::Expect::equals(#C7, "string");
+ exp::Expect::equals(#C8, true);
+ exp::Expect::equals(#C9, 2.{core::int::unary-}());
+ exp::Expect::equals(#C8, true);
+ exp::Expect::equals(#C10, 4.4);
+}
+
+constants {
+ #C1 = 1
+ #C2 = 2
+ #C3 = 3
+ #C4 = 4
+ #C5 = 5
+ #C6 = 6
+ #C7 = "string"
+ #C8 = true
+ #C9 = -2
+ #C10 = 4.4
+ #C11 = 0
+}
diff --git a/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.strong.transformed.expect b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.strong.transformed.expect
new file mode 100644
index 0000000..920ec7f
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.strong.transformed.expect
@@ -0,0 +1,67 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+import "package:expect/expect.dart" as exp;
+
+import "package:expect/expect.dart";
+
+static const field core::int binary = #C1;
+static const field core::int optional = #C2;
+static const field core::int optional1 = #C3;
+static const field core::int named = #C4;
+static const field core::int named1 = #C5;
+static const field core::int type = #C6;
+static const field core::String str = #C7;
+static const field core::bool eq = #C8;
+static const field core::int negative = #C9;
+static const field core::bool boolean = #C8;
+static const field core::double doubleResult = #C10;
+static method binaryFn(core::int a, core::int b) → core::int
+ return a.{core::num::-}(b);
+static method optionalFn(core::int c, [core::int d = #C11]) → core::int
+ return c.{core::num::+}(d);
+static method namedFn(core::int e, {core::int f = #C3}) → core::int
+ return e.{core::num::+}(f);
+static method typeFn<T extends core::Object? = dynamic>(self::typeFn::T% x) → self::typeFn::T%
+ return x;
+static method stringFn(core::String s) → core::String
+ return s.{core::String::+}("ing");
+static method equalFn(core::int a, core::int b) → core::bool
+ return a.{core::num::==}(b);
+static method unary(core::int a) → core::int
+ return a.{core::int::unary-}();
+static method boolFn(core::bool a, core::bool b) → core::bool
+ return a || b;
+static method doubleFn(core::double a, core::double b) → core::double
+ return a.{core::double::*}(b);
+static method main() → void {
+ exp::Expect::equals(#C1, 1);
+ exp::Expect::equals(#C2, 2);
+ exp::Expect::equals(#C3, 3);
+ exp::Expect::equals(#C4, 4);
+ exp::Expect::equals(#C5, 5);
+ exp::Expect::equals(#C6, 6);
+ exp::Expect::equals(#C7, "string");
+ exp::Expect::equals(#C8, true);
+ exp::Expect::equals(#C9, 2.{core::int::unary-}());
+ exp::Expect::equals(#C8, true);
+ exp::Expect::equals(#C10, 4.4);
+}
+
+constants {
+ #C1 = 1
+ #C2 = 2
+ #C3 = 3
+ #C4 = 4
+ #C5 = 5
+ #C6 = 6
+ #C7 = "string"
+ #C8 = true
+ #C9 = -2
+ #C10 = 4.4
+ #C11 = 0
+}
+
+Extra constant evaluation status:
+Evaluated: MethodInvocation @ org-dartlang-testcase:///const_functions_simple_invocations.dart:47:27 -> IntConstant(-2)
+Extra constant evaluation: evaluated: 35, effectively constant: 1
diff --git a/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.textual_outline.expect b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.textual_outline.expect
new file mode 100644
index 0000000..13bdbb5
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.textual_outline.expect
@@ -0,0 +1,23 @@
+import "package:expect/expect.dart";
+
+const binary = binaryFn(2, 1);
+int binaryFn(int a, int b) => a - b;
+const optional = optionalFn(2);
+const optional1 = optionalFn(2, 1);
+int optionalFn(int c, [int d = 0]) => c + d;
+const named = namedFn(2, f: 2);
+const named1 = namedFn(2);
+int namedFn(int e, {int f = 3}) => e + f;
+const type = typeFn(6);
+T typeFn<T>(T x) => x;
+const str = stringFn("str");
+String stringFn(String s) => s + "ing";
+const eq = equalFn(2, 2);
+bool equalFn(int a, int b) => a == b;
+const negative = unary(2);
+int unary(int a) => -a;
+const boolean = boolFn(true, false);
+bool boolFn(bool a, bool b) => a || b;
+const doubleResult = doubleFn(2.2, 2);
+double doubleFn(double a, double b) => a * b;
+void main() {}
diff --git a/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..a3e7b8c
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.textual_outline_modelled.expect
@@ -0,0 +1,23 @@
+import "package:expect/expect.dart";
+
+String stringFn(String s) => s + "ing";
+T typeFn<T>(T x) => x;
+bool boolFn(bool a, bool b) => a || b;
+bool equalFn(int a, int b) => a == b;
+const binary = binaryFn(2, 1);
+const boolean = boolFn(true, false);
+const doubleResult = doubleFn(2.2, 2);
+const eq = equalFn(2, 2);
+const named = namedFn(2, f: 2);
+const named1 = namedFn(2);
+const negative = unary(2);
+const optional = optionalFn(2);
+const optional1 = optionalFn(2, 1);
+const str = stringFn("str");
+const type = typeFn(6);
+double doubleFn(double a, double b) => a * b;
+int binaryFn(int a, int b) => a - b;
+int namedFn(int e, {int f = 3}) => e + f;
+int optionalFn(int c, [int d = 0]) => c + d;
+int unary(int a) => -a;
+void main() {}
diff --git a/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.weak.expect b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.weak.expect
new file mode 100644
index 0000000..977caaa
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.weak.expect
@@ -0,0 +1,63 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+import "package:expect/expect.dart" as exp;
+
+import "package:expect/expect.dart";
+
+static const field core::int binary = #C1;
+static const field core::int optional = #C2;
+static const field core::int optional1 = #C3;
+static const field core::int named = #C4;
+static const field core::int named1 = #C5;
+static const field core::int type = #C6;
+static const field core::String str = #C7;
+static const field core::bool eq = #C8;
+static const field core::int negative = #C9;
+static const field core::bool boolean = #C8;
+static const field core::double doubleResult = #C10;
+static method binaryFn(core::int a, core::int b) → core::int
+ return a.{core::num::-}(b);
+static method optionalFn(core::int c, [core::int d = #C11]) → core::int
+ return c.{core::num::+}(d);
+static method namedFn(core::int e, {core::int f = #C3}) → core::int
+ return e.{core::num::+}(f);
+static method typeFn<T extends core::Object? = dynamic>(self::typeFn::T% x) → self::typeFn::T%
+ return x;
+static method stringFn(core::String s) → core::String
+ return s.{core::String::+}("ing");
+static method equalFn(core::int a, core::int b) → core::bool
+ return a.{core::num::==}(b);
+static method unary(core::int a) → core::int
+ return a.{core::int::unary-}();
+static method boolFn(core::bool a, core::bool b) → core::bool
+ return a || b;
+static method doubleFn(core::double a, core::double b) → core::double
+ return a.{core::double::*}(b);
+static method main() → void {
+ exp::Expect::equals(#C1, 1);
+ exp::Expect::equals(#C2, 2);
+ exp::Expect::equals(#C3, 3);
+ exp::Expect::equals(#C4, 4);
+ exp::Expect::equals(#C5, 5);
+ exp::Expect::equals(#C6, 6);
+ exp::Expect::equals(#C7, "string");
+ exp::Expect::equals(#C8, true);
+ exp::Expect::equals(#C9, 2.{core::int::unary-}());
+ exp::Expect::equals(#C8, true);
+ exp::Expect::equals(#C10, 4.4);
+}
+
+constants {
+ #C1 = 1
+ #C2 = 2
+ #C3 = 3
+ #C4 = 4
+ #C5 = 5
+ #C6 = 6
+ #C7 = "string"
+ #C8 = true
+ #C9 = -2
+ #C10 = 4.4
+ #C11 = 0
+}
diff --git a/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.weak.outline.expect b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.weak.outline.expect
new file mode 100644
index 0000000..f3f61d3
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.weak.outline.expect
@@ -0,0 +1,37 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+import "package:expect/expect.dart";
+
+static const field core::int binary = self::binaryFn(2, 1);
+static const field core::int optional = self::optionalFn(2);
+static const field core::int optional1 = self::optionalFn(2, 1);
+static const field core::int named = self::namedFn(2, f: 2);
+static const field core::int named1 = self::namedFn(2);
+static const field core::int type = self::typeFn<core::int>(6);
+static const field core::String str = self::stringFn("str");
+static const field core::bool eq = self::equalFn(2, 2);
+static const field core::int negative = self::unary(2);
+static const field core::bool boolean = self::boolFn(true, false);
+static const field core::double doubleResult = self::doubleFn(2.2, 2.0);
+static method binaryFn(core::int a, core::int b) → core::int
+ ;
+static method optionalFn(core::int c, [core::int d]) → core::int
+ ;
+static method namedFn(core::int e, {core::int f}) → core::int
+ ;
+static method typeFn<T extends core::Object? = dynamic>(self::typeFn::T% x) → self::typeFn::T%
+ ;
+static method stringFn(core::String s) → core::String
+ ;
+static method equalFn(core::int a, core::int b) → core::bool
+ ;
+static method unary(core::int a) → core::int
+ ;
+static method boolFn(core::bool a, core::bool b) → core::bool
+ ;
+static method doubleFn(core::double a, core::double b) → core::double
+ ;
+static method main() → void
+ ;
diff --git a/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.weak.transformed.expect b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.weak.transformed.expect
new file mode 100644
index 0000000..920ec7f
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_simple_invocations.dart.weak.transformed.expect
@@ -0,0 +1,67 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+import "package:expect/expect.dart" as exp;
+
+import "package:expect/expect.dart";
+
+static const field core::int binary = #C1;
+static const field core::int optional = #C2;
+static const field core::int optional1 = #C3;
+static const field core::int named = #C4;
+static const field core::int named1 = #C5;
+static const field core::int type = #C6;
+static const field core::String str = #C7;
+static const field core::bool eq = #C8;
+static const field core::int negative = #C9;
+static const field core::bool boolean = #C8;
+static const field core::double doubleResult = #C10;
+static method binaryFn(core::int a, core::int b) → core::int
+ return a.{core::num::-}(b);
+static method optionalFn(core::int c, [core::int d = #C11]) → core::int
+ return c.{core::num::+}(d);
+static method namedFn(core::int e, {core::int f = #C3}) → core::int
+ return e.{core::num::+}(f);
+static method typeFn<T extends core::Object? = dynamic>(self::typeFn::T% x) → self::typeFn::T%
+ return x;
+static method stringFn(core::String s) → core::String
+ return s.{core::String::+}("ing");
+static method equalFn(core::int a, core::int b) → core::bool
+ return a.{core::num::==}(b);
+static method unary(core::int a) → core::int
+ return a.{core::int::unary-}();
+static method boolFn(core::bool a, core::bool b) → core::bool
+ return a || b;
+static method doubleFn(core::double a, core::double b) → core::double
+ return a.{core::double::*}(b);
+static method main() → void {
+ exp::Expect::equals(#C1, 1);
+ exp::Expect::equals(#C2, 2);
+ exp::Expect::equals(#C3, 3);
+ exp::Expect::equals(#C4, 4);
+ exp::Expect::equals(#C5, 5);
+ exp::Expect::equals(#C6, 6);
+ exp::Expect::equals(#C7, "string");
+ exp::Expect::equals(#C8, true);
+ exp::Expect::equals(#C9, 2.{core::int::unary-}());
+ exp::Expect::equals(#C8, true);
+ exp::Expect::equals(#C10, 4.4);
+}
+
+constants {
+ #C1 = 1
+ #C2 = 2
+ #C3 = 3
+ #C4 = 4
+ #C5 = 5
+ #C6 = 6
+ #C7 = "string"
+ #C8 = true
+ #C9 = -2
+ #C10 = 4.4
+ #C11 = 0
+}
+
+Extra constant evaluation status:
+Evaluated: MethodInvocation @ org-dartlang-testcase:///const_functions_simple_invocations.dart:47:27 -> IntConstant(-2)
+Extra constant evaluation: evaluated: 35, effectively constant: 1
diff --git a/pkg/front_end/testcases/const_functions/folder.options b/pkg/front_end/testcases/const_functions/folder.options
new file mode 100644
index 0000000..41f2c63
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/folder.options
@@ -0,0 +1 @@
+--enable-experiment=const-functions
diff --git a/runtime/lib/integers.cc b/runtime/lib/integers.cc
index e22f89c..2ea08c8 100644
--- a/runtime/lib/integers.cc
+++ b/runtime/lib/integers.cc
@@ -250,18 +250,6 @@
return ShiftOperationHelper(Token::kSHL, value, amount);
}
-DEFINE_NATIVE_ENTRY(Smi_bitAndFromSmi, 0, 2) {
- const Smi& left = Smi::CheckedHandle(zone, arguments->NativeArgAt(0));
- GET_NON_NULL_NATIVE_ARGUMENT(Smi, right, arguments->NativeArgAt(1));
- if (FLAG_trace_intrinsified_natives) {
- OS::PrintErr("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_bitNegate, 0, 1) {
const Smi& operand = Smi::CheckedHandle(zone, arguments->NativeArgAt(0));
if (FLAG_trace_intrinsified_natives) {
diff --git a/runtime/vm/bootstrap_natives.h b/runtime/vm/bootstrap_natives.h
index 2470e89..3190883 100644
--- a/runtime/vm/bootstrap_natives.h
+++ b/runtime/vm/bootstrap_natives.h
@@ -66,7 +66,6 @@
V(SendPortImpl_get_hashcode, 1) \
V(SendPortImpl_sendInternal_, 2) \
V(SendPortImpl_sendAndExitInternal_, 2) \
- V(Smi_bitAndFromSmi, 2) \
V(Smi_bitNegate, 1) \
V(Smi_bitLength, 1) \
V(Mint_bitNegate, 1) \
diff --git a/runtime/vm/compiler/asm_intrinsifier_arm.cc b/runtime/vm/compiler/asm_intrinsifier_arm.cc
index 8f5f98b..4dff2a2 100644
--- a/runtime/vm/compiler/asm_intrinsifier_arm.cc
+++ b/runtime/vm/compiler/asm_intrinsifier_arm.cc
@@ -91,8 +91,7 @@
__ b(not_smi, NE);
}
-void AsmIntrinsifier::Integer_addFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_add(Assembler* assembler, Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body); // Checks two smis.
__ adds(R0, R0, Operand(R1)); // Adds.
READS_RETURN_ADDRESS_FROM_LR(__ bx(LR, VC)); // Return if no overflow.
@@ -100,19 +99,6 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_add(Assembler* assembler, Label* normal_ir_body) {
- Integer_addFromInteger(assembler, normal_ir_body);
-}
-
-void AsmIntrinsifier::Integer_subFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
- TestBothArgumentsSmis(assembler, normal_ir_body);
- __ subs(R0, R0, Operand(R1)); // Subtract.
- READS_RETURN_ADDRESS_FROM_LR(__ bx(LR, VC)); // Return if no overflow.
- // Otherwise fall through.
- __ Bind(normal_ir_body);
-}
-
void AsmIntrinsifier::Integer_sub(Assembler* assembler, Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body);
__ subs(R0, R1, Operand(R0)); // Subtract.
@@ -121,8 +107,7 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_mulFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_mul(Assembler* assembler, Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body); // checks two smis
__ SmiUntag(R0); // Untags R0. We only want result shifted by one.
__ smull(R0, IP, R0, R1); // IP:R0 <- R0 * R1.
@@ -131,10 +116,6 @@
__ Bind(normal_ir_body); // Fall through on overflow.
}
-void AsmIntrinsifier::Integer_mul(Assembler* assembler, Label* normal_ir_body) {
- Integer_mulFromInteger(assembler, normal_ir_body);
-}
-
// Optimizations:
// - result is 0 if:
// - left is 0
@@ -189,14 +170,13 @@
// res = res + right;
// }
// }
-void AsmIntrinsifier::Integer_moduloFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_mod(Assembler* assembler, Label* normal_ir_body) {
if (!TargetCPUFeatures::can_divide()) {
return;
}
// Check to see if we have integer division
- __ ldr(R1, Address(SP, +0 * target::kWordSize));
- __ ldr(R0, Address(SP, +1 * target::kWordSize));
+ __ ldr(R0, Address(SP, +0 * target::kWordSize));
+ __ ldr(R1, Address(SP, +1 * target::kWordSize));
__ orr(TMP, R0, Operand(R1));
__ tst(TMP, Operand(kSmiTagMask));
__ b(normal_ir_body, NE);
@@ -257,8 +237,8 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitAndFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_bitAnd(Assembler* assembler,
+ Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body); // checks two smis
__ and_(R0, R0, Operand(R1));
@@ -266,13 +246,8 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitAnd(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitAndFromInteger(assembler, normal_ir_body);
-}
-
-void AsmIntrinsifier::Integer_bitOrFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_bitOr(Assembler* assembler,
+ Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body); // checks two smis
__ orr(R0, R0, Operand(R1));
@@ -280,13 +255,8 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitOr(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitOrFromInteger(assembler, normal_ir_body);
-}
-
-void AsmIntrinsifier::Integer_bitXorFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_bitXor(Assembler* assembler,
+ Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body); // checks two smis
__ eor(R0, R0, Operand(R1));
@@ -294,11 +264,6 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitXor(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitXorFromInteger(assembler, normal_ir_body);
-}
-
void AsmIntrinsifier::Integer_shl(Assembler* assembler, Label* normal_ir_body) {
ASSERT(kSmiTagShift == 1);
ASSERT(kSmiTag == 0);
@@ -428,14 +393,9 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_greaterThanFromInt(Assembler* assembler,
- Label* normal_ir_body) {
- CompareIntegers(assembler, normal_ir_body, LT);
-}
-
void AsmIntrinsifier::Integer_lessThan(Assembler* assembler,
Label* normal_ir_body) {
- Integer_greaterThanFromInt(assembler, normal_ir_body);
+ CompareIntegers(assembler, normal_ir_body, LT);
}
void AsmIntrinsifier::Integer_greaterThan(Assembler* assembler,
@@ -550,11 +510,6 @@
__ Ret();
}
-void AsmIntrinsifier::Smi_bitAndFromSmi(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitAndFromInteger(assembler, normal_ir_body);
-}
-
void AsmIntrinsifier::Bigint_lsh(Assembler* assembler, Label* normal_ir_body) {
// static void _lsh(Uint32List x_digits, int x_used, int n,
// Uint32List r_digits)
diff --git a/runtime/vm/compiler/asm_intrinsifier_arm64.cc b/runtime/vm/compiler/asm_intrinsifier_arm64.cc
index 6bef2d7..3176eea 100644
--- a/runtime/vm/compiler/asm_intrinsifier_arm64.cc
+++ b/runtime/vm/compiler/asm_intrinsifier_arm64.cc
@@ -92,8 +92,7 @@
__ BranchIfNotSmi(TMP, not_smi);
}
-void AsmIntrinsifier::Integer_addFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_add(Assembler* assembler, Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body); // Checks two smis.
#if !defined(DART_COMPRESSED_POINTERS)
__ adds(R0, R0, Operand(R1)); // Add.
@@ -107,25 +106,6 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_add(Assembler* assembler, Label* normal_ir_body) {
- Integer_addFromInteger(assembler, normal_ir_body);
-}
-
-void AsmIntrinsifier::Integer_subFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
- TestBothArgumentsSmis(assembler, normal_ir_body);
-#if !defined(DART_COMPRESSED_POINTERS)
- __ subs(R0, R0, Operand(R1)); // Subtract.
- __ b(normal_ir_body, VS); // Fall-through on overflow.
-#else
- __ subsw(R0, R0, Operand(R1)); // Subtract (32-bit).
- __ b(normal_ir_body, VS); // Fall-through on overflow.
- __ sxtw(R0, R0); // Sign extend.
-#endif
- __ ret();
- __ Bind(normal_ir_body);
-}
-
void AsmIntrinsifier::Integer_sub(Assembler* assembler, Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body);
#if !defined(DART_COMPRESSED_POINTERS)
@@ -140,8 +120,7 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_mulFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_mul(Assembler* assembler, Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body); // checks two smis
__ SmiUntag(R0); // Untags R6. We only want result shifted by one.
@@ -161,10 +140,6 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_mul(Assembler* assembler, Label* normal_ir_body) {
- Integer_mulFromInteger(assembler, normal_ir_body);
-}
-
// Optimizations:
// - result is 0 if:
// - left is 0
@@ -222,12 +197,11 @@
// res = res + right;
// }
// }
-void AsmIntrinsifier::Integer_moduloFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_mod(Assembler* assembler, Label* normal_ir_body) {
// Check to see if we have integer division
Label neg_remainder, fall_through;
- __ ldr(R1, Address(SP, +0 * target::kWordSize));
- __ ldr(R0, Address(SP, +1 * target::kWordSize));
+ __ ldr(R0, Address(SP, +0 * target::kWordSize));
+ __ ldr(R1, Address(SP, +1 * target::kWordSize));
__ orr(TMP, R0, Operand(R1));
__ BranchIfNotSmi(TMP, normal_ir_body);
// R1: Tagged left (dividend).
@@ -297,45 +271,30 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitAndFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_bitAnd(Assembler* assembler,
+ Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body); // Checks two smis.
__ and_(R0, R0, Operand(R1));
__ ret();
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitAnd(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitAndFromInteger(assembler, normal_ir_body);
-}
-
-void AsmIntrinsifier::Integer_bitOrFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_bitOr(Assembler* assembler,
+ Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body); // Checks two smis.
__ orr(R0, R0, Operand(R1));
__ ret();
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitOr(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitOrFromInteger(assembler, normal_ir_body);
-}
-
-void AsmIntrinsifier::Integer_bitXorFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_bitXor(Assembler* assembler,
+ Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body); // Checks two smis.
__ eor(R0, R0, Operand(R1));
__ ret();
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitXor(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitXorFromInteger(assembler, normal_ir_body);
-}
-
void AsmIntrinsifier::Integer_shl(Assembler* assembler, Label* normal_ir_body) {
ASSERT(kSmiTagShift == 1);
ASSERT(kSmiTag == 0);
@@ -382,14 +341,9 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_greaterThanFromInt(Assembler* assembler,
- Label* normal_ir_body) {
- CompareIntegers(assembler, normal_ir_body, LT);
-}
-
void AsmIntrinsifier::Integer_lessThan(Assembler* assembler,
Label* normal_ir_body) {
- Integer_greaterThanFromInt(assembler, normal_ir_body);
+ CompareIntegers(assembler, normal_ir_body, LT);
}
void AsmIntrinsifier::Integer_greaterThan(Assembler* assembler,
@@ -505,11 +459,6 @@
__ ret();
}
-void AsmIntrinsifier::Smi_bitAndFromSmi(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitAndFromInteger(assembler, normal_ir_body);
-}
-
void AsmIntrinsifier::Bigint_lsh(Assembler* assembler, Label* normal_ir_body) {
// static void _lsh(Uint32List x_digits, int x_used, int n,
// Uint32List r_digits)
diff --git a/runtime/vm/compiler/asm_intrinsifier_ia32.cc b/runtime/vm/compiler/asm_intrinsifier_ia32.cc
index b06895c..a6d5e20 100644
--- a/runtime/vm/compiler/asm_intrinsifier_ia32.cc
+++ b/runtime/vm/compiler/asm_intrinsifier_ia32.cc
@@ -93,8 +93,7 @@
__ j(NOT_ZERO, not_smi, Assembler::kNearJump);
}
-void AsmIntrinsifier::Integer_addFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_add(Assembler* assembler, Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body);
__ addl(EAX, Address(ESP, +2 * target::kWordSize));
__ j(OVERFLOW, normal_ir_body, Assembler::kNearJump);
@@ -103,20 +102,6 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_add(Assembler* assembler, Label* normal_ir_body) {
- Integer_addFromInteger(assembler, normal_ir_body);
-}
-
-void AsmIntrinsifier::Integer_subFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
- TestBothArgumentsSmis(assembler, normal_ir_body);
- __ subl(EAX, Address(ESP, +2 * target::kWordSize));
- __ j(OVERFLOW, normal_ir_body, Assembler::kNearJump);
- // Result is in EAX.
- __ ret();
- __ Bind(normal_ir_body);
-}
-
void AsmIntrinsifier::Integer_sub(Assembler* assembler, Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body);
__ movl(EBX, EAX);
@@ -128,8 +113,7 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_mulFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_mul(Assembler* assembler, Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body);
ASSERT(kSmiTag == 0); // Adjust code below if not the case.
__ SmiUntag(EAX);
@@ -140,10 +124,6 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_mul(Assembler* assembler, Label* normal_ir_body) {
- Integer_mulFromInteger(assembler, normal_ir_body);
-}
-
// Optimizations:
// - result is 0 if:
// - left is 0
@@ -192,11 +172,14 @@
// res = res + right;
// }
// }
-void AsmIntrinsifier::Integer_moduloFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_mod(Assembler* assembler, Label* normal_ir_body) {
Label subtract;
- TestBothArgumentsSmis(assembler, normal_ir_body);
- __ movl(EBX, Address(ESP, +2 * target::kWordSize));
+ __ movl(EAX, Address(ESP, +2 * target::kWordSize));
+ __ movl(EBX, Address(ESP, +1 * target::kWordSize));
+ __ orl(EBX, EAX);
+ __ testl(EBX, Immediate(kSmiTagMask));
+ __ j(NOT_ZERO, normal_ir_body);
+ __ movl(EBX, Address(ESP, +1 * target::kWordSize));
// EAX: Tagged left (dividend).
// EBX: Tagged right (divisor).
// Check if modulo by zero -> exception thrown in main function.
@@ -262,8 +245,8 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitAndFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_bitAnd(Assembler* assembler,
+ Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body);
__ movl(EBX, Address(ESP, +2 * target::kWordSize));
__ andl(EAX, EBX);
@@ -272,13 +255,8 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitAnd(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitAndFromInteger(assembler, normal_ir_body);
-}
-
-void AsmIntrinsifier::Integer_bitOrFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_bitOr(Assembler* assembler,
+ Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body);
__ movl(EBX, Address(ESP, +2 * target::kWordSize));
__ orl(EAX, EBX);
@@ -287,13 +265,8 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitOr(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitOrFromInteger(assembler, normal_ir_body);
-}
-
-void AsmIntrinsifier::Integer_bitXorFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_bitXor(Assembler* assembler,
+ Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body);
__ movl(EBX, Address(ESP, +2 * target::kWordSize));
__ xorl(EAX, EBX);
@@ -302,11 +275,6 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitXor(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitXorFromInteger(assembler, normal_ir_body);
-}
-
void AsmIntrinsifier::Integer_shl(Assembler* assembler, Label* normal_ir_body) {
ASSERT(kSmiTagShift == 1);
ASSERT(kSmiTag == 0);
@@ -438,14 +406,9 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_greaterThanFromInt(Assembler* assembler,
- Label* normal_ir_body) {
- CompareIntegers(assembler, normal_ir_body, LESS);
-}
-
void AsmIntrinsifier::Integer_lessThan(Assembler* assembler,
Label* normal_ir_body) {
- Integer_greaterThanFromInt(assembler, normal_ir_body);
+ CompareIntegers(assembler, normal_ir_body, LESS);
}
void AsmIntrinsifier::Integer_greaterThan(Assembler* assembler,
@@ -570,11 +533,6 @@
__ ret();
}
-void AsmIntrinsifier::Smi_bitAndFromSmi(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitAndFromInteger(assembler, normal_ir_body);
-}
-
void AsmIntrinsifier::Bigint_lsh(Assembler* assembler, Label* normal_ir_body) {
// static void _lsh(Uint32List x_digits, int x_used, int n,
// Uint32List r_digits)
diff --git a/runtime/vm/compiler/asm_intrinsifier_x64.cc b/runtime/vm/compiler/asm_intrinsifier_x64.cc
index 7df68fa..3254745 100644
--- a/runtime/vm/compiler/asm_intrinsifier_x64.cc
+++ b/runtime/vm/compiler/asm_intrinsifier_x64.cc
@@ -90,8 +90,7 @@
__ j(NOT_ZERO, not_smi);
}
-void AsmIntrinsifier::Integer_addFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_add(Assembler* assembler, Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body);
// RAX contains right argument.
#if !defined(DART_COMPRESSED_POINTERS)
@@ -107,27 +106,6 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_add(Assembler* assembler, Label* normal_ir_body) {
- Integer_addFromInteger(assembler, normal_ir_body);
-}
-
-void AsmIntrinsifier::Integer_subFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
- TestBothArgumentsSmis(assembler, normal_ir_body);
- // RAX contains right argument, which is the actual minuend of subtraction.
-#if !defined(DART_COMPRESSED_POINTERS)
- __ subq(RAX, Address(RSP, +2 * target::kWordSize));
- __ j(OVERFLOW, normal_ir_body, Assembler::kNearJump);
-#else
- __ subl(RAX, Address(RSP, +2 * target::kWordSize));
- __ j(OVERFLOW, normal_ir_body, Assembler::kNearJump);
- __ movsxd(RAX, RAX);
-#endif
- // Result is in RAX.
- __ ret();
- __ Bind(normal_ir_body);
-}
-
void AsmIntrinsifier::Integer_sub(Assembler* assembler, Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body);
// RAX contains right argument, which is the actual subtrahend of subtraction.
@@ -146,8 +124,7 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_mulFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_mul(Assembler* assembler, Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body);
// RAX is the right argument.
ASSERT(kSmiTag == 0); // Adjust code below if not the case.
@@ -165,10 +142,6 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_mul(Assembler* assembler, Label* normal_ir_body) {
- Integer_mulFromInteger(assembler, normal_ir_body);
-}
-
// Optimizations:
// - result is 0 if:
// - left is 0
@@ -245,11 +218,15 @@
// res = res + right;
// }
// }
-void AsmIntrinsifier::Integer_moduloFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_mod(Assembler* assembler, Label* normal_ir_body) {
Label negative_result;
- TestBothArgumentsSmis(assembler, normal_ir_body);
- __ movq(RCX, Address(RSP, +2 * target::kWordSize));
+
+ __ movq(RAX, Address(RSP, +2 * target::kWordSize));
+ __ movq(RCX, Address(RSP, +1 * target::kWordSize));
+ __ orq(RCX, RAX);
+ __ testq(RCX, Immediate(kSmiTagMask));
+ __ j(NOT_ZERO, normal_ir_body);
+ __ movq(RCX, Address(RSP, +1 * target::kWordSize));
// RAX: Tagged left (dividend).
// RCX: Tagged right (divisor).
__ cmpq(RCX, Immediate(0));
@@ -361,8 +338,8 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitAndFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_bitAnd(Assembler* assembler,
+ Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body);
// RAX is the right argument.
__ andq(RAX, Address(RSP, +2 * target::kWordSize));
@@ -371,13 +348,8 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitAnd(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitAndFromInteger(assembler, normal_ir_body);
-}
-
-void AsmIntrinsifier::Integer_bitOrFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_bitOr(Assembler* assembler,
+ Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body);
// RAX is the right argument.
__ orq(RAX, Address(RSP, +2 * target::kWordSize));
@@ -386,13 +358,8 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitOr(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitOrFromInteger(assembler, normal_ir_body);
-}
-
-void AsmIntrinsifier::Integer_bitXorFromInteger(Assembler* assembler,
- Label* normal_ir_body) {
+void AsmIntrinsifier::Integer_bitXor(Assembler* assembler,
+ Label* normal_ir_body) {
TestBothArgumentsSmis(assembler, normal_ir_body);
// RAX is the right argument.
__ xorq(RAX, Address(RSP, +2 * target::kWordSize));
@@ -401,11 +368,6 @@
__ Bind(normal_ir_body);
}
-void AsmIntrinsifier::Integer_bitXor(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitXorFromInteger(assembler, normal_ir_body);
-}
-
void AsmIntrinsifier::Integer_shl(Assembler* assembler, Label* normal_ir_body) {
ASSERT(kSmiTagShift == 1);
ASSERT(kSmiTag == 0);
@@ -464,11 +426,6 @@
CompareIntegers(assembler, normal_ir_body, LESS);
}
-void AsmIntrinsifier::Integer_greaterThanFromInt(Assembler* assembler,
- Label* normal_ir_body) {
- CompareIntegers(assembler, normal_ir_body, LESS);
-}
-
void AsmIntrinsifier::Integer_greaterThan(Assembler* assembler,
Label* normal_ir_body) {
CompareIntegers(assembler, normal_ir_body, GREATER);
@@ -593,11 +550,6 @@
__ ret();
}
-void AsmIntrinsifier::Smi_bitAndFromSmi(Assembler* assembler,
- Label* normal_ir_body) {
- Integer_bitAndFromInteger(assembler, normal_ir_body);
-}
-
void AsmIntrinsifier::Bigint_lsh(Assembler* assembler, Label* normal_ir_body) {
// static void _lsh(Uint32List x_digits, int x_used, int n,
// Uint32List r_digits)
diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc
index ecf74ae..441120c 100644
--- a/runtime/vm/compiler/backend/il.cc
+++ b/runtime/vm/compiler/backend/il.cc
@@ -2774,9 +2774,9 @@
case Slot::Kind::kFunction_data:
case Slot::Kind::kFunction_kind_tag:
case Slot::Kind::kFunction_packed_fields:
- case Slot::Kind::kFunction_parameter_names:
case Slot::Kind::kFunction_signature:
case Slot::Kind::kFunctionType_packed_fields:
+ case Slot::Kind::kFunctionType_parameter_names:
case Slot::Kind::kFunctionType_parameter_types:
case Slot::Kind::kFunctionType_type_parameters:
case Slot::Kind::kPointerBase_data_field:
diff --git a/runtime/vm/compiler/backend/inliner.cc b/runtime/vm/compiler/backend/inliner.cc
index 459aec0..e3e11b4 100644
--- a/runtime/vm/compiler/backend/inliner.cc
+++ b/runtime/vm/compiler/backend/inliner.cc
@@ -2764,31 +2764,6 @@
return true;
}
-static bool InlineSmiBitAndFromSmi(FlowGraph* flow_graph,
- Instruction* call,
- Definition* receiver,
- GraphEntryInstr* graph_entry,
- FunctionEntryInstr** entry,
- Instruction** last,
- Definition** result) {
- Definition* left = receiver;
- Definition* right = call->ArgumentAt(1);
-
- *entry =
- new (Z) FunctionEntryInstr(graph_entry, flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), DeoptId::kNone);
- (*entry)->InheritDeoptTarget(Z, call);
- // Right arguments is known to be smi: other._bitAndFromSmi(this);
- BinarySmiOpInstr* smi_op =
- new (Z) BinarySmiOpInstr(Token::kBIT_AND, new (Z) Value(left),
- new (Z) Value(right), call->deopt_id());
- flow_graph->AppendTo(*entry, smi_op, call->env(), FlowGraph::kValue);
- *last = smi_op;
- *result = smi_op->AsDefinition();
-
- return true;
-}
-
static bool InlineGrowableArraySetter(FlowGraph* flow_graph,
const Slot& field,
StoreBarrierType store_barrier_type,
@@ -3969,9 +3944,6 @@
return InlineGrowableArraySetter(
flow_graph, Slot::GrowableObjectArray_length(), kNoStoreBarrier, call,
receiver, graph_entry, entry, last, result);
- case MethodRecognizer::kSmi_bitAndFromSmi:
- return InlineSmiBitAndFromSmi(flow_graph, call, receiver, graph_entry,
- entry, last, result);
case MethodRecognizer::kFloat32x4Abs:
case MethodRecognizer::kFloat32x4Clamp:
diff --git a/runtime/vm/compiler/backend/range_analysis.cc b/runtime/vm/compiler/backend/range_analysis.cc
index 5f0ebc3..cac72cc 100644
--- a/runtime/vm/compiler/backend/range_analysis.cc
+++ b/runtime/vm/compiler/backend/range_analysis.cc
@@ -2799,7 +2799,7 @@
case Slot::Kind::kClosureData_default_type_arguments:
case Slot::Kind::kFunction_data:
case Slot::Kind::kFunction_signature:
- case Slot::Kind::kFunction_parameter_names:
+ case Slot::Kind::kFunctionType_parameter_names:
case Slot::Kind::kFunctionType_parameter_types:
case Slot::Kind::kFunctionType_type_parameters:
case Slot::Kind::kPointerBase_data_field:
diff --git a/runtime/vm/compiler/backend/slot.h b/runtime/vm/compiler/backend/slot.h
index 1b554c5..3a2a1cd 100644
--- a/runtime/vm/compiler/backend/slot.h
+++ b/runtime/vm/compiler/backend/slot.h
@@ -85,7 +85,7 @@
V(Closure, UntaggedClosure, hash, Context, VAR) \
V(ClosureData, UntaggedClosureData, default_type_arguments_info, Smi, FINAL) \
V(Function, UntaggedFunction, data, Dynamic, FINAL) \
- V(Function, UntaggedFunction, parameter_names, Array, FINAL) \
+ V(FunctionType, UntaggedFunctionType, parameter_names, Array, FINAL) \
V(FunctionType, UntaggedFunctionType, parameter_types, Array, FINAL) \
V(GrowableObjectArray, UntaggedGrowableObjectArray, length, Smi, VAR) \
V(GrowableObjectArray, UntaggedGrowableObjectArray, data, Array, VAR) \
diff --git a/runtime/vm/compiler/frontend/kernel_to_il.cc b/runtime/vm/compiler/frontend/kernel_to_il.cc
index abaedc1..db41553 100644
--- a/runtime/vm/compiler/frontend/kernel_to_il.cc
+++ b/runtime/vm/compiler/frontend/kernel_to_il.cc
@@ -2087,7 +2087,7 @@
// Set up by BuildDynamicCallChecks() when needed. These values are
// read-only, so they don't need real local variables and are created
// using MakeTemporary().
- LocalVariable* function = nullptr;
+ LocalVariable* signature = nullptr;
LocalVariable* num_fixed_params = nullptr;
LocalVariable* num_opt_params = nullptr;
LocalVariable* num_max_params = nullptr;
@@ -2657,16 +2657,19 @@
Fragment body;
body += LoadLocal(info.closure);
body += LoadNativeField(Slot::Closure_function());
- info.function = MakeTemporary("function");
+ body += LoadNativeField(Slot::Function_signature());
+ info.signature = MakeTemporary("signature");
- body += LoadLocal(info.function);
+ body += LoadLocal(info.signature);
body += BuildExtractUnboxedSlotBitFieldIntoSmi<
- Function::PackedNumFixedParameters>(Slot::Function_packed_fields());
+ FunctionType::PackedNumFixedParameters>(
+ Slot::FunctionType_packed_fields());
info.num_fixed_params = MakeTemporary("num_fixed_params");
- body += LoadLocal(info.function);
+ body += LoadLocal(info.signature);
body += BuildExtractUnboxedSlotBitFieldIntoSmi<
- Function::PackedNumOptionalParameters>(Slot::Function_packed_fields());
+ FunctionType::PackedNumOptionalParameters>(
+ Slot::FunctionType_packed_fields());
info.num_opt_params = MakeTemporary("num_opt_params");
body += LoadLocal(info.num_fixed_params);
@@ -2674,26 +2677,24 @@
body += SmiBinaryOp(Token::kADD);
info.num_max_params = MakeTemporary("num_max_params");
- body += LoadLocal(info.function);
+ body += LoadLocal(info.signature);
body += BuildExtractUnboxedSlotBitFieldIntoSmi<
- Function::PackedHasNamedOptionalParameters>(
- Slot::Function_packed_fields());
+ FunctionType::PackedHasNamedOptionalParameters>(
+ Slot::FunctionType_packed_fields());
body += IntConstant(0);
body += StrictCompare(Token::kNE_STRICT);
info.has_named_params = MakeTemporary("has_named_params");
- body += LoadLocal(info.function);
- body += LoadNativeField(Slot::Function_parameter_names());
+ body += LoadLocal(info.signature);
+ body += LoadNativeField(Slot::FunctionType_parameter_names());
info.parameter_names = MakeTemporary("parameter_names");
- body += LoadLocal(info.function);
- body += LoadNativeField(Slot::Function_signature());
+ body += LoadLocal(info.signature);
body += LoadNativeField(Slot::FunctionType_parameter_types());
info.parameter_types = MakeTemporary("parameter_types");
- body += LoadLocal(info.function);
- body += LoadNativeField(Slot::Function_signature());
+ body += LoadLocal(info.signature);
body += LoadNativeField(Slot::FunctionType_type_parameters());
info.type_parameters = MakeTemporary("type_parameters");
@@ -2722,7 +2723,8 @@
// full set of function type arguments, then check the local function type
// arguments against the closure function's type parameter bounds.
Fragment generic;
- generic += LoadLocal(info.function);
+ generic += LoadLocal(info.closure);
+ generic += LoadNativeField(Slot::Closure_function());
generic += LoadNativeField(Slot::Function_data());
info.closure_data = MakeTemporary("closure_data");
generic += LoadLocal(info.closure_data);
@@ -2788,7 +2790,7 @@
body += DropTemporary(&info.num_max_params);
body += DropTemporary(&info.num_opt_params);
body += DropTemporary(&info.num_fixed_params);
- body += DropTemporary(&info.function);
+ body += DropTemporary(&info.signature);
return body;
}
diff --git a/runtime/vm/compiler/recognized_methods_list.h b/runtime/vm/compiler/recognized_methods_list.h
index 74ebc7c..c53fc34 100644
--- a/runtime/vm/compiler/recognized_methods_list.h
+++ b/runtime/vm/compiler/recognized_methods_list.h
@@ -204,7 +204,6 @@
#define CORE_LIB_INTRINSIC_LIST(V) \
V(_Smi, ~, Smi_bitNegate, 0x8254f51b) \
V(_Smi, get:bitLength, Smi_bitLength, 0x7ab50ceb) \
- V(_Smi, _bitAndFromSmi, Smi_bitAndFromSmi, 0xaf07a450) \
V(_BigIntImpl, _lsh, Bigint_lsh, 0x3f8b105e) \
V(_BigIntImpl, _rsh, Bigint_rsh, 0x117ed3f3) \
V(_BigIntImpl, _absAdd, Bigint_absAdd, 0xd55235d1) \
@@ -254,30 +253,15 @@
V(::, _setHash, Object_setHash, 0x8f2a5b0b) \
#define CORE_INTEGER_LIB_INTRINSIC_LIST(V) \
- V(_IntegerImplementation, _addFromInteger, Integer_addFromInteger, \
- 0x2f20e46b) \
V(_IntegerImplementation, +, Integer_add, 0xd561008f) \
- V(_IntegerImplementation, _subFromInteger, Integer_subFromInteger, \
- 0xf571525f) \
V(_IntegerImplementation, -, Integer_sub, 0xc96a0f80) \
- V(_IntegerImplementation, _mulFromInteger, Integer_mulFromInteger, \
- 0xfcd889fe) \
V(_IntegerImplementation, *, Integer_mul, 0xacd9641d) \
- V(_IntegerImplementation, _moduloFromInteger, Integer_moduloFromInteger, \
- 0x23d96e8b) \
+ V(_IntegerImplementation, %, Integer_mod, 0xfcf7cc13) \
V(_IntegerImplementation, ~/, Integer_truncDivide, 0xdda49e7f) \
V(_IntegerImplementation, unary-, Integer_negate, 0xf7a9a696) \
- V(_IntegerImplementation, _bitAndFromInteger, Integer_bitAndFromInteger, \
- 0x1f4a948f) \
V(_IntegerImplementation, &, Integer_bitAnd, 0x8b9d7c33) \
- V(_IntegerImplementation, _bitOrFromInteger, Integer_bitOrFromInteger, \
- 0x10d87167) \
V(_IntegerImplementation, |, Integer_bitOr, 0x8f47f5eb) \
- V(_IntegerImplementation, _bitXorFromInteger, Integer_bitXorFromInteger, \
- 0x0218412b) \
V(_IntegerImplementation, ^, Integer_bitXor, 0xd838bef2) \
- V(_IntegerImplementation, _greaterThanFromInteger, \
- Integer_greaterThanFromInt, 0x6aa24b23) \
V(_IntegerImplementation, >, Integer_greaterThan, 0x402b12df) \
V(_IntegerImplementation, ==, Integer_equal, 0x509c9146) \
V(_IntegerImplementation, _equalToInteger, Integer_equalToInteger, \
diff --git a/runtime/vm/compiler/runtime_api.h b/runtime/vm/compiler/runtime_api.h
index bfc1343..3c934f6 100644
--- a/runtime/vm/compiler/runtime_api.h
+++ b/runtime/vm/compiler/runtime_api.h
@@ -506,7 +506,6 @@
static word entry_point_offset(CodeEntryKind kind = CodeEntryKind::kNormal);
static word kind_tag_offset();
static word packed_fields_offset();
- static word parameter_names_offset();
static word signature_offset();
static word usage_counter_offset();
static word InstanceSize();
@@ -683,6 +682,7 @@
static word hash_offset();
static word type_state_offset();
static word packed_fields_offset();
+ static word parameter_names_offset();
static word parameter_types_offset();
static word type_parameters_offset();
static word nullability_offset();
diff --git a/runtime/vm/compiler/runtime_offsets_extracted.h b/runtime/vm/compiler/runtime_offsets_extracted.h
index 00bcf67..318cf08 100644
--- a/runtime/vm/compiler/runtime_offsets_extracted.h
+++ b/runtime/vm/compiler/runtime_offsets_extracted.h
@@ -145,8 +145,6 @@
static constexpr dart::compiler::target::word Function_kind_tag_offset = 64;
static constexpr dart::compiler::target::word Function_packed_fields_offset =
68;
-static constexpr dart::compiler::target::word Function_parameter_names_offset =
- 20;
static constexpr dart::compiler::target::word Function_signature_offset = 24;
static constexpr dart::compiler::target::word FutureOr_type_arguments_offset =
4;
@@ -404,6 +402,8 @@
static constexpr dart::compiler::target::word
FunctionType_parameter_types_offset = 20;
static constexpr dart::compiler::target::word
+ FunctionType_parameter_names_offset = 24;
+static constexpr dart::compiler::target::word
FunctionType_type_parameters_offset = 12;
static constexpr dart::compiler::target::word
TypeParameter_parameterized_class_id_offset = 28;
@@ -679,8 +679,6 @@
static constexpr dart::compiler::target::word Function_kind_tag_offset = 104;
static constexpr dart::compiler::target::word Function_packed_fields_offset =
108;
-static constexpr dart::compiler::target::word Function_parameter_names_offset =
- 40;
static constexpr dart::compiler::target::word Function_signature_offset = 48;
static constexpr dart::compiler::target::word FutureOr_type_arguments_offset =
8;
@@ -943,6 +941,8 @@
static constexpr dart::compiler::target::word
FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
TypeParameter_parameterized_class_id_offset = 56;
@@ -1218,8 +1218,6 @@
static constexpr dart::compiler::target::word Function_kind_tag_offset = 64;
static constexpr dart::compiler::target::word Function_packed_fields_offset =
68;
-static constexpr dart::compiler::target::word Function_parameter_names_offset =
- 20;
static constexpr dart::compiler::target::word Function_signature_offset = 24;
static constexpr dart::compiler::target::word FutureOr_type_arguments_offset =
4;
@@ -1477,6 +1475,8 @@
static constexpr dart::compiler::target::word
FunctionType_parameter_types_offset = 20;
static constexpr dart::compiler::target::word
+ FunctionType_parameter_names_offset = 24;
+static constexpr dart::compiler::target::word
FunctionType_type_parameters_offset = 12;
static constexpr dart::compiler::target::word
TypeParameter_parameterized_class_id_offset = 28;
@@ -1749,8 +1749,6 @@
static constexpr dart::compiler::target::word Function_kind_tag_offset = 104;
static constexpr dart::compiler::target::word Function_packed_fields_offset =
108;
-static constexpr dart::compiler::target::word Function_parameter_names_offset =
- 40;
static constexpr dart::compiler::target::word Function_signature_offset = 48;
static constexpr dart::compiler::target::word FutureOr_type_arguments_offset =
8;
@@ -2013,6 +2011,8 @@
static constexpr dart::compiler::target::word
FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
TypeParameter_parameterized_class_id_offset = 56;
@@ -2289,8 +2289,6 @@
static constexpr dart::compiler::target::word Function_kind_tag_offset = 104;
static constexpr dart::compiler::target::word Function_packed_fields_offset =
108;
-static constexpr dart::compiler::target::word Function_parameter_names_offset =
- 40;
static constexpr dart::compiler::target::word Function_signature_offset = 48;
static constexpr dart::compiler::target::word FutureOr_type_arguments_offset =
8;
@@ -2553,6 +2551,8 @@
static constexpr dart::compiler::target::word
FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
TypeParameter_parameterized_class_id_offset = 56;
@@ -2828,8 +2828,6 @@
static constexpr dart::compiler::target::word Function_kind_tag_offset = 104;
static constexpr dart::compiler::target::word Function_packed_fields_offset =
108;
-static constexpr dart::compiler::target::word Function_parameter_names_offset =
- 40;
static constexpr dart::compiler::target::word Function_signature_offset = 48;
static constexpr dart::compiler::target::word FutureOr_type_arguments_offset =
8;
@@ -3092,6 +3090,8 @@
static constexpr dart::compiler::target::word
FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
TypeParameter_parameterized_class_id_offset = 56;
@@ -3368,8 +3368,6 @@
static constexpr dart::compiler::target::word Function_kind_tag_offset = 64;
static constexpr dart::compiler::target::word Function_packed_fields_offset =
68;
-static constexpr dart::compiler::target::word Function_parameter_names_offset =
- 20;
static constexpr dart::compiler::target::word Function_signature_offset = 24;
static constexpr dart::compiler::target::word FutureOr_type_arguments_offset =
4;
@@ -3626,6 +3624,8 @@
static constexpr dart::compiler::target::word
FunctionType_parameter_types_offset = 20;
static constexpr dart::compiler::target::word
+ FunctionType_parameter_names_offset = 24;
+static constexpr dart::compiler::target::word
FunctionType_type_parameters_offset = 12;
static constexpr dart::compiler::target::word
TypeParameter_parameterized_class_id_offset = 28;
@@ -3896,8 +3896,6 @@
static constexpr dart::compiler::target::word Function_kind_tag_offset = 104;
static constexpr dart::compiler::target::word Function_packed_fields_offset =
108;
-static constexpr dart::compiler::target::word Function_parameter_names_offset =
- 40;
static constexpr dart::compiler::target::word Function_signature_offset = 48;
static constexpr dart::compiler::target::word FutureOr_type_arguments_offset =
8;
@@ -4159,6 +4157,8 @@
static constexpr dart::compiler::target::word
FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
TypeParameter_parameterized_class_id_offset = 56;
@@ -4429,8 +4429,6 @@
static constexpr dart::compiler::target::word Function_kind_tag_offset = 64;
static constexpr dart::compiler::target::word Function_packed_fields_offset =
68;
-static constexpr dart::compiler::target::word Function_parameter_names_offset =
- 20;
static constexpr dart::compiler::target::word Function_signature_offset = 24;
static constexpr dart::compiler::target::word FutureOr_type_arguments_offset =
4;
@@ -4687,6 +4685,8 @@
static constexpr dart::compiler::target::word
FunctionType_parameter_types_offset = 20;
static constexpr dart::compiler::target::word
+ FunctionType_parameter_names_offset = 24;
+static constexpr dart::compiler::target::word
FunctionType_type_parameters_offset = 12;
static constexpr dart::compiler::target::word
TypeParameter_parameterized_class_id_offset = 28;
@@ -4954,8 +4954,6 @@
static constexpr dart::compiler::target::word Function_kind_tag_offset = 104;
static constexpr dart::compiler::target::word Function_packed_fields_offset =
108;
-static constexpr dart::compiler::target::word Function_parameter_names_offset =
- 40;
static constexpr dart::compiler::target::word Function_signature_offset = 48;
static constexpr dart::compiler::target::word FutureOr_type_arguments_offset =
8;
@@ -5217,6 +5215,8 @@
static constexpr dart::compiler::target::word
FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
TypeParameter_parameterized_class_id_offset = 56;
@@ -5488,8 +5488,6 @@
static constexpr dart::compiler::target::word Function_kind_tag_offset = 104;
static constexpr dart::compiler::target::word Function_packed_fields_offset =
108;
-static constexpr dart::compiler::target::word Function_parameter_names_offset =
- 40;
static constexpr dart::compiler::target::word Function_signature_offset = 48;
static constexpr dart::compiler::target::word FutureOr_type_arguments_offset =
8;
@@ -5751,6 +5749,8 @@
static constexpr dart::compiler::target::word
FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
TypeParameter_parameterized_class_id_offset = 56;
@@ -6021,8 +6021,6 @@
static constexpr dart::compiler::target::word Function_kind_tag_offset = 104;
static constexpr dart::compiler::target::word Function_packed_fields_offset =
108;
-static constexpr dart::compiler::target::word Function_parameter_names_offset =
- 40;
static constexpr dart::compiler::target::word Function_signature_offset = 48;
static constexpr dart::compiler::target::word FutureOr_type_arguments_offset =
8;
@@ -6284,6 +6282,8 @@
static constexpr dart::compiler::target::word
FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
TypeParameter_parameterized_class_id_offset = 56;
@@ -6563,8 +6563,6 @@
static constexpr dart::compiler::target::word AOT_Function_kind_tag_offset = 40;
static constexpr dart::compiler::target::word
AOT_Function_packed_fields_offset = 44;
-static constexpr dart::compiler::target::word
- AOT_Function_parameter_names_offset = 20;
static constexpr dart::compiler::target::word AOT_Function_signature_offset =
24;
static constexpr dart::compiler::target::word
@@ -6854,6 +6852,8 @@
static constexpr dart::compiler::target::word
AOT_FunctionType_parameter_types_offset = 20;
static constexpr dart::compiler::target::word
+ AOT_FunctionType_parameter_names_offset = 24;
+static constexpr dart::compiler::target::word
AOT_FunctionType_type_parameters_offset = 12;
static constexpr dart::compiler::target::word
AOT_TypeParameter_parameterized_class_id_offset = 28;
@@ -7158,8 +7158,6 @@
static constexpr dart::compiler::target::word AOT_Function_kind_tag_offset = 80;
static constexpr dart::compiler::target::word
AOT_Function_packed_fields_offset = 84;
-static constexpr dart::compiler::target::word
- AOT_Function_parameter_names_offset = 40;
static constexpr dart::compiler::target::word AOT_Function_signature_offset =
48;
static constexpr dart::compiler::target::word
@@ -7450,6 +7448,8 @@
static constexpr dart::compiler::target::word
AOT_FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ AOT_FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
AOT_FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
AOT_TypeParameter_parameterized_class_id_offset = 56;
@@ -7759,8 +7759,6 @@
static constexpr dart::compiler::target::word AOT_Function_kind_tag_offset = 80;
static constexpr dart::compiler::target::word
AOT_Function_packed_fields_offset = 84;
-static constexpr dart::compiler::target::word
- AOT_Function_parameter_names_offset = 40;
static constexpr dart::compiler::target::word AOT_Function_signature_offset =
48;
static constexpr dart::compiler::target::word
@@ -8051,6 +8049,8 @@
static constexpr dart::compiler::target::word
AOT_FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ AOT_FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
AOT_FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
AOT_TypeParameter_parameterized_class_id_offset = 56;
@@ -8358,8 +8358,6 @@
static constexpr dart::compiler::target::word AOT_Function_kind_tag_offset = 80;
static constexpr dart::compiler::target::word
AOT_Function_packed_fields_offset = 84;
-static constexpr dart::compiler::target::word
- AOT_Function_parameter_names_offset = 40;
static constexpr dart::compiler::target::word AOT_Function_signature_offset =
48;
static constexpr dart::compiler::target::word
@@ -8650,6 +8648,8 @@
static constexpr dart::compiler::target::word
AOT_FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ AOT_FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
AOT_FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
AOT_TypeParameter_parameterized_class_id_offset = 56;
@@ -8956,8 +8956,6 @@
static constexpr dart::compiler::target::word AOT_Function_kind_tag_offset = 80;
static constexpr dart::compiler::target::word
AOT_Function_packed_fields_offset = 84;
-static constexpr dart::compiler::target::word
- AOT_Function_parameter_names_offset = 40;
static constexpr dart::compiler::target::word AOT_Function_signature_offset =
48;
static constexpr dart::compiler::target::word
@@ -9248,6 +9246,8 @@
static constexpr dart::compiler::target::word
AOT_FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ AOT_FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
AOT_FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
AOT_TypeParameter_parameterized_class_id_offset = 56;
@@ -9554,8 +9554,6 @@
static constexpr dart::compiler::target::word AOT_Function_kind_tag_offset = 40;
static constexpr dart::compiler::target::word
AOT_Function_packed_fields_offset = 44;
-static constexpr dart::compiler::target::word
- AOT_Function_parameter_names_offset = 20;
static constexpr dart::compiler::target::word AOT_Function_signature_offset =
24;
static constexpr dart::compiler::target::word
@@ -9843,6 +9841,8 @@
static constexpr dart::compiler::target::word
AOT_FunctionType_parameter_types_offset = 20;
static constexpr dart::compiler::target::word
+ AOT_FunctionType_parameter_names_offset = 24;
+static constexpr dart::compiler::target::word
AOT_FunctionType_type_parameters_offset = 12;
static constexpr dart::compiler::target::word
AOT_TypeParameter_parameterized_class_id_offset = 28;
@@ -10142,8 +10142,6 @@
static constexpr dart::compiler::target::word AOT_Function_kind_tag_offset = 80;
static constexpr dart::compiler::target::word
AOT_Function_packed_fields_offset = 84;
-static constexpr dart::compiler::target::word
- AOT_Function_parameter_names_offset = 40;
static constexpr dart::compiler::target::word AOT_Function_signature_offset =
48;
static constexpr dart::compiler::target::word
@@ -10432,6 +10430,8 @@
static constexpr dart::compiler::target::word
AOT_FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ AOT_FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
AOT_FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
AOT_TypeParameter_parameterized_class_id_offset = 56;
@@ -10736,8 +10736,6 @@
static constexpr dart::compiler::target::word AOT_Function_kind_tag_offset = 80;
static constexpr dart::compiler::target::word
AOT_Function_packed_fields_offset = 84;
-static constexpr dart::compiler::target::word
- AOT_Function_parameter_names_offset = 40;
static constexpr dart::compiler::target::word AOT_Function_signature_offset =
48;
static constexpr dart::compiler::target::word
@@ -11026,6 +11024,8 @@
static constexpr dart::compiler::target::word
AOT_FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ AOT_FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
AOT_FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
AOT_TypeParameter_parameterized_class_id_offset = 56;
@@ -11328,8 +11328,6 @@
static constexpr dart::compiler::target::word AOT_Function_kind_tag_offset = 80;
static constexpr dart::compiler::target::word
AOT_Function_packed_fields_offset = 84;
-static constexpr dart::compiler::target::word
- AOT_Function_parameter_names_offset = 40;
static constexpr dart::compiler::target::word AOT_Function_signature_offset =
48;
static constexpr dart::compiler::target::word
@@ -11618,6 +11616,8 @@
static constexpr dart::compiler::target::word
AOT_FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ AOT_FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
AOT_FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
AOT_TypeParameter_parameterized_class_id_offset = 56;
@@ -11919,8 +11919,6 @@
static constexpr dart::compiler::target::word AOT_Function_kind_tag_offset = 80;
static constexpr dart::compiler::target::word
AOT_Function_packed_fields_offset = 84;
-static constexpr dart::compiler::target::word
- AOT_Function_parameter_names_offset = 40;
static constexpr dart::compiler::target::word AOT_Function_signature_offset =
48;
static constexpr dart::compiler::target::word
@@ -12209,6 +12207,8 @@
static constexpr dart::compiler::target::word
AOT_FunctionType_parameter_types_offset = 40;
static constexpr dart::compiler::target::word
+ AOT_FunctionType_parameter_names_offset = 48;
+static constexpr dart::compiler::target::word
AOT_FunctionType_type_parameters_offset = 24;
static constexpr dart::compiler::target::word
AOT_TypeParameter_parameterized_class_id_offset = 56;
diff --git a/runtime/vm/compiler/runtime_offsets_list.h b/runtime/vm/compiler/runtime_offsets_list.h
index e249228..e708265 100644
--- a/runtime/vm/compiler/runtime_offsets_list.h
+++ b/runtime/vm/compiler/runtime_offsets_list.h
@@ -113,7 +113,6 @@
CodeEntryKind::kUnchecked, [](CodeEntryKind value) { return true; }) \
FIELD(Function, kind_tag_offset) \
FIELD(Function, packed_fields_offset) \
- FIELD(Function, parameter_names_offset) \
FIELD(Function, signature_offset) \
FIELD(FutureOr, type_arguments_offset) \
FIELD(GrowableObjectArray, data_offset) \
@@ -271,6 +270,7 @@
FIELD(FunctionType, hash_offset) \
FIELD(FunctionType, packed_fields_offset) \
FIELD(FunctionType, parameter_types_offset) \
+ FIELD(FunctionType, parameter_names_offset) \
FIELD(FunctionType, type_parameters_offset) \
FIELD(TypeParameter, parameterized_class_id_offset) \
FIELD(TypeParameter, index_offset) \
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 17187ee..326cc5b 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -2554,9 +2554,6 @@
StringPtr ParameterNameAt(intptr_t index) const;
ArrayPtr parameter_names() const { return untag()->parameter_names(); }
void SetParameterNamesFrom(const FunctionType& signature) const;
- static intptr_t parameter_names_offset() {
- return OFFSET_OF(UntaggedFunction, parameter_names_);
- }
// The required flags are stored at the end of the parameter_names. The flags
// are packed into SMIs, but omitted if they're 0.
@@ -2932,13 +2929,6 @@
// Returns the size of the source for this function.
intptr_t SourceSize() const;
- // Reexported so they can be used by the flow graph builders.
- using PackedHasNamedOptionalParameters =
- UntaggedFunction::PackedHasNamedOptionalParameters;
- using PackedNumFixedParameters = UntaggedFunction::PackedNumFixedParameters;
- using PackedNumOptionalParameters =
- UntaggedFunction::PackedNumOptionalParameters;
-
uint32_t packed_fields() const { return untag()->packed_fields_; }
void set_packed_fields(uint32_t packed_fields) const;
static intptr_t packed_fields_offset() {
@@ -8121,6 +8111,14 @@
return OFFSET_OF(UntaggedFunctionType, packed_fields_);
}
+ // Reexported so they can be used by the flow graph builders.
+ using PackedHasNamedOptionalParameters =
+ UntaggedFunctionType::PackedHasNamedOptionalParameters;
+ using PackedNumFixedParameters =
+ UntaggedFunctionType::PackedNumFixedParameters;
+ using PackedNumOptionalParameters =
+ UntaggedFunctionType::PackedNumOptionalParameters;
+
AbstractTypePtr result_type() const { return untag()->result_type(); }
void set_result_type(const AbstractType& value) const;
@@ -8145,6 +8143,9 @@
void SetParameterNameAt(intptr_t index, const String& value) const;
ArrayPtr parameter_names() const { return untag()->parameter_names(); }
void set_parameter_names(const Array& value) const;
+ static intptr_t parameter_names_offset() {
+ return OFFSET_OF(UntaggedFunctionType, parameter_names_);
+ }
// The required flags are stored at the end of the parameter_names. The flags
// are packed into SMIs, but omitted if they're 0.
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 160185c..21fe968 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -1147,7 +1147,6 @@
// TODO(regis): Split packed_fields_ in 2 uint32_t if max values are too low.
- // Keep in sync with corresponding constants in UntaggedFunctionType.
static constexpr intptr_t kMaxOptimizableBits = 1;
static constexpr intptr_t kMaxBackgroundOptimizableBits = 1;
static constexpr intptr_t kMaxTypeParametersBits = 7;
@@ -1184,10 +1183,6 @@
static_assert(PackedNumOptionalParameters::kNextBit <=
kBitsPerByte * sizeof(decltype(packed_fields_)),
"UntaggedFunction::packed_fields_ bitfields don't fit.");
- static_assert(PackedNumOptionalParameters::kNextBit <=
- compiler::target::kSmiBits,
- "In-place mask for number of optional parameters cannot fit in "
- "a Smi on the target architecture");
#define JIT_FUNCTION_COUNTERS(F) \
F(intptr_t, int32_t, usage_counter) \
@@ -1205,6 +1200,8 @@
#undef DECLARE
#endif // !defined(DART_PRECOMPILED_RUNTIME)
+
+ friend class UntaggedFunctionType; // To use same constants for packing.
};
class UntaggedClosureData : public UntaggedObject {
@@ -2340,28 +2337,30 @@
uint8_t type_state_;
uint8_t nullability_;
- // Keep in sync with corresponding constants in UntaggedFunction.
static constexpr intptr_t kMaxParentTypeArgumentsBits = 8;
- static constexpr intptr_t kMaxHasNamedOptionalParametersBits = 1;
static constexpr intptr_t kMaxImplicitParametersBits = 1;
- static constexpr intptr_t kMaxFixedParametersBits = 10;
- static constexpr intptr_t kMaxOptionalParametersBits = 10;
+ static constexpr intptr_t kMaxHasNamedOptionalParametersBits =
+ UntaggedFunction::kMaxHasNamedOptionalParametersBits;
+ static constexpr intptr_t kMaxFixedParametersBits =
+ UntaggedFunction::kMaxFixedParametersBits;
+ static constexpr intptr_t kMaxOptionalParametersBits =
+ UntaggedFunction::kMaxOptionalParametersBits;
typedef BitField<uint32_t, uint8_t, 0, kMaxParentTypeArgumentsBits>
PackedNumParentTypeArguments;
typedef BitField<uint32_t,
- bool,
- PackedNumParentTypeArguments::kNextBit,
- kMaxHasNamedOptionalParametersBits>
- PackedHasNamedOptionalParameters;
- typedef BitField<uint32_t,
uint8_t,
- PackedHasNamedOptionalParameters::kNextBit,
+ PackedNumParentTypeArguments::kNextBit,
kMaxImplicitParametersBits>
PackedNumImplicitParameters;
typedef BitField<uint32_t,
- uint16_t,
+ bool,
PackedNumImplicitParameters::kNextBit,
+ kMaxHasNamedOptionalParametersBits>
+ PackedHasNamedOptionalParameters;
+ typedef BitField<uint32_t,
+ uint16_t,
+ PackedHasNamedOptionalParameters::kNextBit,
kMaxFixedParametersBits>
PackedNumFixedParameters;
typedef BitField<uint32_t,
@@ -2372,6 +2371,10 @@
static_assert(PackedNumOptionalParameters::kNextBit <=
kBitsPerByte * sizeof(decltype(packed_fields_)),
"UntaggedFunctionType::packed_fields_ bitfields don't fit.");
+ static_assert(PackedNumOptionalParameters::kNextBit <=
+ compiler::target::kSmiBits,
+ "In-place mask for number of optional parameters cannot fit in "
+ "a Smi on the target architecture");
ObjectPtr* to_snapshot(Snapshot::Kind kind) { return to(); }
diff --git a/sdk/lib/_internal/vm/lib/integers.dart b/sdk/lib/_internal/vm/lib/integers.dart
index aefb957..123c964 100644
--- a/sdk/lib/_internal/vm/lib/integers.dart
+++ b/sdk/lib/_internal/vm/lib/integers.dart
@@ -32,7 +32,9 @@
return this.toDouble() / other.toDouble();
}
+ @pragma("vm:recognized", "asm-intrinsic")
@pragma("vm:non-nullable-result-type")
+ @pragma("vm:never-inline")
num operator %(num other) {
if ((other is int) && (other == 0)) {
throw const IntegerDivisionByZeroException();
@@ -67,14 +69,9 @@
}
@pragma("vm:non-nullable-result-type")
- int _bitAndFromSmi(_Smi other) native "Integer_bitAndFromInteger";
- @pragma("vm:recognized", "asm-intrinsic")
- @pragma("vm:non-nullable-result-type")
int _bitAndFromInteger(int other) native "Integer_bitAndFromInteger";
- @pragma("vm:recognized", "asm-intrinsic")
@pragma("vm:non-nullable-result-type")
int _bitOrFromInteger(int other) native "Integer_bitOrFromInteger";
- @pragma("vm:recognized", "asm-intrinsic")
@pragma("vm:non-nullable-result-type")
int _bitXorFromInteger(int other) native "Integer_bitXorFromInteger";
@pragma("vm:non-nullable-result-type")
@@ -83,18 +80,14 @@
int _ushrFromInteger(int other) native "Integer_ushrFromInteger";
@pragma("vm:non-nullable-result-type")
int _shlFromInteger(int other) native "Integer_shlFromInteger";
- @pragma("vm:recognized", "asm-intrinsic")
@pragma("vm:non-nullable-result-type")
int _addFromInteger(int other) native "Integer_addFromInteger";
- @pragma("vm:recognized", "asm-intrinsic")
@pragma("vm:non-nullable-result-type")
int _subFromInteger(int other) native "Integer_subFromInteger";
- @pragma("vm:recognized", "asm-intrinsic")
@pragma("vm:non-nullable-result-type")
int _mulFromInteger(int other) native "Integer_mulFromInteger";
@pragma("vm:non-nullable-result-type")
int _truncDivFromInteger(int other) native "Integer_truncDivFromInteger";
- @pragma("vm:recognized", "asm-intrinsic")
@pragma("vm:non-nullable-result-type")
int _moduloFromInteger(int other) native "Integer_moduloFromInteger";
int _remainderFromInteger(int other) {
@@ -142,7 +135,6 @@
return (this == other) || (this < other);
}
- @pragma("vm:recognized", "asm-intrinsic")
@pragma("vm:exact-result-type", bool)
bool _greaterThanFromInteger(int other)
native "Integer_greaterThanFromInteger";
@@ -555,12 +547,6 @@
@pragma("vm:exact-result-type", "dart:core#_Smi")
int get bitLength native "Smi_bitLength";
- int operator &(int other) => other._bitAndFromSmi(this);
-
- @pragma("vm:recognized", "asm-intrinsic")
- @pragma("vm:exact-result-type", "dart:core#_Smi")
- int _bitAndFromSmi(_Smi other) native "Smi_bitAndFromSmi";
-
/**
* The digits of '00', '01', ... '99' as a single array.
*
@@ -766,6 +752,4 @@
int operator ~() native "Mint_bitNegate";
@pragma("vm:exact-result-type", "dart:core#_Smi")
int get bitLength native "Mint_bitLength";
-
- int _bitAndFromSmi(_Smi other) => _bitAndFromInteger(other);
}
diff --git a/sdk/lib/ffi/struct.dart b/sdk/lib/ffi/struct.dart
index 37fa93c..283d04c 100644
--- a/sdk/lib/ffi/struct.dart
+++ b/sdk/lib/ffi/struct.dart
@@ -58,10 +58,3 @@
Struct._fromPointer(this._addressOf);
}
-
-/// Extension on [Struct] specialized for its subtypes.
-extension StructAddressOf<T extends Struct> on T {
- /// Returns the address backing the reference.
- @Deprecated('Hold on to the pointer backing a struct instead.')
- Pointer<T> get addressOf => _addressOf as Pointer<T>;
-}
diff --git a/tests/ffi/structs_nnbd_workaround_test.dart b/tests/ffi/structs_nnbd_workaround_test.dart
index cf8f672..635c877 100644
--- a/tests/ffi/structs_nnbd_workaround_test.dart
+++ b/tests/ffi/structs_nnbd_workaround_test.dart
@@ -98,8 +98,6 @@
final pointer = calloc<Coordinate>();
Coordinate c = pointer.ref;
Expect.isTrue(c is Struct);
- // TODO(https://dartbug.com/40667): Remove support for this.
- Expect.isTrue(c.addressOf is Pointer<Coordinate>);
calloc.free(pointer);
}
diff --git a/tests/ffi/structs_test.dart b/tests/ffi/structs_test.dart
index 18448c0..cf37d16 100644
--- a/tests/ffi/structs_test.dart
+++ b/tests/ffi/structs_test.dart
@@ -128,8 +128,6 @@
final pointer = calloc<Coordinate>();
Coordinate c = pointer.ref;
Expect.isTrue(c is Struct);
- // TODO(https://dartbug.com/40667): Remove support for this.
- Expect.isTrue(c.addressOf is Pointer<Coordinate>);
calloc.free(pointer);
}
diff --git a/tests/ffi_2/structs_test.dart b/tests/ffi_2/structs_test.dart
index 18448c0..cf37d16 100644
--- a/tests/ffi_2/structs_test.dart
+++ b/tests/ffi_2/structs_test.dart
@@ -128,8 +128,6 @@
final pointer = calloc<Coordinate>();
Coordinate c = pointer.ref;
Expect.isTrue(c is Struct);
- // TODO(https://dartbug.com/40667): Remove support for this.
- Expect.isTrue(c.addressOf is Pointer<Coordinate>);
calloc.free(pointer);
}
diff --git a/tools/VERSION b/tools/VERSION
index f121dd3..d8acf1f 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 13
PATCH 0
-PRERELEASE 91
+PRERELEASE 92
PRERELEASE_PATCH 0
\ No newline at end of file