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

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

Issue 2955073005: VM-codegen: Add IL instruction to check if a Smi is in a constant range
Patch Set: Created 3 years, 5 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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 5811 matching lines...) Expand 10 before | Expand all | Expand 10 after
5822 Operand offset_opr = (offset()->definition()->representation() == kTagged) 5822 Operand offset_opr = (offset()->definition()->representation() == kTagged)
5823 ? Operand(offset_reg, ASR, kSmiTagSize) 5823 ? Operand(offset_reg, ASR, kSmiTagSize)
5824 : Operand(offset_reg); 5824 : Operand(offset_reg);
5825 __ add(target_address_reg, target_address_reg, offset_opr); 5825 __ add(target_address_reg, target_address_reg, offset_opr);
5826 5826
5827 // Jump to the absolute address. 5827 // Jump to the absolute address.
5828 __ br(target_address_reg); 5828 __ br(target_address_reg);
5829 } 5829 }
5830 5830
5831 5831
5832 LocationSummary* SmiRangeComparisonInstr::MakeLocationSummary(Zone* zone,
5833 bool opt) const {
5834 const intptr_t kNumInputs = 1;
5835 const intptr_t kNumTemps = 0;
5836 LocationSummary* locs = new (zone)
5837 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5838 locs->set_in(0, Location::RequiresRegister());
5839 return locs;
5840 }
5841
5842
5843 Condition SmiRangeComparisonInstr::EmitComparisonCode(
5844 FlowGraphCompiler* compiler,
5845 BranchLabels labels) {
5846 Register in = locs()->in(0).reg();
5847 __ sub(TMP, in, Operand(Smi::RawValue(from_)));
5848 __ cmp(TMP, Operand(Smi::RawValue(to_ - from_)));
5849 return is_negated_ ? HI : LS;
5850 }
5851
5852
5832 LocationSummary* StrictCompareInstr::MakeLocationSummary(Zone* zone, 5853 LocationSummary* StrictCompareInstr::MakeLocationSummary(Zone* zone,
5833 bool opt) const { 5854 bool opt) const {
5834 const intptr_t kNumInputs = 2; 5855 const intptr_t kNumInputs = 2;
5835 const intptr_t kNumTemps = 0; 5856 const intptr_t kNumTemps = 0;
5836 if (needs_number_check()) { 5857 if (needs_number_check()) {
5837 LocationSummary* locs = new (zone) 5858 LocationSummary* locs = new (zone)
5838 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); 5859 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
5839 locs->set_in(0, Location::RegisterLocation(R0)); 5860 locs->set_in(0, Location::RegisterLocation(R0));
5840 locs->set_in(1, Location::RegisterLocation(R1)); 5861 locs->set_in(1, Location::RegisterLocation(R1));
5841 locs->set_out(0, Location::RegisterLocation(R0)); 5862 locs->set_out(0, Location::RegisterLocation(R0));
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
5949 ASSERT(!compiler->is_optimizing()); 5970 ASSERT(!compiler->is_optimizing());
5950 __ BranchLinkPatchable(*StubCode::DebugStepCheck_entry()); 5971 __ BranchLinkPatchable(*StubCode::DebugStepCheck_entry());
5951 compiler->AddCurrentDescriptor(stub_kind_, deopt_id_, token_pos()); 5972 compiler->AddCurrentDescriptor(stub_kind_, deopt_id_, token_pos());
5952 compiler->RecordSafepoint(locs()); 5973 compiler->RecordSafepoint(locs());
5953 } 5974 }
5954 5975
5955 5976
5956 } // namespace dart 5977 } // namespace dart
5957 5978
5958 #endif // defined TARGET_ARCH_ARM64 5979 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698