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

Unified Diff: runtime/vm/flow_graph.h

Issue 2265873005: VM: Remove more duplicate code between AOT and JIT compiler. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix comment Created 4 years, 4 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/compiler.cc ('k') | runtime/vm/flow_graph.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph.h
diff --git a/runtime/vm/flow_graph.h b/runtime/vm/flow_graph.h
index 0c7aa526cd60c97caf23d9b82f3c6a36fe7d5575..7da7ac012dabc58194248129b7ecc7603a48f452 100644
--- a/runtime/vm/flow_graph.h
+++ b/runtime/vm/flow_graph.h
@@ -305,6 +305,11 @@ class FlowGraph : public ZoneAllocated {
bool IsReceiver(Definition* def) const;
+ // Optimize (a << b) & c pattern: if c is a positive Smi or zero, then the
+ // shift can be a truncating Smi shift-left and result is always Smi.
+ // Merge instructions (only per basic-block).
+ void TryOptimizePatterns();
+
private:
friend class IfConverter;
friend class BranchSimplifier;
@@ -361,6 +366,18 @@ class FlowGraph : public ZoneAllocated {
void ComputeIsReceiverRecursive(PhiInstr* phi,
GrowableArray<PhiInstr*>* unmark) const;
+ void OptimizeLeftShiftBitAndSmiOp(
+ ForwardInstructionIterator* current_iterator,
+ Definition* bit_and_instr,
+ Definition* left_instr,
+ Definition* right_instr);
+
+ void TryMergeTruncDivMod(GrowableArray<BinarySmiOpInstr*>* merge_candidates);
+ void TryMergeMathUnary(GrowableArray<MathUnaryInstr*>* merge_candidates);
+
+ void AppendExtractNthOutputForMerged(Definition* instr, intptr_t ix,
+ Representation rep, intptr_t cid);
+
Thread* thread_;
// DiscoverBlocks computes parent_ and assigned_vars_ which are then used
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698