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

Unified Diff: runtime/vm/flow_graph_compiler.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.h ('k') | runtime/vm/flow_graph_compiler_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.cc
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index 42df32d1531b00148e6e5e7086fc0cb974c1578a..291471173f79a8bb88710073e1d240ba96c6bb23 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -69,7 +69,7 @@ FlowGraphCompiler::FlowGraphCompiler(Assembler* assembler,
: assembler_(assembler),
parsed_function_(flow_graph->parsed_function()),
flow_graph_(*flow_graph),
- block_order_(*flow_graph->codegen_block_order(is_optimizing)),
+ block_order_(*flow_graph->CodegenBlockOrder(is_optimizing)),
current_block_(NULL),
exception_handlers_list_(NULL),
pc_descriptors_list_(NULL),
@@ -225,6 +225,31 @@ void FlowGraphCompiler::CompactBlocks() {
}
+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() && !instr->IsGoto())) {
+ // GuardField and instructions that can be deoptimization targets need
+ // to record their deopt id. GotoInstr records its own so that it can
+ // control the placement.
+ 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::VisitBlocks() {
CompactBlocks();
« no previous file with comments | « runtime/vm/flow_graph_compiler.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698