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

Unified Diff: runtime/vm/intermediate_language_dbc.cc

Issue 2111803003: DBC: Remove special case from CheckClassInstr. Cleanup. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« runtime/vm/flow_graph_compiler.h ('K') | « runtime/vm/intermediate_language.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_dbc.cc
diff --git a/runtime/vm/intermediate_language_dbc.cc b/runtime/vm/intermediate_language_dbc.cc
index cfbfaa8ca07efc16546b90d81baea243f638e62e..8c954b66fda2af8aabb5ac868ede98968f4e31d1 100644
--- a/runtime/vm/intermediate_language_dbc.cc
+++ b/runtime/vm/intermediate_language_dbc.cc
@@ -228,11 +228,8 @@ LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary(
void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-#if defined(PRODUCT)
- compiler->Bailout("PolymorphicInstanceCallInstr::EmitNativeCode");
-#else // defined(PRODUCT)
- compiler->Bailout(ToCString());
-#endif // defined(PRODUCT)
+ Unsupported(compiler);
+ UNREACHABLE();
}
@@ -565,13 +562,9 @@ EMIT_NATIVE_CODE(CreateArray,
EMIT_NATIVE_CODE(StoreIndexed, 3) {
if (compiler->is_optimizing()) {
if (class_id() != kArrayCid) {
-#if defined(PRODUCT)
- compiler->Bailout("StoreIndexed");
-#else // defined(PRODUCT)
- compiler->Bailout(ToCString());
-#endif // defined(PRODUCT)
+ Unsupported(compiler);
+ UNREACHABLE();
}
-
__ StoreIndexed(locs()->in(kArrayPos).reg(),
locs()->in(kIndexPos).reg(),
locs()->in(kValuePos).reg());
@@ -1015,24 +1008,13 @@ EMIT_NATIVE_CODE(CheckEitherNonSmi, 2) {
EMIT_NATIVE_CODE(CheckClassId, 1) {
- if (!Utils::IsUint(16, cid_)) {
-#if defined(PRODUCT)
- compiler->Bailout("CheckClassInstr::EmitNativeCode");
-#else // defined(PRODUCT)
- compiler->Bailout(ToCString());
-#endif // defined(PRODUCT)
- }
- __ CheckClassId(locs()->in(0).reg(), cid_);
+ __ CheckClassId(locs()->in(0).reg(),
+ compiler->ToEmbeddableCid(cid_, this));
compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckClass);
}
EMIT_NATIVE_CODE(CheckClass, 1) {
-#if defined(PRODUCT)
- const char* bailout_msg = "CheckClassInstr::EmitNativeCode";
-#else // defined(PRODUCT)
- const char* bailout_msg = ToCString();
-#endif // defined(PRODUCT)
const Register value = locs()->in(0).reg();
if (IsNullCheck()) {
ASSERT(DeoptIfNull() || DeoptIfNotNull());
@@ -1049,12 +1031,9 @@ EMIT_NATIVE_CODE(CheckClass, 1) {
if (IsDenseSwitch()) {
ASSERT(cids_[0] < cids_[cids_.length() - 1]);
const intptr_t low_cid = cids_[0];
- if (!Utils::IsUint(16, low_cid)) {
- compiler->Bailout(bailout_msg);
- }
const intptr_t cid_mask = ComputeCidMask();
__ CheckDenseSwitch(value, may_be_smi);
- __ Nop(low_cid);
+ __ Nop(compiler->ToEmbeddableCid(low_cid, this));
__ Nop(__ AddConstant(Smi::Handle(Smi::New(cid_mask))));
} else {
GrowableArray<CidTarget> sorted_ic_data;
@@ -1062,25 +1041,13 @@ EMIT_NATIVE_CODE(CheckClass, 1) {
&sorted_ic_data,
/* drop_smi = */ true);
const intptr_t sorted_length = sorted_ic_data.length();
- ASSERT(sorted_length >= 1);
- if (sorted_length == 1) {
- const intptr_t cid = sorted_ic_data[0].cid;
- if (!Utils::IsUint(16, cid)) {
- compiler->Bailout(bailout_msg);
- }
- __ CheckClassId(value, cid);
- } else {
- if (!Utils::IsUint(8, sorted_length)) {
- compiler->Bailout(bailout_msg);
- }
- __ CheckCids(value, may_be_smi, sorted_length);
- for (intptr_t i = 0; i < sorted_length; i++) {
- const intptr_t cid = sorted_ic_data[i].cid;
- if (!Utils::IsUint(16, cid)) {
- compiler->Bailout(bailout_msg);
- }
- __ Nop(cid);
- }
+ if (!Utils::IsUint(8, sorted_length)) {
+ Unsupported(compiler);
+ UNREACHABLE();
+ }
+ __ CheckCids(value, may_be_smi, sorted_length);
+ for (intptr_t i = 0; i < sorted_length; i++) {
+ __ Nop(compiler->ToEmbeddableCid(sorted_ic_data[i].cid, this));
}
}
}
« runtime/vm/flow_graph_compiler.h ('K') | « runtime/vm/intermediate_language.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698