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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 13872020: Inline Float32x4 Getters (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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/vm/flow_graph_optimizer.h ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 5bfbea4f793df924e7a2523aa072b14a57d3cb49..35dc377d8caf71108332c906bcde1700fb414ac7 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -1393,6 +1393,23 @@ static intptr_t OffsetForLengthGetter(MethodRecognizer::Kind kind) {
}
+bool FlowGraphOptimizer::InlineFloat32x4Getter(InstanceCallInstr* call,
+ MethodRecognizer::Kind getter) {
+ AddCheckClass(call->ArgumentAt(0),
+ ICData::ZoneHandle(
+ call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+ call->deopt_id(),
+ call->env(),
+ call);
+ Float32x4ShuffleInstr* instr = new Float32x4ShuffleInstr(
+ getter,
+ new Value(call->ArgumentAt(0)),
+ call);
+ ReplaceCall(call, instr);
+ return true;
+}
+
+
// Only unique implicit instance getters can be currently handled.
bool FlowGraphOptimizer::TryInlineInstanceGetter(InstanceCallInstr* call) {
ASSERT(call->HasICData());
@@ -1454,6 +1471,19 @@ bool FlowGraphOptimizer::TryInlineInstanceGetter(InstanceCallInstr* call) {
}
InlineStringIsEmptyGetter(call);
return true;
+ case MethodRecognizer::kFloat32x4ShuffleXXXX:
+ case MethodRecognizer::kFloat32x4ShuffleYYYY:
+ case MethodRecognizer::kFloat32x4ShuffleZZZZ:
+ case MethodRecognizer::kFloat32x4ShuffleWWWW:
+ case MethodRecognizer::kFloat32x4ShuffleX:
+ case MethodRecognizer::kFloat32x4ShuffleY:
+ case MethodRecognizer::kFloat32x4ShuffleZ:
+ case MethodRecognizer::kFloat32x4ShuffleW:
+ if (!ic_data.HasReceiverClassId(kFloat32x4Cid) ||
+ !ic_data.HasOneTarget()) {
+ return false;
+ }
+ return InlineFloat32x4Getter(call, recognized_kind);
default:
ASSERT(recognized_kind == MethodRecognizer::kUnknown);
}
@@ -4699,6 +4729,11 @@ void ConstantPropagator::VisitBinaryFloat32x4Op(
}
+void ConstantPropagator::VisitFloat32x4Shuffle(Float32x4ShuffleInstr* instr) {
+ SetValue(instr, non_constant_);
+}
+
+
void ConstantPropagator::VisitMathSqrt(MathSqrtInstr* instr) {
const Object& value = instr->value()->definition()->constant_value();
if (IsNonConstant(value)) {
« no previous file with comments | « runtime/vm/flow_graph_optimizer.h ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698