Chromium Code Reviews| Index: runtime/vm/simulator_dbc.cc |
| diff --git a/runtime/vm/simulator_dbc.cc b/runtime/vm/simulator_dbc.cc |
| index 16d8ea0491a6a8b79cc3e92e4896842caa243b84..7a8e90abae0885cff2b9aee4c19ab1b71544eef9 100644 |
| --- a/runtime/vm/simulator_dbc.cc |
| +++ b/runtime/vm/simulator_dbc.cc |
| @@ -2969,6 +2969,16 @@ RawObject* Simulator::Call(const Code& code, |
| } |
| { |
| + 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); |
|
Florian Schneider
2016/08/22 22:45:35
Other instructions (StoreIndexedUint8) use a stati
zra
2016/08/22 22:57:29
Done.
|
| + DISPATCH(); |
| + } |
| + |
| + { |
| BYTECODE(StoreIndexedUint32, A_B_C); |
| uint8_t* data = SimulatorHelpers::GetTypedData(FP[rA], FP[rB], 2); |
| const uintptr_t value = reinterpret_cast<uintptr_t>(FP[rC]); |
| @@ -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)]; |