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

Side by Side Diff: runtime/vm/intermediate_language_arm.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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
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 4676 matching lines...) Expand 10 before | Expand all | Expand 10 after
4687 4687
4688 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4688 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4689 Register value = locs()->in(0).reg(); 4689 Register value = locs()->in(0).reg();
4690 Label* deopt = compiler->AddDeoptStub(deopt_id(), 4690 Label* deopt = compiler->AddDeoptStub(deopt_id(),
4691 kDeoptCheckSmi); 4691 kDeoptCheckSmi);
4692 __ tst(value, ShifterOperand(kSmiTagMask)); 4692 __ tst(value, ShifterOperand(kSmiTagMask));
4693 __ b(deopt, NE); 4693 __ b(deopt, NE);
4694 } 4694 }
4695 4695
4696 4696
4697 LocationSummary* CheckClassIdInstr::MakeLocationSummary(bool opt) const {
4698 const intptr_t kNumInputs = 2;
4699 const intptr_t kNumTemps = 0;
4700 LocationSummary* summary =
4701 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
4702 summary->set_in(0, Location::RequiresRegister());
4703 summary->set_in(1, Location::RegisterOrSmiConstant(right()));
4704 return summary;
4705 }
4706
4707
4708 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4709 Register left = locs()->in(0).reg();
4710 Location right = locs()->in(1);
4711 Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptCheckClass);
4712 if (right.IsRegister()) {
4713 __ cmp(left, ShifterOperand(right.reg()));
4714 } else {
4715 ASSERT(right.IsConstant());
4716 const Object& right_const = Smi::Cast(right.constant());
4717 __ CompareImmediate(left, reinterpret_cast<int32_t>(right_const.raw()));
4718 }
4719 __ b(deopt, NE);
4720 }
4721
4722
4697 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(bool opt) const { 4723 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(bool opt) const {
4698 const intptr_t kNumInputs = 2; 4724 const intptr_t kNumInputs = 2;
4699 const intptr_t kNumTemps = 0; 4725 const intptr_t kNumTemps = 0;
4700 LocationSummary* locs = 4726 LocationSummary* locs =
4701 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 4727 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
4702 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); 4728 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length()));
4703 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); 4729 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index()));
4704 return locs; 4730 return locs;
4705 } 4731 }
4706 4732
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
5019 compiler->GenerateCall(token_pos(), 5045 compiler->GenerateCall(token_pos(),
5020 &label, 5046 &label,
5021 PcDescriptors::kOther, 5047 PcDescriptors::kOther,
5022 locs()); 5048 locs());
5023 __ Drop(2); // Discard type arguments and receiver. 5049 __ Drop(2); // Discard type arguments and receiver.
5024 } 5050 }
5025 5051
5026 } // namespace dart 5052 } // namespace dart
5027 5053
5028 #endif // defined TARGET_ARCH_ARM 5054 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698