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

Unified Diff: runtime/vm/instructions_arm.cc

Issue 928833003: Add Function based profile tree (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/instructions_arm.h ('k') | runtime/vm/instructions_arm64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/instructions_arm.cc
diff --git a/runtime/vm/instructions_arm.cc b/runtime/vm/instructions_arm.cc
index 6d9995d6d0145d38923e1dbb60aacf3eb951d754..2d14ba3d026ade241d7de121b2da5319d951cc18 100644
--- a/runtime/vm/instructions_arm.cc
+++ b/runtime/vm/instructions_arm.cc
@@ -344,6 +344,30 @@ void JumpPattern::SetTargetAddress(uword target_address) const {
}
}
+
+ReturnPattern::ReturnPattern(uword pc)
+ : pc_(pc) {
+}
+
+
+bool ReturnPattern::IsValid() const {
+ Instr* bx_lr = Instr::At(pc_);
+ const int32_t B4 = 1 << 4;
+ const int32_t B21 = 1 << 21;
+ const int32_t B24 = 1 << 24;
+ int32_t instruction = (static_cast<int32_t>(AL) << kConditionShift) |
+ B24 | B21 | (0xfff << 8) | B4 |
+ (static_cast<int32_t>(LR) << kRmShift);
+ const ARMVersion version = TargetCPUFeatures::arm_version();
+ if ((version == ARMv5TE) || (version == ARMv6)) {
+ return bx_lr->InstructionBits() == instruction;
+ } else {
+ ASSERT(version == ARMv7);
+ return bx_lr->InstructionBits() == instruction;
+ }
+ return false;
+}
+
} // namespace dart
#endif // defined TARGET_ARCH_ARM
« no previous file with comments | « runtime/vm/instructions_arm.h ('k') | runtime/vm/instructions_arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698