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

Side by Side Diff: runtime/vm/aot_optimizer.h

Issue 2314133003: AOT: Use a cid range check when possible to implement type tests. (Closed)
Patch Set: . Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/aot_optimizer.cc » ('j') | runtime/vm/aot_optimizer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_AOT_OPTIMIZER_H_ 5 #ifndef VM_AOT_OPTIMIZER_H_
6 #define VM_AOT_OPTIMIZER_H_ 6 #define VM_AOT_OPTIMIZER_H_
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 #include "vm/flow_graph.h" 9 #include "vm/flow_graph.h"
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 bool TryReplaceWithRelationalOp(InstanceCallInstr* call, Token::Kind op_kind); 68 bool TryReplaceWithRelationalOp(InstanceCallInstr* call, Token::Kind op_kind);
69 69
70 bool TryInlineFieldAccess(InstanceCallInstr* call); 70 bool TryInlineFieldAccess(InstanceCallInstr* call);
71 bool TryInlineInstanceGetter(InstanceCallInstr* call); 71 bool TryInlineInstanceGetter(InstanceCallInstr* call);
72 bool TryInlineInstanceSetter(InstanceCallInstr* call, 72 bool TryInlineInstanceSetter(InstanceCallInstr* call,
73 const ICData& unary_ic_data); 73 const ICData& unary_ic_data);
74 74
75 bool TryInlineInstanceMethod(InstanceCallInstr* call); 75 bool TryInlineInstanceMethod(InstanceCallInstr* call);
76 void ReplaceWithInstanceOf(InstanceCallInstr* instr); 76 void ReplaceWithInstanceOf(InstanceCallInstr* instr);
77 bool TypeCheckAsClassEquality(const AbstractType& type); 77 bool TypeCheckAsClassEquality(const AbstractType& type);
78 void ReplaceWithClassRangeCheck(InstanceCallInstr* call,
79 Definition* left,
80 bool negate,
81 intptr_t lower_limit,
82 intptr_t upper_limit);
78 void ReplaceWithTypeCast(InstanceCallInstr* instr); 83 void ReplaceWithTypeCast(InstanceCallInstr* instr);
79 84
80 bool TryReplaceInstanceCallWithInline(InstanceCallInstr* call); 85 bool TryReplaceInstanceCallWithInline(InstanceCallInstr* call);
81 86
82 // Insert a check of 'to_check' determined by 'unary_checks'. If the 87 // Insert a check of 'to_check' determined by 'unary_checks'. If the
83 // check fails it will deoptimize to 'deopt_id' using the deoptimization 88 // check fails it will deoptimize to 'deopt_id' using the deoptimization
84 // environment 'deopt_environment'. The check is inserted immediately 89 // environment 'deopt_environment'. The check is inserted immediately
85 // before 'insert_before'. 90 // before 'insert_before'.
86 void AddCheckClass(Definition* to_check, 91 void AddCheckClass(Definition* to_check,
87 const ICData& unary_checks, 92 const ICData& unary_checks,
(...skipping 10 matching lines...) Expand all
98 intptr_t deopt_id, 103 intptr_t deopt_id,
99 Environment* deopt_environment, 104 Environment* deopt_environment,
100 Instruction* insert_before); 105 Instruction* insert_before);
101 106
102 // Add a class check for a call's first argument immediately before the 107 // Add a class check for a call's first argument immediately before the
103 // call, using the call's IC data to determine the check, and the call's 108 // call, using the call's IC data to determine the check, and the call's
104 // deopt ID and deoptimization environment if the check fails. 109 // deopt ID and deoptimization environment if the check fails.
105 void AddReceiverCheck(InstanceCallInstr* call); 110 void AddReceiverCheck(InstanceCallInstr* call);
106 111
107 void ReplaceCall(Definition* call, Definition* replacement); 112 void ReplaceCall(Definition* call, Definition* replacement);
113 void ReplaceCallWithSubgraph(Definition* call,
114 TargetEntryInstr* entry,
115 Definition* last);
108 116
109 117
110 bool InstanceCallNeedsClassCheck(InstanceCallInstr* call, 118 bool InstanceCallNeedsClassCheck(InstanceCallInstr* call,
111 RawFunction::Kind kind) const; 119 RawFunction::Kind kind) const;
112 120
113 bool InlineFloat32x4BinaryOp(InstanceCallInstr* call, 121 bool InlineFloat32x4BinaryOp(InstanceCallInstr* call,
114 Token::Kind op_kind); 122 Token::Kind op_kind);
115 bool InlineInt32x4BinaryOp(InstanceCallInstr* call, 123 bool InlineInt32x4BinaryOp(InstanceCallInstr* call,
116 Token::Kind op_kind); 124 Token::Kind op_kind);
117 bool InlineFloat64x2BinaryOp(InstanceCallInstr* call, 125 bool InlineFloat64x2BinaryOp(InstanceCallInstr* call,
(...skipping 25 matching lines...) Expand all
143 151
144 GrowableArray<intptr_t>* inlining_black_list_; 152 GrowableArray<intptr_t>* inlining_black_list_;
145 153
146 DISALLOW_COPY_AND_ASSIGN(AotOptimizer); 154 DISALLOW_COPY_AND_ASSIGN(AotOptimizer);
147 }; 155 };
148 156
149 157
150 } // namespace dart 158 } // namespace dart
151 159
152 #endif // VM_AOT_OPTIMIZER_H_ 160 #endif // VM_AOT_OPTIMIZER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/aot_optimizer.cc » ('j') | runtime/vm/aot_optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698