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

Unified Diff: runtime/vm/flow_graph_compiler_mips.cc

Issue 24744002: Pattern match on generated code to find edge counters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated review comments. Created 7 years, 3 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/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_mips.cc
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
index 04f3eabc59e3885b9ea84bc9929aa3fc7bce24d4..e18577ec42846906fe56771abe1b884a0c87c92b 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -744,28 +744,6 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos,
}
-void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) {
- if (!is_optimizing()) {
- if (FLAG_enable_type_checks && instr->IsAssertAssignable()) {
- AssertAssignableInstr* assert = instr->AsAssertAssignable();
- AddCurrentDescriptor(PcDescriptors::kDeopt,
- assert->deopt_id(),
- assert->token_pos());
- } else if (instr->IsGuardField() ||
- instr->CanBecomeDeoptimizationTarget()) {
- AddCurrentDescriptor(PcDescriptors::kDeopt,
- instr->deopt_id(),
- Scanner::kDummyTokenIndex);
- }
- AllocateRegistersLocally(instr);
- } else if (instr->MayThrow() &&
- (CurrentTryIndex() != CatchClauseNode::kInvalidTryIndex)) {
- // Optimized try-block: Sync locals to fixed stack locations.
- EmitTrySync(instr, CurrentTryIndex());
- }
-}
-
-
void FlowGraphCompiler::EmitTrySyncMove(intptr_t dest_offset,
Location loc,
bool* push_emitted) {
@@ -1319,6 +1297,22 @@ void FlowGraphCompiler::GenerateCallRuntime(intptr_t token_pos,
}
+void FlowGraphCompiler::EmitEdgeCounter() {
+ // We do not check for overflow when incrementing the edge counter. The
+ // function should normally be optimized long before the counter can
+ // overflow; and though we do not reset the counters when we optimize or
+ // deoptimize, there is a bound on the number of
+ // optimization/deoptimization cycles we will attempt.
+ const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld));
+ counter.SetAt(0, Smi::Handle(Smi::New(0)));
+ __ Comment("Edge counter");
+ __ LoadObject(T0, counter);
+ __ lw(T1, FieldAddress(T0, Array::element_offset(0)));
+ __ AddImmediate(T1, T1, Smi::RawValue(1));
+ __ sw(T1, FieldAddress(T0, Array::element_offset(0)));
+}
+
+
void FlowGraphCompiler::EmitOptimizedInstanceCall(
ExternalLabel* target_label,
const ICData& ic_data,
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698