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

Unified Diff: runtime/vm/simulator_dbc.cc

Issue 2270483002: DBC: Fix more HTTP benchmark bailouts (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments 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 16d8ea0491a6a8b79cc3e92e4896842caa243b84..2e271c7197aa8cd30001d5fd44ef6322e2bc1fa8 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -2955,7 +2955,7 @@ RawObject* Simulator::Call(const Code& code,
{
BYTECODE(StoreIndexedUint8, A_B_C);
uint8_t* data = SimulatorHelpers::GetTypedData(FP[rA], FP[rB], 0);
- *data = static_cast<uint8_t>(Smi::Value(RAW_CAST(Smi, FP[rC])));
+ *data = Smi::Value(RAW_CAST(Smi, FP[rC]));
DISPATCH();
}
@@ -2964,7 +2964,17 @@ RawObject* Simulator::Call(const Code& code,
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));
+ array[Smi::Value(index)] = Smi::Value(value);
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(StoreIndexedOneByteString, A_B_C);
+ RawOneByteString* array = RAW_CAST(OneByteString, FP[rA]);
+ RawSmi* index = RAW_CAST(Smi, FP[rB]);
+ RawSmi* value = RAW_CAST(Smi, FP[rC]);
+ ASSERT(SimulatorHelpers::CheckIndex(index, array->ptr()->length_));
+ array->ptr()->data()[Smi::Value(index)] = Smi::Value(value);
DISPATCH();
}
@@ -2978,7 +2988,9 @@ RawObject* Simulator::Call(const Code& code,
{
BYTECODE(LoadIndexed, A_B_C);
- RawArray* array = RAW_CAST(Array, FP[rB]);
+ RawObject* obj = FP[rB];
+ ASSERT(obj->IsArray() || obj->IsImmutableArray());
+ RawArray* array = reinterpret_cast<RawArray*>(obj);
RawSmi* index = RAW_CAST(Smi, FP[rC]);
ASSERT(SimulatorHelpers::CheckIndex(index, array->ptr()->length_));
FP[rA] = array->ptr()->data()[Smi::Value(index)];
« 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