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

Unified Diff: runtime/vm/simulator_dbc.cc

Issue 2399333003: DBC: Support large offsets in optimized field access. (Closed)
Patch Set: addressed comments Created 4 years, 2 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') | tests/language/language.status » ('j') | 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 67c172866491999fea77fb29f5e5a6c145eb1760..a82d19a840c89a0e04b296fb05ba62c5d6c2c9e5 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -2367,7 +2367,20 @@ RawObject* Simulator::Call(const Code& code,
const uint16_t value_reg = rC;
RawInstance* instance = reinterpret_cast<RawInstance*>(FP[rA]);
- RawObject* value = reinterpret_cast<RawObject*>(FP[value_reg]);
+ RawObject* value = FP[value_reg];
+
+ instance->StorePointer(
+ reinterpret_cast<RawObject**>(instance->ptr()) + offset_in_words,
+ value);
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(StoreFieldExt, A_D);
+ // The offset is stored in the following nop-instruction which is skipped.
+ const uint16_t offset_in_words = Bytecode::DecodeD(*pc++);
+ RawInstance* instance = reinterpret_cast<RawInstance*>(FP[rA]);
+ RawObject* value = FP[rD];
instance->StorePointer(
reinterpret_cast<RawObject**>(instance->ptr()) + offset_in_words,
@@ -2398,6 +2411,16 @@ RawObject* Simulator::Call(const Code& code,
}
{
+ BYTECODE(LoadFieldExt, A_D);
+ // The offset is stored in the following nop-instruction which is skipped.
+ const uint16_t offset_in_words = Bytecode::DecodeD(*pc++);
+ const uint16_t instance_reg = rD;
+ RawInstance* instance = reinterpret_cast<RawInstance*>(FP[instance_reg]);
+ FP[rA] = reinterpret_cast<RawObject**>(instance->ptr())[offset_in_words];
+ DISPATCH();
+ }
+
+ {
BYTECODE(LoadUntagged, A_B_C);
const uint16_t instance_reg = rB;
const uint16_t offset_in_words = rC;
« no previous file with comments | « runtime/vm/intermediate_language_dbc.cc ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698