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

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

Issue 2891713002: Cleanup: Make CheckClassId instruction more general so it (Closed)
Patch Set: Feedback from Martin Created 3 years, 7 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
« no previous file with comments | « runtime/vm/intermediate_language_dbc.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 5909 matching lines...) Expand 10 before | Expand all | Expand 10 after
5920 __ BranchIfNotSmi(value, deopt); 5920 __ BranchIfNotSmi(value, deopt);
5921 } 5921 }
5922 5922
5923 5923
5924 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone, 5924 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone,
5925 bool opt) const { 5925 bool opt) const {
5926 const intptr_t kNumInputs = 1; 5926 const intptr_t kNumInputs = 1;
5927 const intptr_t kNumTemps = 0; 5927 const intptr_t kNumTemps = 0;
5928 LocationSummary* summary = new (zone) 5928 LocationSummary* summary = new (zone)
5929 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5929 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5930 summary->set_in(0, Location::RequiresRegister()); 5930 summary->set_in(0, cids_.IsSingleCid() ? Location::RequiresRegister()
5931 : Location::WritableRegister());
5931 return summary; 5932 return summary;
5932 } 5933 }
5933 5934
5934 5935
5935 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5936 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5936 Register value = locs()->in(0).reg(); 5937 Register value = locs()->in(0).reg();
5937 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass); 5938 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass);
5938 __ cmpl(value, Immediate(Smi::RawValue(cid_))); 5939 if (cids_.IsSingleCid()) {
5939 __ j(NOT_ZERO, deopt); 5940 __ cmpl(value, Immediate(Smi::RawValue(cids_.cid_start)));
5941 __ j(NOT_ZERO, deopt);
5942 } else {
5943 __ AddImmediate(value, Immediate(-Smi::RawValue(cids_.cid_start)));
5944 __ cmpl(value, Immediate(Smi::RawValue(cids_.Extent())));
5945 __ j(ABOVE, deopt);
5946 }
5940 } 5947 }
5941 5948
5942 5949
5943 LocationSummary* GenericCheckBoundInstr::MakeLocationSummary(Zone* zone, 5950 LocationSummary* GenericCheckBoundInstr::MakeLocationSummary(Zone* zone,
5944 bool opt) const { 5951 bool opt) const {
5945 // Only needed for AOT. 5952 // Only needed for AOT.
5946 UNIMPLEMENTED(); 5953 UNIMPLEMENTED();
5947 return NULL; 5954 return NULL;
5948 } 5955 }
5949 5956
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
6932 __ Drop(1); 6939 __ Drop(1);
6933 __ popl(result); 6940 __ popl(result);
6934 } 6941 }
6935 6942
6936 6943
6937 } // namespace dart 6944 } // namespace dart
6938 6945
6939 #undef __ 6946 #undef __
6940 6947
6941 #endif // defined TARGET_ARCH_IA32 6948 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_dbc.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698