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

Unified Diff: runtime/vm/simulator_dbc.cc

Issue 2258613002: DBC: Instructions for bailouts from http tests. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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 c26cb7500b95f80df22c7961b2314a27a2ceb193..ff9b6fd23251dbea459851a0579598095085914e 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -1930,7 +1930,7 @@ RawObject* Simulator::Call(const Code& code,
}
{
- BYTECODE(LoadFloat64Indexed, A_B_C);
+ BYTECODE(LoadIndexedFloat64, A_B_C);
ASSERT(RawObject::IsTypedDataClassId(FP[rB]->GetClassId()));
RawTypedData* array = reinterpret_cast<RawTypedData*>(FP[rB]);
RawSmi* index = RAW_CAST(Smi, FP[rC]);
@@ -1941,7 +1941,7 @@ RawObject* Simulator::Call(const Code& code,
}
{
- BYTECODE(StoreFloat64Indexed, A_B_C);
+ BYTECODE(StoreIndexedFloat64, A_B_C);
ASSERT(RawObject::IsTypedDataClassId(FP[rA]->GetClassId()));
RawTypedData* array = reinterpret_cast<RawTypedData*>(FP[rA]);
RawSmi* index = RAW_CAST(Smi, FP[rB]);
@@ -2054,13 +2054,13 @@ RawObject* Simulator::Call(const Code& code,
}
{
- BYTECODE(LoadFloat64Indexed, A_B_C);
+ BYTECODE(LoadIndexedFloat64, A_B_C);
UNREACHABLE();
DISPATCH();
}
{
- BYTECODE(StoreFloat64Indexed, A_B_C);
+ BYTECODE(StoreIndexedFloat64, A_B_C);
UNREACHABLE();
DISPATCH();
}
@@ -2166,6 +2166,15 @@ RawObject* Simulator::Call(const Code& code,
}
{
+ BYTECODE(LoadUntagged, A_B_C);
+ const uint16_t instance_reg = rB;
+ const uint16_t offset_in_words = rC;
+ RawInstance* instance = reinterpret_cast<RawInstance*>(FP[instance_reg]);
+ FP[rA] = reinterpret_cast<RawObject**>(instance)[offset_in_words];
+ DISPATCH();
+ }
+
+ {
BYTECODE(LoadFieldTOS, A_D);
const uint16_t offset_in_words = rD;
RawInstance* instance = static_cast<RawInstance*>(SP[0]);
@@ -2844,6 +2853,27 @@ RawObject* Simulator::Call(const Code& code,
}
{
+ BYTECODE(StoreIndexedUint8, A_B_C);
+ ASSERT(RawObject::IsTypedDataClassId(FP[rA]->GetClassId()));
+ RawTypedData* array = reinterpret_cast<RawTypedData*>(FP[rA]);
+ RawSmi* index = RAW_CAST(Smi, FP[rB]);
+ RawSmi* value = RAW_CAST(Smi, FP[rC]);
+ ASSERT(SimulatorHelpers::CheckIndex(index, array->ptr()->length_));
+ uint8_t* data = reinterpret_cast<uint8_t*>(array->ptr()->data());
+ data[Smi::Value(index)] = static_cast<uint8_t>(Smi::Value(value));
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(StoreIndexedExternalUint8, A_B_C);
+ uint8_t* array = reinterpret_cast<uint8_t*>(FP[rA]);
+ RawSmi* index = RAW_CAST(Smi, FP[rB]);
+ RawSmi* value = RAW_CAST(Smi, FP[rC]);
+ array[Smi::Value(index)] = static_cast<uint8_t>(Smi::Value(value));
+ DISPATCH();
+ }
+
+ {
BYTECODE(LoadIndexed, A_B_C);
RawArray* array = RAW_CAST(Array, FP[rB]);
RawSmi* index = RAW_CAST(Smi, FP[rC]);
@@ -2853,7 +2883,45 @@ RawObject* Simulator::Call(const Code& code,
}
{
- BYTECODE(LoadOneByteStringIndexed, A_B_C);
+ BYTECODE(LoadIndexedUint8, A_B_C);
+ ASSERT(RawObject::IsTypedDataClassId(FP[rB]->GetClassId()));
+ RawTypedData* array = reinterpret_cast<RawTypedData*>(FP[rB]);
+ RawSmi* index = RAW_CAST(Smi, FP[rC]);
+ ASSERT(SimulatorHelpers::CheckIndex(index, array->ptr()->length_));
+ uint8_t* data = reinterpret_cast<uint8_t*>(array->ptr()->data());
+ FP[rA] = Smi::New(data[Smi::Value(index)]);
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(LoadIndexedInt8, A_B_C);
+ ASSERT(RawObject::IsTypedDataClassId(FP[rB]->GetClassId()));
+ RawTypedData* array = reinterpret_cast<RawTypedData*>(FP[rB]);
+ RawSmi* index = RAW_CAST(Smi, FP[rC]);
+ ASSERT(SimulatorHelpers::CheckIndex(index, array->ptr()->length_));
+ int8_t* data = reinterpret_cast<int8_t*>(array->ptr()->data());
+ FP[rA] = Smi::New(data[Smi::Value(index)]);
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(LoadIndexedExternalUint8, A_B_C);
+ uint8_t* data = reinterpret_cast<uint8_t*>(FP[rB]);
+ RawSmi* index = RAW_CAST(Smi, FP[rC]);
+ FP[rA] = Smi::New(data[Smi::Value(index)]);
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(LoadIndexedExternalInt8, A_B_C);
+ int8_t* data = reinterpret_cast<int8_t*>(FP[rB]);
+ RawSmi* index = RAW_CAST(Smi, FP[rC]);
+ FP[rA] = Smi::New(data[Smi::Value(index)]);
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(LoadIndexedOneByteString, A_B_C);
RawOneByteString* array = RAW_CAST(OneByteString, FP[rB]);
RawSmi* index = RAW_CAST(Smi, FP[rC]);
ASSERT(SimulatorHelpers::CheckIndex(index, array->ptr()->length_));
@@ -2862,7 +2930,7 @@ RawObject* Simulator::Call(const Code& code,
}
{
- BYTECODE(LoadTwoByteStringIndexed, A_B_C);
+ BYTECODE(LoadIndexedTwoByteString, A_B_C);
RawTwoByteString* array = RAW_CAST(TwoByteString, FP[rB]);
RawSmi* index = RAW_CAST(Smi, FP[rC]);
ASSERT(SimulatorHelpers::CheckIndex(index, array->ptr()->length_));
« 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