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

Unified Diff: runtime/vm/code_patcher.h

Issue 136563002: Landing: Write protect executable pages in the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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/code_generator.cc ('k') | runtime/vm/code_patcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_patcher.h
===================================================================
--- runtime/vm/code_patcher.h (revision 32487)
+++ runtime/vm/code_patcher.h (working copy)
@@ -22,6 +22,22 @@
class RawObject;
class String;
+
+// Stack-allocated class to create a scope where the specified region
+// [address, addresss + size] has write access enabled. This is used
+// when patching generated code. Access is reset to read-execute in
+// the destructor of this scope.
+class WritableInstructionsScope : public ValueObject {
+ public:
+ WritableInstructionsScope(uword address, intptr_t size);
+ ~WritableInstructionsScope();
+
+ private:
+ const uword address_;
+ const intptr_t size_;
+};
+
+
class CodePatcher : public AllStatic {
public:
// Dart static calls have a distinct, machine-dependent code pattern.
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/code_patcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698