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

Unified Diff: runtime/vm/code_patcher_arm64.cc

Issue 263243002: Enables many language tests for arm64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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/assembler_arm64_test.cc ('k') | runtime/vm/constants_arm64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_patcher_arm64.cc
===================================================================
--- runtime/vm/code_patcher_arm64.cc (revision 35723)
+++ runtime/vm/code_patcher_arm64.cc (working copy)
@@ -98,9 +98,44 @@
}
+// This class pattern matches on a load from the object pool. Loading on
+// ARM64 is complicated because it can take more than one form. We
+// match backwards from the end of the sequence so we can reuse the code for
+// matching object pool loads at calls.
+class EdgeCounter : public ValueObject {
+ public:
+ EdgeCounter(uword pc, const Code& code)
+ : end_(pc - kAdjust), object_pool_(Array::Handle(code.ObjectPool())) {
+ // An IsValid predicate is complicated and duplicates the code in the
+ // decoding function. Instead we rely on decoding the pattern which
+ // will assert partial validity.
+ }
+
+ RawObject* edge_counter() const {
+ Register ignored;
+ intptr_t index;
+ InstructionPattern::DecodeLoadWordFromPool(end_, &ignored, &index);
+ ASSERT(ignored == R0);
+ return object_pool_.At(index);
+ }
+
+ private:
+ // The object pool load is followed by the fixed-size edge counter
+ // incrementing code:
+ // ldr ip, [r0, #+11]
+ // adds ip, ip, #2
+ // str ip, [r0, #+11]
+ static const intptr_t kAdjust = 3 * Instr::kInstrSize;
+
+ uword end_;
+ const Array& object_pool_;
+};
+
+
RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) {
- UNIMPLEMENTED();
- return NULL;
+ ASSERT(code.ContainsInstructionAt(pc));
+ EdgeCounter counter(pc, code);
+ return counter.edge_counter();
}
} // namespace dart
« no previous file with comments | « runtime/vm/assembler_arm64_test.cc ('k') | runtime/vm/constants_arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698