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

Side by Side Diff: runtime/vm/intermediate_language_mips.cc

Issue 181183004: VM: Improve receiver class check in polymorphic inlining. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: improved polymorphic ClassCheck ia32 Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 3845 matching lines...) Expand 10 before | Expand all | Expand 10 after
3856 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3856 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3857 __ TraceSimMsg("CheckSmiInstr"); 3857 __ TraceSimMsg("CheckSmiInstr");
3858 Register value = locs()->in(0).reg(); 3858 Register value = locs()->in(0).reg();
3859 Label* deopt = compiler->AddDeoptStub(deopt_id(), 3859 Label* deopt = compiler->AddDeoptStub(deopt_id(),
3860 kDeoptCheckSmi); 3860 kDeoptCheckSmi);
3861 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); 3861 __ andi(CMPRES1, value, Immediate(kSmiTagMask));
3862 __ bne(CMPRES1, ZR, deopt); 3862 __ bne(CMPRES1, ZR, deopt);
3863 } 3863 }
3864 3864
3865 3865
3866 LocationSummary* CheckClassIdInstr::MakeLocationSummary(bool opt) const {
3867 const intptr_t kNumInputs = 2;
3868 const intptr_t kNumTemps = 0;
3869 LocationSummary* summary =
3870 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
3871 summary->set_in(0, Location::RequiresRegister());
3872 summary->set_in(1, Location::RegisterOrSmiConstant(right()));
3873 return summary;
3874 }
3875
3876
3877 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3878 Register left = locs()->in(0).reg();
3879 Location right = locs()->in(1);
3880 Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptCheckClass);
3881 if (right.IsRegister()) {
3882 __ bne(left, right.reg(), deopt);
3883 } else {
3884 ASSERT(right.IsConstant());
3885 const Object& right_const = Smi::Cast(right.constant());
3886 __ BranchNotEqual(left,
3887 reinterpret_cast<int32_t>(right_const.raw()),
3888 deopt);
3889 }
3890 }
3891
3892
3866 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(bool opt) const { 3893 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(bool opt) const {
3867 const intptr_t kNumInputs = 2; 3894 const intptr_t kNumInputs = 2;
3868 const intptr_t kNumTemps = 0; 3895 const intptr_t kNumTemps = 0;
3869 LocationSummary* locs = 3896 LocationSummary* locs =
3870 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3897 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
3871 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); 3898 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length()));
3872 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); 3899 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index()));
3873 return locs; 3900 return locs;
3874 } 3901 }
3875 3902
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
4201 compiler->GenerateCall(token_pos(), 4228 compiler->GenerateCall(token_pos(),
4202 &label, 4229 &label,
4203 PcDescriptors::kOther, 4230 PcDescriptors::kOther,
4204 locs()); 4231 locs());
4205 __ Drop(2); // Discard type arguments and receiver. 4232 __ Drop(2); // Discard type arguments and receiver.
4206 } 4233 }
4207 4234
4208 } // namespace dart 4235 } // namespace dart
4209 4236
4210 #endif // defined TARGET_ARCH_MIPS 4237 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698