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

Unified Diff: runtime/vm/instructions_dbc.cc

Issue 1961953003: DBC: Adds DecodeLoadObjectFromPoolOrThread, enables tests (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/constants_dbc.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/instructions_dbc.cc
diff --git a/runtime/vm/instructions_dbc.cc b/runtime/vm/instructions_dbc.cc
index 38b69f41a04a97cc160b39e6704d3d6f0ccaf9c0..65143ac3a2dcf194d0b5dfcccf2db131eff8ce99 100644
--- a/runtime/vm/instructions_dbc.cc
+++ b/runtime/vm/instructions_dbc.cc
@@ -112,7 +112,17 @@ uword InstructionPattern::DecodeLoadWordFromPool(uword end,
bool DecodeLoadObjectFromPoolOrThread(uword pc,
const Code& code,
Object* obj) {
- UNIMPLEMENTED();
+ ASSERT(code.ContainsInstructionAt(pc));
+ Instr instr = Bytecode::At(pc);
+ if ((Bytecode::DecodeOpcode(instr) == Bytecode::kPushConstant) ||
+ (Bytecode::DecodeOpcode(instr) == Bytecode::kLoadConstant)) {
Vyacheslav Egorov (Google) 2016/05/09 18:26:13 There are more instructions that load stuff from p
zra 2016/05/09 19:36:11 Ah, yah, it looks like lots of these have potentia
+ uint16_t index = Bytecode::DecodeD(instr);
+ const ObjectPool& pool = ObjectPool::Handle(code.object_pool());
+ if (pool.InfoAt(index) == ObjectPool::kTaggedObject) {
+ *obj = pool.ObjectAt(index);
+ return true;
+ }
+ }
return false;
}
« no previous file with comments | « runtime/vm/constants_dbc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698