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

Side by Side Diff: runtime/vm/intermediate_language_x64.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, 10 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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 4703 matching lines...) Expand 10 before | Expand all | Expand 10 after
4714 4714
4715 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4715 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4716 Register value = locs()->in(0).reg(); 4716 Register value = locs()->in(0).reg();
4717 Label* deopt = compiler->AddDeoptStub(deopt_id(), 4717 Label* deopt = compiler->AddDeoptStub(deopt_id(),
4718 kDeoptCheckSmi); 4718 kDeoptCheckSmi);
4719 __ testq(value, Immediate(kSmiTagMask)); 4719 __ testq(value, Immediate(kSmiTagMask));
4720 __ j(NOT_ZERO, deopt); 4720 __ j(NOT_ZERO, deopt);
4721 } 4721 }
4722 4722
4723 4723
4724 LocationSummary* CheckClassIdInstr::MakeLocationSummary(bool opt) const {
4725 const intptr_t kNumInputs = 2;
4726 const intptr_t kNumTemps = 0;
4727 LocationSummary* summary =
4728 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
4729 summary->set_in(0, Location::RequiresRegister());
4730 summary->set_in(1, Location::RegisterOrSmiConstant(right()));
4731 return summary;
4732 }
4733
4734
4735 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4736 Register left = locs()->in(0).reg();
4737 Location right = locs()->in(1);
4738 Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptCheckClass);
4739 if (right.IsRegister()) {
4740 __ cmpq(left, right.reg());
4741 } else {
4742 ASSERT(right.IsConstant());
4743 const Object& right_const = Smi::Cast(right.constant());
4744 __ CompareImmediate(
4745 left, Immediate(reinterpret_cast<int64_t>(right_const.raw())), PP);
4746 }
4747 __ j(NOT_ZERO, deopt);
4748 }
4749
4750
4724 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(bool opt) const { 4751 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(bool opt) const {
4725 const intptr_t kNumInputs = 2; 4752 const intptr_t kNumInputs = 2;
4726 const intptr_t kNumTemps = 0; 4753 const intptr_t kNumTemps = 0;
4727 LocationSummary* locs = 4754 LocationSummary* locs =
4728 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 4755 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
4729 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); 4756 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length()));
4730 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); 4757 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index()));
4731 return locs; 4758 return locs;
4732 } 4759 }
4733 4760
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
5090 PcDescriptors::kOther, 5117 PcDescriptors::kOther,
5091 locs()); 5118 locs());
5092 __ Drop(2); // Discard type arguments and receiver. 5119 __ Drop(2); // Discard type arguments and receiver.
5093 } 5120 }
5094 5121
5095 } // namespace dart 5122 } // namespace dart
5096 5123
5097 #undef __ 5124 #undef __
5098 5125
5099 #endif // defined TARGET_ARCH_X64 5126 #endif // defined TARGET_ARCH_X64
OLDNEW
« runtime/vm/intermediate_language.h ('K') | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698