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

Unified Diff: pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart

Issue 2395243008: Revert "dart2js: Constant fold num.round()" (Closed)
Patch Set: Created 4 years, 2 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/ssa/invoke_dynamic_specializers.dart
diff --git a/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart b/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
index 8bcca400dc94960fa7d885c62b801651f2c6362b..463c31cfcd2009aff40c5abe25a0efda59d616c4 100644
--- a/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
+++ b/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
@@ -34,12 +34,6 @@ class InvokeDynamicSpecializer {
return null;
}
- void clearAllSideEffects(HInstruction instruction) {
- instruction.sideEffects.clearAllSideEffects();
- instruction.sideEffects.clearAllDependencies();
- instruction.setUseGvn();
- }
-
Operation operation(ConstantSystem constantSystem) => null;
static InvokeDynamicSpecializer lookupSpecializer(Selector selector) {
@@ -91,11 +85,6 @@ class InvokeDynamicSpecializer {
return const CodeUnitAtSpecializer();
}
}
- if (selector.argumentCount == 0 && selector.namedArguments.length == 0) {
- if (selector.name == 'round') {
- return const RoundSpecializer();
- }
- }
}
return const InvokeDynamicSpecializer();
}
@@ -230,6 +219,12 @@ abstract class BinaryArithmeticSpecializer extends InvokeDynamicSpecializer {
return null;
}
+ void clearAllSideEffects(HInstruction instruction) {
+ instruction.sideEffects.clearAllSideEffects();
+ instruction.sideEffects.clearAllDependencies();
+ instruction.setUseGvn();
+ }
+
bool inputsArePositiveIntegers(HInstruction instruction, Compiler compiler) {
HInstruction left = instruction.inputs[1];
HInstruction right = instruction.inputs[2];
@@ -764,22 +759,3 @@ class CodeUnitAtSpecializer extends InvokeDynamicSpecializer {
return null;
}
}
-
-class RoundSpecializer extends InvokeDynamicSpecializer {
- const RoundSpecializer();
-
- UnaryOperation operation(ConstantSystem constantSystem) {
- return constantSystem.round;
- }
-
- HInstruction tryConvertToBuiltin(
- HInvokeDynamic instruction, Compiler compiler) {
- HInstruction receiver = instruction.getDartReceiver(compiler);
- if (receiver.isNumberOrNull(compiler)) {
- // Even if there is no builtin equivalent instruction, we know the
- // instruction does not have any side effect, and that it can be GVN'ed.
- clearAllSideEffects(instruction);
- }
- return null;
- }
-}

Powered by Google App Engine
This is Rietveld 408576698