Chromium Code Reviews| Index: runtime/vm/simulator_dbc.cc |
| diff --git a/runtime/vm/simulator_dbc.cc b/runtime/vm/simulator_dbc.cc |
| index 4789edc6d93c188285f405d3c6787099dd1c698b..44355bdb46db6fab27fccb9a1f566869dcf0dac5 100644 |
| --- a/runtime/vm/simulator_dbc.cc |
| +++ b/runtime/vm/simulator_dbc.cc |
| @@ -28,6 +28,7 @@ |
| #include "vm/object_store.h" |
| #include "vm/os_thread.h" |
| #include "vm/stack_frame.h" |
| +#include "vm/symbols.h" |
| namespace dart { |
| @@ -1525,6 +1526,28 @@ RawObject* Simulator::Call(const Code& code, |
| } |
| { |
| + BYTECODE(OneByteStringFromCharCode, A_X); |
| + intptr_t char_code = Smi::Value(RAW_CAST(Smi, FP[rD])); |
|
zra
2016/06/29 14:34:12
const intptr_t
rmacnak
2016/06/29 16:44:16
Done.
|
| + ASSERT(char_code >= 0); |
| + ASSERT(char_code <= 255); |
| + RawString** strings = Symbols::PredefinedAddress(); |
| + intptr_t index = char_code + Symbols::kNullCharCodeSymbolOffset; |
|
zra
2016/06/29 14:34:12
ditto
|
| + FP[rA] = strings[index]; |
| + DISPATCH(); |
| + } |
| + |
| + { |
| + BYTECODE(StringToCharCode, A_X); |
| + RawOneByteString* str = RAW_CAST(OneByteString, FP[rD]); |
| + if (str->ptr()->length_ == Smi::New(1)) { |
| + FP[rA] = Smi::New(str->ptr()->data()[0]); |
| + } else { |
| + FP[rA] = Smi::New(-1); |
| + } |
| + DISPATCH(); |
| + } |
| + |
| + { |
| BYTECODE(AddTOS, A_B_C); |
| SMI_FASTPATH_TOS(intptr_t, SignedAddWithOverflow); |
| DISPATCH(); |