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

Side by Side Diff: runtime/vm/intermediate_language_arm.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.cc ('k') | runtime/vm/intermediate_language_arm64.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 1
2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 5
6 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. 6 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
7 #if defined(TARGET_ARCH_ARM) 7 #if defined(TARGET_ARCH_ARM)
8 8
9 #include "vm/intermediate_language.h" 9 #include "vm/intermediate_language.h"
10 10
(...skipping 6385 matching lines...) Expand 10 before | Expand all | Expand 10 after
6396 __ BranchIfNotSmi(value, deopt); 6396 __ BranchIfNotSmi(value, deopt);
6397 } 6397 }
6398 6398
6399 6399
6400 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone, 6400 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone,
6401 bool opt) const { 6401 bool opt) const {
6402 const intptr_t kNumInputs = 1; 6402 const intptr_t kNumInputs = 1;
6403 const intptr_t kNumTemps = 0; 6403 const intptr_t kNumTemps = 0;
6404 LocationSummary* summary = new (zone) 6404 LocationSummary* summary = new (zone)
6405 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); 6405 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
6406 summary->set_in(0, Location::RequiresRegister()); 6406 summary->set_in(0, cids_.IsSingleCid() ? Location::RequiresRegister()
6407 : Location::WritableRegister());
6407 return summary; 6408 return summary;
6408 } 6409 }
6409 6410
6410 6411
6411 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 6412 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
6412 Register value = locs()->in(0).reg(); 6413 Register value = locs()->in(0).reg();
6413 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass); 6414 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass);
6414 __ CompareImmediate(value, Smi::RawValue(cid_)); 6415 if (cids_.IsSingleCid()) {
6415 __ b(deopt, NE); 6416 __ CompareImmediate(value, Smi::RawValue(cids_.cid_start));
6417 __ b(deopt, NE);
6418 } else {
6419 __ AddImmediate(value, -Smi::RawValue(cids_.cid_start));
6420 __ CompareImmediate(value, Smi::RawValue(cids_.Extent()));
6421 __ b(deopt, HI); // Unsigned higher.
6422 }
6416 } 6423 }
6417 6424
6418 6425
6419 LocationSummary* GenericCheckBoundInstr::MakeLocationSummary(Zone* zone, 6426 LocationSummary* GenericCheckBoundInstr::MakeLocationSummary(Zone* zone,
6420 bool opt) const { 6427 bool opt) const {
6421 const intptr_t kNumInputs = 2; 6428 const intptr_t kNumInputs = 2;
6422 const intptr_t kNumTemps = 0; 6429 const intptr_t kNumTemps = 0;
6423 LocationSummary* locs = new (zone) LocationSummary( 6430 LocationSummary* locs = new (zone) LocationSummary(
6424 zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); 6431 zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
6425 locs->set_in(kLengthPos, Location::RequiresRegister()); 6432 locs->set_in(kLengthPos, Location::RequiresRegister());
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
7269 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), 7276 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(),
7270 kGrowRegExpStackRuntimeEntry, 1, locs()); 7277 kGrowRegExpStackRuntimeEntry, 1, locs());
7271 __ Drop(1); 7278 __ Drop(1);
7272 __ Pop(result); 7279 __ Pop(result);
7273 } 7280 }
7274 7281
7275 7282
7276 } // namespace dart 7283 } // namespace dart
7277 7284
7278 #endif // defined TARGET_ARCH_ARM 7285 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698