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

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

Issue 1513883002: Polymorphic calls in precompilation invoke megamorphic calls when tests fail (instead of deoptimizi… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: g Created 5 years 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 | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »
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_FLOW_GRAPH_COMPILER_H_ 5 #ifndef VM_FLOW_GRAPH_COMPILER_H_
6 #define VM_FLOW_GRAPH_COMPILER_H_ 6 #define VM_FLOW_GRAPH_COMPILER_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/code_descriptors.h" 10 #include "vm/code_descriptors.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 private: 207 private:
208 virtual void EmitNativeCode(FlowGraphCompiler* compiler) = 0; 208 virtual void EmitNativeCode(FlowGraphCompiler* compiler) = 0;
209 209
210 Label entry_label_; 210 Label entry_label_;
211 Label exit_label_; 211 Label exit_label_;
212 212
213 DISALLOW_COPY_AND_ASSIGN(SlowPathCode); 213 DISALLOW_COPY_AND_ASSIGN(SlowPathCode);
214 }; 214 };
215 215
216 216
217 class MegamorphicSlowPath : public SlowPathCode {
218 public:
219 MegamorphicSlowPath(const ICData& ic_data,
220 intptr_t argument_count,
221 intptr_t deopt_id,
222 intptr_t token_pos,
223 LocationSummary* locs,
224 intptr_t try_index)
225 : SlowPathCode(),
226 ic_data_(ic_data),
227 argument_count_(argument_count),
228 deopt_id_(deopt_id),
229 token_pos_(token_pos),
230 locs_(locs),
231 try_index_(try_index) {}
232 virtual ~MegamorphicSlowPath() {}
233
234 private:
235 virtual void EmitNativeCode(FlowGraphCompiler* comp);
236
237 const ICData& ic_data_;
238 intptr_t argument_count_;
239 intptr_t deopt_id_;
240 intptr_t token_pos_;
241 LocationSummary* locs_;
242 const intptr_t try_index_; // For try/catch ranges.
243
244 DISALLOW_COPY_AND_ASSIGN(MegamorphicSlowPath);
245 };
246
247
217 struct CidTarget { 248 struct CidTarget {
218 intptr_t cid; 249 intptr_t cid;
219 Function* target; 250 Function* target;
220 intptr_t count; 251 intptr_t count;
221 CidTarget(intptr_t cid_arg, 252 CidTarget(intptr_t cid_arg,
222 Function* target_arg, 253 Function* target_arg,
223 intptr_t count_arg) 254 intptr_t count_arg)
224 : cid(cid_arg), target(target_arg), count(count_arg) {} 255 : cid(cid_arg), target(target_arg), count(count_arg) {}
225 }; 256 };
226 257
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 intptr_t token_pos, 438 intptr_t token_pos,
408 LocationSummary* locs); 439 LocationSummary* locs);
409 440
410 void EmitPolymorphicInstanceCall(const ICData& ic_data, 441 void EmitPolymorphicInstanceCall(const ICData& ic_data,
411 intptr_t argument_count, 442 intptr_t argument_count,
412 const Array& argument_names, 443 const Array& argument_names,
413 intptr_t deopt_id, 444 intptr_t deopt_id,
414 intptr_t token_pos, 445 intptr_t token_pos,
415 LocationSummary* locs); 446 LocationSummary* locs);
416 447
417 void EmitMegamorphicInstanceCall(const ICData& ic_data, 448 // Pass a value for try-index where block is not available (e.g. slow path).
418 intptr_t argument_count, 449 void EmitMegamorphicInstanceCall(
419 intptr_t deopt_id, 450 const ICData& ic_data,
420 intptr_t token_pos, 451 intptr_t argument_count,
421 LocationSummary* locs); 452 intptr_t deopt_id,
453 intptr_t token_pos,
454 LocationSummary* locs,
455 intptr_t try_index = CatchClauseNode::kInvalidTryIndex);
422 456
423 void EmitSwitchableInstanceCall(const ICData& ic_data, 457 void EmitSwitchableInstanceCall(const ICData& ic_data,
424 intptr_t argument_count, 458 intptr_t argument_count,
425 intptr_t deopt_id, 459 intptr_t deopt_id,
426 intptr_t token_pos, 460 intptr_t token_pos,
427 LocationSummary* locs); 461 LocationSummary* locs);
428 462
429 void EmitTestAndCall(const ICData& ic_data, 463 void EmitTestAndCall(const ICData& ic_data,
430 intptr_t arg_count, 464 intptr_t arg_count,
431 const Array& arg_names, 465 const Array& arg_names,
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 Array& inlined_code_intervals_; 781 Array& inlined_code_intervals_;
748 const GrowableArray<const Function*>& inline_id_to_function_; 782 const GrowableArray<const Function*>& inline_id_to_function_;
749 const GrowableArray<intptr_t>& caller_inline_id_; 783 const GrowableArray<intptr_t>& caller_inline_id_;
750 784
751 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); 785 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler);
752 }; 786 };
753 787
754 } // namespace dart 788 } // namespace dart
755 789
756 #endif // VM_FLOW_GRAPH_COMPILER_H_ 790 #endif // VM_FLOW_GRAPH_COMPILER_H_
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698