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

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
Index: runtime/vm/flow_graph_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index a0213884b4657d42d88cb9d361926481944e29a1..d8e56bdce1ceaa6e460b8f49f0c4efa8dece7e7a 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)),
srdjan 2013/04/22 22:28:18 indent of 4 chars
Cutch 2013/04/22 23:05:41 Done.
+ 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);
}
@@ -4502,6 +4532,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)) {

Powered by Google App Engine
This is Rietveld 408576698