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

Unified Diff: runtime/vm/simulator_dbc.cc

Issue 2076773002: DBC: Adds UnarySmiOp instruction, etc. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Change back to Drop1 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
« no previous file with comments | « runtime/vm/intermediate_language_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 9fe715b89672b067a9ee6455b4dcf8af87c1941f..1938950cebf21817fa52746ec83d614fc136e32f 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -1580,6 +1580,15 @@ RawObject* Simulator::Call(const Code& code,
DISPATCH();
}
{
+ BYTECODE(Neg, A_D);
+ const intptr_t value = reinterpret_cast<intptr_t>(FP[rD]);
+ intptr_t* out = reinterpret_cast<intptr_t*>(&FP[rA]);
+ if (LIKELY(!SignedSubWithOverflow(0, value, out))) {
+ pc++;
+ }
+ DISPATCH();
+ }
+ {
BYTECODE(BitOr, A_B_C);
SMI_OP_NOCHECK(intptr_t, SMI_BITOR);
DISPATCH();
@@ -1594,6 +1603,12 @@ RawObject* Simulator::Call(const Code& code,
SMI_OP_NOCHECK(intptr_t, SMI_BITXOR);
DISPATCH();
}
+ {
+ BYTECODE(BitNot, A_D);
+ const intptr_t value = reinterpret_cast<intptr_t>(FP[rD]);
+ *reinterpret_cast<intptr_t*>(&FP[rA]) = ~value & (~kSmiTagMask);
+ DISPATCH();
+ }
{
BYTECODE(Div, A_B_C);
@@ -1849,8 +1864,8 @@ RawObject* Simulator::Call(const Code& code,
SP[2] = args[3]; // name.
SP[3] = args[2]; // type.
Exit(thread, FP, SP + 4, pc);
- NativeArguments args(thread, 3, SP + 1, SP - 3);
- INVOKE_RUNTIME(DRT_BadTypeError, args);
+ NativeArguments native_args(thread, 3, SP + 1, SP - 3);
+ INVOKE_RUNTIME(DRT_BadTypeError, native_args);
UNREACHABLE();
}
@@ -1910,8 +1925,8 @@ RawObject* Simulator::Call(const Code& code,
SP[4] = args[3]; // name
SP[5] = cache;
Exit(thread, FP, SP + 6, pc);
- NativeArguments args(thread, 5, SP + 1, SP - 3);
- INVOKE_RUNTIME(DRT_TypeCheck, args);
+ NativeArguments native_args(thread, 5, SP + 1, SP - 3);
+ INVOKE_RUNTIME(DRT_TypeCheck, native_args);
}
AssertAssignableOk:
@@ -1952,6 +1967,17 @@ RawObject* Simulator::Call(const Code& code,
}
{
+ BYTECODE(CheckClassId, A_D);
+ const RawSmi* actual_cid =
+ SimulatorHelpers::GetClassIdAsSmi(static_cast<RawObject*>(FP[rA]));
+ const RawSmi* desired_cid = RAW_CAST(Smi, LOAD_CONSTANT(rD));
+ if (actual_cid == desired_cid) {
+ pc++;
+ }
+ DISPATCH();
+ }
+
+ {
BYTECODE(IfEqStrictTOS, 0);
SP -= 2;
if (SP[1] != SP[2]) {
« no previous file with comments | « runtime/vm/intermediate_language_dbc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698