| OLD | NEW |
| 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/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 5890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5901 __ BranchIfNotSmi(value, deopt); | 5901 __ BranchIfNotSmi(value, deopt); |
| 5902 } | 5902 } |
| 5903 | 5903 |
| 5904 | 5904 |
| 5905 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone, | 5905 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone, |
| 5906 bool opt) const { | 5906 bool opt) const { |
| 5907 const intptr_t kNumInputs = 1; | 5907 const intptr_t kNumInputs = 1; |
| 5908 const intptr_t kNumTemps = 0; | 5908 const intptr_t kNumTemps = 0; |
| 5909 LocationSummary* summary = new (zone) | 5909 LocationSummary* summary = new (zone) |
| 5910 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5910 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5911 summary->set_in(0, Location::RequiresRegister()); | 5911 summary->set_in(0, cids_.IsSingleCid() ? Location::RequiresRegister() |
| 5912 : Location::WritableRegister()); |
| 5912 return summary; | 5913 return summary; |
| 5913 } | 5914 } |
| 5914 | 5915 |
| 5915 | 5916 |
| 5916 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5917 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5917 Register value = locs()->in(0).reg(); | 5918 Register value = locs()->in(0).reg(); |
| 5918 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass); | 5919 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass); |
| 5919 __ CompareImmediate(value, Immediate(Smi::RawValue(cid_))); | 5920 if (cids_.IsSingleCid()) { |
| 5920 __ j(NOT_ZERO, deopt); | 5921 __ CompareImmediate(value, Immediate(Smi::RawValue(cids_.cid_start))); |
| 5922 __ j(NOT_ZERO, deopt); |
| 5923 } else { |
| 5924 __ AddImmediate(value, Immediate(-Smi::RawValue(cids_.cid_start))); |
| 5925 __ cmpq(value, Immediate(Smi::RawValue(cids_.Extent()))); |
| 5926 __ j(ABOVE, deopt); |
| 5927 } |
| 5921 } | 5928 } |
| 5922 | 5929 |
| 5923 | 5930 |
| 5924 LocationSummary* GenericCheckBoundInstr::MakeLocationSummary(Zone* zone, | 5931 LocationSummary* GenericCheckBoundInstr::MakeLocationSummary(Zone* zone, |
| 5925 bool opt) const { | 5932 bool opt) const { |
| 5926 const intptr_t kNumInputs = 2; | 5933 const intptr_t kNumInputs = 2; |
| 5927 const intptr_t kNumTemps = 0; | 5934 const intptr_t kNumTemps = 0; |
| 5928 LocationSummary* locs = new (zone) LocationSummary( | 5935 LocationSummary* locs = new (zone) LocationSummary( |
| 5929 zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); | 5936 zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); |
| 5930 locs->set_in(kLengthPos, Location::RequiresRegister()); | 5937 locs->set_in(kLengthPos, Location::RequiresRegister()); |
| (...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6790 __ Drop(1); | 6797 __ Drop(1); |
| 6791 __ popq(result); | 6798 __ popq(result); |
| 6792 } | 6799 } |
| 6793 | 6800 |
| 6794 | 6801 |
| 6795 } // namespace dart | 6802 } // namespace dart |
| 6796 | 6803 |
| 6797 #undef __ | 6804 #undef __ |
| 6798 | 6805 |
| 6799 #endif // defined TARGET_ARCH_X64 | 6806 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |