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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 475563002: Inline Int32x4 constructor (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 7f3796df6c3c9f172b6ecfe2a1c340eb4cba2898..252aa4aa0b375037309d35a82e4b70fdfbf4400f 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -612,6 +612,10 @@ void FlowGraphOptimizer::InsertConversion(Representation from,
converted = new(I) UnboxedIntConverterInstr(from, to, use->CopyWithType());
} else if ((from == kUnboxedUint32) && (to == kUnboxedMint)) {
converted = new(I) UnboxedIntConverterInstr(from, to, use->CopyWithType());
+ } else if ((from == kTagged) && (to == kUnboxedUint32)) {
+ const intptr_t deopt_id = (deopt_target != NULL) ?
+ deopt_target->DeoptimizationTarget() : Isolate::kNoDeoptId;
+ converted = new UnboxUint32Instr(use->CopyWithType(), deopt_id);
} else if (from == kUnboxedMint && to == kUnboxedDouble) {
ASSERT(CanUnboxDouble());
// Convert by boxing/unboxing.
@@ -3233,6 +3237,16 @@ bool FlowGraphOptimizer::TryInlineInt32x4Constructor(
new(I) Value(call->ArgumentAt(1)), call->deopt_id());
ReplaceCall(call, cast);
return true;
+ } else if (recognized_kind == MethodRecognizer::kInt32x4Constructor) {
+ Int32x4ConstructorInstr* con =
+ new(I) Int32x4ConstructorInstr(
+ new(I) Value(call->ArgumentAt(1)),
+ new(I) Value(call->ArgumentAt(2)),
+ new(I) Value(call->ArgumentAt(3)),
+ new(I) Value(call->ArgumentAt(4)),
+ call->deopt_id());
+ ReplaceCall(call, con);
+ return true;
}
return false;
}
@@ -4275,7 +4289,8 @@ void FlowGraphOptimizer::VisitStaticCall(StaticCallInstr* call) {
(recognized_kind == MethodRecognizer::kFloat64x2Splat) ||
(recognized_kind == MethodRecognizer::kFloat64x2FromFloat32x4)) {
TryInlineFloat64x2Constructor(call, recognized_kind);
- } else if (recognized_kind == MethodRecognizer::kInt32x4BoolConstructor) {
+ } else if ((recognized_kind == MethodRecognizer::kInt32x4BoolConstructor) ||
+ (recognized_kind == MethodRecognizer::kInt32x4Constructor)) {
TryInlineInt32x4Constructor(call, recognized_kind);
} else if (recognized_kind == MethodRecognizer::kObjectConstructor) {
// Remove the original push arguments.
@@ -8098,6 +8113,12 @@ void ConstantPropagator::VisitFloat32x4ToInt32x4(
}
+void ConstantPropagator::VisitInt32x4Constructor(
+ Int32x4ConstructorInstr* instr) {
+ SetValue(instr, non_constant_);
+}
+
+
void ConstantPropagator::VisitInt32x4BoolConstructor(
Int32x4BoolConstructorInstr* instr) {
SetValue(instr, non_constant_);

Powered by Google App Engine
This is Rietveld 408576698