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

Unified Diff: runtime/vm/simulator_dbc.cc

Issue 2113563002: DBC: Various instructions. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add unsigned integer compares 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
Index: runtime/vm/simulator_dbc.cc
diff --git a/runtime/vm/simulator_dbc.cc b/runtime/vm/simulator_dbc.cc
index b1c648dc96d9e61026a30e3c64623a54b7d7c0e8..73d6626db2a9a4ba66f63109a8bfb720ef22157d 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -2194,6 +2194,86 @@ RawObject* Simulator::Call(const Code& code,
}
{
+ BYTECODE(IfLe, A_D);
+ const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rA]);
+ const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rD]);
+ if (lhs > rhs) {
+ pc++;
+ }
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(IfLt, A_D);
+ const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rA]);
+ const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rD]);
+ if (lhs >= rhs) {
+ pc++;
+ }
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(IfGe, A_D);
+ const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rA]);
+ const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rD]);
+ if (lhs < rhs) {
+ pc++;
+ }
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(IfGt, A_D);
+ const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rA]);
+ const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rD]);
+ if (lhs <= rhs) {
+ pc++;
+ }
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(IfULe, A_D);
+ const uintptr_t lhs = reinterpret_cast<uintptr_t>(FP[rA]);
+ const uintptr_t rhs = reinterpret_cast<uintptr_t>(FP[rD]);
+ if (lhs > rhs) {
+ pc++;
+ }
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(IfULt, A_D);
+ const uintptr_t lhs = reinterpret_cast<uintptr_t>(FP[rA]);
+ const uintptr_t rhs = reinterpret_cast<uintptr_t>(FP[rD]);
+ if (lhs >= rhs) {
+ pc++;
+ }
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(IfUGe, A_D);
+ const uintptr_t lhs = reinterpret_cast<uintptr_t>(FP[rA]);
+ const uintptr_t rhs = reinterpret_cast<uintptr_t>(FP[rD]);
+ if (lhs < rhs) {
+ pc++;
+ }
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(IfUGt, A_D);
+ const uintptr_t lhs = reinterpret_cast<uintptr_t>(FP[rA]);
+ const uintptr_t rhs = reinterpret_cast<uintptr_t>(FP[rD]);
+ if (lhs <= rhs) {
+ pc++;
+ }
+ DISPATCH();
+ }
+
+ {
BYTECODE(IfEqStrictNum, A_D);
RawObject* lhs = FP[rA];
RawObject* rhs = FP[rD];
@@ -2254,11 +2334,9 @@ RawObject* Simulator::Call(const Code& code,
{
BYTECODE(StoreIndexedTOS, 0);
SP -= 3;
- RawArray* array = static_cast<RawArray*>(SP[1]);
- RawSmi* index = static_cast<RawSmi*>(SP[2]);
+ RawArray* array = RAW_CAST(Array, SP[1]);
+ RawSmi* index = RAW_CAST(Smi, SP[2]);
RawObject* value = SP[3];
- ASSERT(array->GetClassId() == kArrayCid);
- ASSERT(!index->IsHeapObject());
ASSERT(SimulatorHelpers::CheckIndex(index, array->ptr()->length_));
array->StorePointer(array->ptr()->data() + Smi::Value(index), value);
DISPATCH();
@@ -2266,17 +2344,24 @@ RawObject* Simulator::Call(const Code& code,
{
BYTECODE(StoreIndexed, A_B_C);
- RawArray* array = static_cast<RawArray*>(FP[rA]);
- RawSmi* index = static_cast<RawSmi*>(FP[rB]);
+ RawArray* array = RAW_CAST(Array, FP[rA]);
+ RawSmi* index = RAW_CAST(Smi, FP[rB]);
RawObject* value = FP[rC];
- ASSERT(array->GetClassId() == kArrayCid);
- ASSERT(!index->IsHeapObject());
ASSERT(SimulatorHelpers::CheckIndex(index, array->ptr()->length_));
array->StorePointer(array->ptr()->data() + Smi::Value(index), value);
DISPATCH();
}
{
+ BYTECODE(LoadIndexed, A_B_C);
+ RawArray* array = RAW_CAST(Array, FP[rB]);
+ RawSmi* index = RAW_CAST(Smi, FP[rC]);
+ ASSERT(SimulatorHelpers::CheckIndex(index, array->ptr()->length_));
+ FP[rA] = array->ptr()->data()[Smi::Value(index)];
+ DISPATCH();
+ }
+
+ {
BYTECODE(Deopt, A_D);
const bool is_lazy = rD == 0;
« runtime/vm/intermediate_language_dbc.cc ('K') | « runtime/vm/intermediate_language_dbc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698