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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 11031024: Remove now unused BinaryMintOp from the IL. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 13112)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -1751,110 +1751,6 @@
}
-LocationSummary* BinaryMintOpInstr::MakeLocationSummary() const {
- const intptr_t kNumInputs = 2;
- ASSERT(op_kind() == Token::kBIT_AND);
- const intptr_t kNumTemps = 1;
- LocationSummary* summary =
- new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
- summary->set_in(0, Location::RegisterLocation(EAX));
- summary->set_in(1, Location::RegisterLocation(ECX));
- summary->set_temp(0, Location::RegisterLocation(EDX));
- summary->set_out(Location::RegisterLocation(EAX));
- return summary;
-}
-
-
-void BinaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- // TODO(regis): For now, we only support Token::kBIT_AND for a Mint or Smi
- // receiver and a Mint or Smi argument. We fall back to the run time call if
- // both receiver and argument are Mint or if one of them is Mint and the other
- // is a negative Smi.
- Register left = locs()->in(0).reg();
- Register right = locs()->in(1).reg();
- Register result = locs()->out().reg();
- Register temp = locs()->temp(0).reg();
- ASSERT(left == result);
- ASSERT(op_kind() == Token::kBIT_AND);
- Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(),
- kDeoptBinaryMintOp);
- Label mint_static_call, smi_static_call, non_smi, smi_smi, done;
- __ testl(left, Immediate(kSmiTagMask)); // Is receiver Smi?
- __ j(NOT_ZERO, &non_smi);
- __ testl(right, Immediate(kSmiTagMask)); // Is argument Smi?
- __ j(ZERO, &smi_smi);
- __ CompareClassId(right, kMintCid, temp); // Is argument Mint?
- __ j(NOT_EQUAL, deopt); // Argument neither Smi nor Mint.
- __ cmpl(left, Immediate(0));
- __ j(LESS, &smi_static_call); // Negative Smi receiver, Mint argument.
-
- // Positive Smi receiver, Mint argument.
- // Load lower argument Mint word, convert to Smi. It is OK to loose bits.
- __ movl(right, FieldAddress(right, Mint::value_offset()));
- __ SmiTag(right);
- __ andl(result, right);
- __ jmp(&done);
-
- __ Bind(&non_smi); // Receiver is non-Smi.
- __ CompareClassId(left, kMintCid, temp); // Is receiver Mint?
- __ j(NOT_EQUAL, deopt); // Receiver neither Smi nor Mint.
- __ testl(right, Immediate(kSmiTagMask)); // Is argument Smi?
- __ j(NOT_ZERO, &mint_static_call); // Mint receiver, non-Smi argument.
- __ cmpl(right, Immediate(0));
- __ j(LESS, &mint_static_call); // Mint receiver, negative Smi argument.
-
- // Mint receiver, positive Smi argument.
- // Load lower receiver Mint word, convert to Smi. It is OK to loose bits.
- __ movl(result, FieldAddress(left, Mint::value_offset()));
- __ SmiTag(result);
- __ Bind(&smi_smi);
- __ andl(result, right);
- __ jmp(&done);
-
- __ Bind(&smi_static_call);
- {
- Function& target = Function::ZoneHandle(
- ic_data()->GetTargetForReceiverClassId(kSmiCid));
- if (target.IsNull()) {
- __ jmp(deopt);
- } else {
- __ pushl(left);
- __ pushl(right);
- compiler->GenerateStaticCall(
- instance_call()->deopt_id(),
- instance_call()->token_pos(),
- target,
- instance_call()->ArgumentCount(),
- instance_call()->argument_names(),
- locs());
- ASSERT(result == EAX);
- __ jmp(&done);
- }
- }
-
- __ Bind(&mint_static_call);
- {
- Function& target = Function::ZoneHandle(
- ic_data()->GetTargetForReceiverClassId(kMintCid));
- if (target.IsNull()) {
- __ jmp(deopt);
- } else {
- __ pushl(left);
- __ pushl(right);
- compiler->GenerateStaticCall(
- instance_call()->deopt_id(),
- instance_call()->token_pos(),
- target,
- instance_call()->ArgumentCount(),
- instance_call()->argument_names(),
- locs());
- ASSERT(result == EAX);
- }
- }
- __ Bind(&done);
-}
-
-
LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary() const {
ASSERT((left()->ResultCid() != kDoubleCid) &&
(right()->ResultCid() != kDoubleCid));
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698