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

Unified Diff: runtime/vm/simulator_dbc.cc

Issue 2404163004: DBC: Add Smi fastpath to AssertAssignable (Closed)
Patch Set: Remove spurious comment Created 4 years, 2 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
« no previous file with comments | « runtime/vm/flow_graph_compiler_dbc.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/simulator_dbc.cc
diff --git a/runtime/vm/simulator_dbc.cc b/runtime/vm/simulator_dbc.cc
index 356abaa47789834acedd445b49114ce33a3b6ef1..97113005c255a0941ae5c07befed0d4999bc6d55 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -2690,7 +2690,11 @@ RawObject* Simulator::Call(const Code& code,
{
BYTECODE(AssertAssignable, A_D); // Stack: instance, type args, type, name
RawObject** args = SP - 3;
- if (args[0] != null_value) {
+ const bool may_be_smi = (rA == 1);
+ const bool is_smi =
+ ((reinterpret_cast<intptr_t>(args[0]) & kSmiTagMask) == kSmiTag);
+ const bool smi_ok = is_smi && may_be_smi;
+ if (!smi_ok && (args[0] != null_value)) {
RawSubtypeTestCache* cache =
static_cast<RawSubtypeTestCache*>(LOAD_CONSTANT(rD));
if (cache != null_value) {
« no previous file with comments | « runtime/vm/flow_graph_compiler_dbc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698