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

Unified Diff: runtime/vm/assembler_x64.cc

Issue 1150633002: Track prologue offset of Code and use for more precise return addresses (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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_x64.h ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_x64.cc
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index 45a0754cde9852e760755f48f93c902e2061bc8f..7bab3d76eefa50a147655429b05b45cceaa69cd4 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -3224,9 +3224,17 @@ void Assembler::Bind(Label* label) {
void Assembler::EnterFrame(intptr_t frame_size) {
if (prologue_offset_ == -1) {
prologue_offset_ = CodeSize();
+ Comment("PrologueOffset = %" Pd "", CodeSize());
}
+#ifdef DEBUG
+ intptr_t check_offset = CodeSize();
+#endif
pushq(RBP);
movq(RBP, RSP);
+#ifdef DEBUG
+ ProloguePattern pp(CodeAddress(check_offset));
+ ASSERT(pp.IsValid());
+#endif
if (frame_size != 0) {
Immediate frame_space(frame_size);
subq(RSP, frame_space);
@@ -3406,6 +3414,10 @@ void Assembler::LeaveDartFrame() {
void Assembler::EnterOsrFrame(intptr_t extra_size,
Register new_pp,
Register pc_marker_override) {
+ if (prologue_offset_ == -1) {
+ Comment("PrologueOffset = %" Pd "", CodeSize());
+ prologue_offset_ = CodeSize();
+ }
movq(Address(RBP, kPcMarkerSlotFromFp * kWordSize), pc_marker_override);
movq(PP, new_pp);
if (extra_size != 0) {
« no previous file with comments | « runtime/vm/assembler_x64.h ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698