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

Side by Side Diff: runtime/vm/intermediate_language_arm64.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_arm.cc ('k') | runtime/vm/intermediate_language_dbc.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) 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 5541 matching lines...) Expand 10 before | Expand all | Expand 10 after
5552 return bias; 5552 return bias;
5553 } 5553 }
5554 5554
5555 5555
5556 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone, 5556 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone,
5557 bool opt) const { 5557 bool opt) const {
5558 const intptr_t kNumInputs = 1; 5558 const intptr_t kNumInputs = 1;
5559 const intptr_t kNumTemps = 0; 5559 const intptr_t kNumTemps = 0;
5560 LocationSummary* summary = new (zone) 5560 LocationSummary* summary = new (zone)
5561 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5561 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5562 summary->set_in(0, Location::RequiresRegister()); 5562 summary->set_in(0, cids_.IsSingleCid() ? Location::RequiresRegister()
5563 : Location::WritableRegister());
5563 return summary; 5564 return summary;
5564 } 5565 }
5565 5566
5566 5567
5567 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5568 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5568 Register value = locs()->in(0).reg(); 5569 Register value = locs()->in(0).reg();
5569 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass); 5570 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass);
5570 __ CompareImmediate(value, Smi::RawValue(cid_)); 5571 if (cids_.IsSingleCid()) {
5571 __ b(deopt, NE); 5572 __ CompareImmediate(value, Smi::RawValue(cids_.cid_start));
5573 __ b(deopt, NE);
5574 } else {
5575 __ AddImmediate(value, -Smi::RawValue(cids_.cid_start));
5576 __ CompareImmediate(value, Smi::RawValue(cids_.cid_end - cids_.cid_start));
5577 __ b(deopt, HI); // Unsigned higher.
5578 }
5572 } 5579 }
5573 5580
5574 5581
5575 LocationSummary* CheckSmiInstr::MakeLocationSummary(Zone* zone, 5582 LocationSummary* CheckSmiInstr::MakeLocationSummary(Zone* zone,
5576 bool opt) const { 5583 bool opt) const {
5577 const intptr_t kNumInputs = 1; 5584 const intptr_t kNumInputs = 1;
5578 const intptr_t kNumTemps = 0; 5585 const intptr_t kNumTemps = 0;
5579 LocationSummary* summary = new (zone) 5586 LocationSummary* summary = new (zone)
5580 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5587 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5581 summary->set_in(0, Location::RequiresRegister()); 5588 summary->set_in(0, Location::RequiresRegister());
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
6090 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), 6097 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(),
6091 kGrowRegExpStackRuntimeEntry, 1, locs()); 6098 kGrowRegExpStackRuntimeEntry, 1, locs());
6092 __ Drop(1); 6099 __ Drop(1);
6093 __ Pop(result); 6100 __ Pop(result);
6094 } 6101 }
6095 6102
6096 6103
6097 } // namespace dart 6104 } // namespace dart
6098 6105
6099 #endif // defined TARGET_ARCH_ARM64 6106 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698