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

Unified Diff: runtime/vm/flow_graph_compiler_arm.cc

Issue 1031673004: Caches the edge counter increment size in the isolate() (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 | « no previous file | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | runtime/vm/flow_graph_compiler_ia32.cc » ('J')
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 44638)
+++ runtime/vm/flow_graph_compiler_arm.cc (working copy)
@@ -1196,8 +1196,8 @@
counter.SetAt(0, Smi::Handle(Smi::New(0)));
__ Comment("Edge counter");
__ LoadObject(R0, counter);
+ intptr_t increment_start = assembler_->CodeSize();
#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
@@ -1204,41 +1204,21 @@
__ ldr(IP, FieldAddress(R0, Array::element_offset(0)));
__ add(IP, IP, Operand(Smi::RawValue(1)));
__ StoreIntoSmiField(FieldAddress(R0, Array::element_offset(0)), IP);
+ int32_t size = assembler_->CodeSize() - increment_start;
+ if (isolate()->edge_counter_increment_size() == -1) {
+ isolate()->set_edge_counter_increment_size(size);
+ } else {
+ ASSERT(size == isolate()->edge_counter_increment_size());
+ }
#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() {
srdjan 2015/03/23 20:28:08 const
zra 2015/03/23 20:31:16 EdgeCounterIncrementSizeInBytes() is static.
- // Used by CodePatcher; so must be constant across all code in an isolate.
- int32_t size = 3 * Instr::kInstrSize;
-#if defined(DEBUG)
- if (TargetCPUFeatures::arm_version() == ARMv7) {
- size += 35 * Instr::kInstrSize;
- } else {
- // To update this number for e.g. ARMv6, run a SIMARM build with
- // --sim_use_armv6 on any Dart program.
- size += 51 * Instr::kInstrSize;
- }
-#endif // DEBUG
- if (VerifiedMemory::enabled()) {
- if (TargetCPUFeatures::arm_version() == ARMv7) {
- size += 20 * Instr::kInstrSize;
- } else {
- // To update this number for e.g. ARMv6, run a SIMARM build with
- // --sim_use_armv6 --verified_mem on any Dart program.
- size += 28 * Instr::kInstrSize;
- }
- }
+ const int32_t size = Isolate::Current()->edge_counter_increment_size();
+ ASSERT(size != -1);
return size;
}
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | runtime/vm/flow_graph_compiler_ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698