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

Unified Diff: dart/runtime/vm/assembler_ia32.cc

Issue 60733003: Version 0.8.10.6 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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
Index: dart/runtime/vm/assembler_ia32.cc
===================================================================
--- dart/runtime/vm/assembler_ia32.cc (revision 29958)
+++ dart/runtime/vm/assembler_ia32.cc (working copy)
@@ -83,6 +83,15 @@
};
+int32_t Assembler::jit_cookie() {
+ if (jit_cookie_ == 0) {
+ jit_cookie_ = static_cast<int32_t>(
+ Isolate::Current()->random()->NextUInt32());
+ }
+ return jit_cookie_;
+}
+
+
void Assembler::InitializeMemoryWithBreakpoints(uword data, intptr_t length) {
memset(reinterpret_cast<void*>(data), Instr::kBreakPointInstruction, length);
}
@@ -1949,9 +1958,9 @@
if (Assembler::IsSafe(object)) {
LoadObject(dst, object);
} else {
- movl(dst,
- Immediate(reinterpret_cast<int32_t>(object.raw()) ^ jit_cookie_));
- xorl(dst, Immediate(jit_cookie_));
+ int32_t cookie = jit_cookie();
+ movl(dst, Immediate(reinterpret_cast<int32_t>(object.raw()) ^ cookie));
+ xorl(dst, Immediate(cookie));
}
}

Powered by Google App Engine
This is Rietveld 408576698