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

Unified Diff: runtime/vm/assembler_ia32.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_ia32.h ('k') | runtime/vm/assembler_x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32.cc
diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
index d876feb77f784077d02a36cbdabc5abe19c07c57..66613fd461c80a5efb4c02207178557d6cc15a9a 100644
--- a/runtime/vm/assembler_ia32.cc
+++ b/runtime/vm/assembler_ia32.cc
@@ -9,6 +9,7 @@
#include "vm/code_generator.h"
#include "vm/cpu.h"
#include "vm/heap.h"
+#include "vm/instructions.h"
#include "vm/memory_region.h"
#include "vm/runtime_entry.h"
#include "vm/stack_frame.h"
@@ -2489,10 +2490,18 @@ void Assembler::DoubleAbs(XmmRegister reg) {
void Assembler::EnterFrame(intptr_t frame_size) {
if (prologue_offset_ == -1) {
+ Comment("PrologueOffset = %" Pd "", CodeSize());
prologue_offset_ = CodeSize();
}
+#ifdef DEBUG
+ intptr_t check_offset = CodeSize();
+#endif
pushl(EBP);
movl(EBP, ESP);
+#ifdef DEBUG
+ ProloguePattern pp(CodeAddress(check_offset));
+ ASSERT(pp.IsValid());
+#endif
if (frame_size != 0) {
Immediate frame_space(frame_size);
subl(ESP, frame_space);
@@ -2792,6 +2801,10 @@ void Assembler::EnterDartFrame(intptr_t frame_size) {
// allocate.
void Assembler::EnterOsrFrame(intptr_t extra_size) {
Comment("EnterOsrFrame");
+ if (prologue_offset_ == -1) {
+ Comment("PrologueOffset = %" Pd "", CodeSize());
+ prologue_offset_ = CodeSize();
+ }
Label dart_entry;
call(&dart_entry);
Bind(&dart_entry);
« no previous file with comments | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/assembler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698