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

Unified Diff: runtime/vm/intermediate_language_arm.cc

Issue 23757016: Simplify compilation of relational operators. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_arm.cc
===================================================================
--- runtime/vm/intermediate_language_arm.cc (revision 27045)
+++ runtime/vm/intermediate_language_arm.cc (working copy)
@@ -848,25 +848,18 @@
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(Location::RequiresRegister());
return summary;
- } else if (operation_cid() == kSmiCid) {
- LocationSummary* summary =
- new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
- summary->set_in(0, Location::RegisterOrConstant(left()));
- // Only one input can be a constant operand. The case of two constant
- // operands should be handled by constant propagation.
- summary->set_in(1, summary->in(0).IsConstant()
- ? Location::RequiresRegister()
- : Location::RegisterOrConstant(right()));
- summary->set_out(Location::RequiresRegister());
- return summary;
}
- LocationSummary* locs =
- new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
- // Pick arbitrary fixed input registers because this is a call.
- locs->set_in(0, Location::RegisterLocation(R0));
- locs->set_in(1, Location::RegisterLocation(R1));
- locs->set_out(Location::RegisterLocation(R0));
- return locs;
+ ASSERT(operation_cid() == kSmiCid);
+ LocationSummary* summary =
+ new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ summary->set_in(0, Location::RegisterOrConstant(left()));
+ // Only one input can be a constant operand. The case of two constant
+ // operands should be handled by constant propagation.
+ summary->set_in(1, summary->in(0).IsConstant()
+ ? Location::RequiresRegister()
+ : Location::RegisterOrConstant(right()));
+ summary->set_out(Location::RequiresRegister());
+ return summary;
}
@@ -879,70 +872,8 @@
EmitUnboxedMintComparisonOp(compiler, *locs(), kind(), NULL);
return;
}
- if (operation_cid() == kDoubleCid) {
- EmitDoubleComparisonOp(compiler, *locs(), kind(), NULL);
- return;
- }
-
- // Push arguments for the call.
- // TODO(fschneider): Split this instruction into different types to avoid
- // explicitly pushing arguments to the call here.
- Register left = locs()->in(0).reg();
- Register right = locs()->in(1).reg();
- __ Push(left);
- __ Push(right);
- if (HasICData() && (ic_data()->NumberOfChecks() > 0)) {
- Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptRelationalOp);
- // Load class into R2. Since this is a call, any register except
- // the fixed input registers would be ok.
- ASSERT((left != R2) && (right != R2));
- const intptr_t kNumArguments = 2;
- LoadValueCid(compiler, R2, left);
- compiler->EmitTestAndCall(ICData::Handle(ic_data()->AsUnaryClassChecks()),
- R2, // Class id register.
- kNumArguments,
- Object::null_array(), // No named arguments.
- deopt, // Deoptimize target.
- deopt_id(),
- token_pos(),
- locs());
- return;
- }
- const String& function_name =
- String::ZoneHandle(Symbols::New(Token::Str(kind())));
- if (!compiler->is_optimizing()) {
- compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
- deopt_id(),
- token_pos());
- }
- const intptr_t kNumArguments = 2;
- const intptr_t kNumArgsChecked = 2; // Type-feedback.
- ICData& relational_ic_data = ICData::ZoneHandle(ic_data()->raw());
- if (compiler->is_optimizing() && FLAG_propagate_ic_data) {
- ASSERT(!ic_data()->IsNull());
- if (ic_data()->NumberOfChecks() == 0) {
- // IC call for reoptimization populates original ICData.
- relational_ic_data = ic_data()->raw();
- } else {
- // Megamorphic call.
- relational_ic_data = ic_data()->AsUnaryClassChecks();
- }
- } else {
- const Array& arguments_descriptor =
- Array::Handle(ArgumentsDescriptor::New(kNumArguments,
- Object::null_array()));
- relational_ic_data = ICData::New(compiler->parsed_function().function(),
- function_name,
- arguments_descriptor,
- deopt_id(),
- kNumArgsChecked);
- }
- compiler->GenerateInstanceCall(deopt_id(),
- token_pos(),
- kNumArguments,
- Object::null_array(), // No optional args.
- locs(),
- relational_ic_data);
+ ASSERT(operation_cid() == kDoubleCid);
+ EmitDoubleComparisonOp(compiler, *locs(), kind(), NULL);
}
@@ -956,13 +887,8 @@
EmitUnboxedMintComparisonOp(compiler, *locs(), kind(), branch);
return;
}
- if (operation_cid() == kDoubleCid) {
- EmitDoubleComparisonOp(compiler, *locs(), kind(), branch);
- return;
- }
- EmitNativeCode(compiler);
- __ CompareObject(R0, Bool::True());
- branch->EmitBranchOnCondition(compiler, EQ);
+ ASSERT(operation_cid() == kDoubleCid);
+ EmitDoubleComparisonOp(compiler, *locs(), kind(), branch);
}
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698