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

Unified Diff: runtime/vm/flow_graph_compiler_arm.cc

Issue 730343005: Write-barrier verification on ARM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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/flow_graph_compiler.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_arm.cc
===================================================================
--- runtime/vm/flow_graph_compiler_arm.cc (revision 42190)
+++ runtime/vm/flow_graph_compiler_arm.cc (working copy)
@@ -19,6 +19,7 @@
#include "vm/stack_frame.h"
#include "vm/stub_code.h"
#include "vm/symbols.h"
+#include "vm/verified_memory.h"
namespace dart {
@@ -1195,12 +1196,38 @@
counter.SetAt(0, Smi::Handle(Smi::New(0)));
__ Comment("Edge counter");
__ LoadObject(R0, counter);
+#if defined(DEBUG)
+ intptr_t increment_start = assembler_->CodeSize();
+ bool old_use_far_branches = assembler_->use_far_branches();
+ assembler_->set_use_far_branches(true);
+#endif // DEBUG
__ ldr(IP, FieldAddress(R0, Array::element_offset(0)));
__ add(IP, IP, Operand(Smi::RawValue(1)));
- __ str(IP, FieldAddress(R0, Array::element_offset(0)));
+ __ StoreIntoSmiField(FieldAddress(R0, Array::element_offset(0)), IP);
+#if defined(DEBUG)
+ assembler_->set_use_far_branches(old_use_far_branches);
+ // If the assertion below fails, update EdgeCounterIncrementSizeInBytes.
+ intptr_t expected = EdgeCounterIncrementSizeInBytes();
+ intptr_t actual = assembler_->CodeSize() - increment_start;
+ if (actual != expected) {
+ FATAL2("Edge counter increment length: %" Pd ", expected %" Pd "\n",
+ actual,
+ expected);
+ }
+#endif // DEBUG
}
+int32_t FlowGraphCompiler::EdgeCounterIncrementSizeInBytes() {
+ // Used by CodePatcher; so must be constant across all code in an isolate.
+#if defined(DEBUG)
+ return (VerifiedMemory::enabled() ? 42 : 19) * Instr::kInstrSize;
+#else
+ return 3 * Instr::kInstrSize;
+#endif // DEBUG
+}
+
+
void FlowGraphCompiler::EmitOptimizedInstanceCall(
ExternalLabel* target_label,
const ICData& ic_data,
« no previous file with comments | « runtime/vm/flow_graph_compiler.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698