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

Unified Diff: runtime/vm/code_patcher.cc

Issue 12439005: Implement leaf runtime call stub on ARM and corresponding call redirection (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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_arm.cc ('k') | runtime/vm/constants_arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_patcher.cc
===================================================================
--- runtime/vm/code_patcher.cc (revision 19723)
+++ runtime/vm/code_patcher.cc (working copy)
@@ -3,19 +3,23 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/code_patcher.h"
+#include "vm/cpu.h"
#include "vm/instructions.h"
#include "vm/object.h"
namespace dart {
-static void SwapCode(intptr_t num_bytes, char* a, char* b) {
+static void SwapCode(intptr_t num_bytes, char* code, char* buffer) {
+ uword code_address = reinterpret_cast<uword>(code);
for (intptr_t i = 0; i < num_bytes; i++) {
- char tmp = *a;
- *a = *b;
- *b = tmp;
- a++;
- b++;
+ char tmp = *code;
+ *code = *buffer;
+ *buffer = tmp;
+ code++;
+ buffer++;
}
+ CPU::FlushICache(code_address, num_bytes);
+ // The buffer is not executed. No need to flush.
}
« no previous file with comments | « runtime/vm/assembler_arm.cc ('k') | runtime/vm/constants_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698