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

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

Issue 335173002: Save ICData of unoptimized code in the function, thus preserving it across repated unoptimized comp… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 } 450 }
451 return current_block_->try_index(); 451 return current_block_->try_index();
452 } 452 }
453 453
454 bool may_reoptimize() const { return may_reoptimize_; } 454 bool may_reoptimize() const { return may_reoptimize_; }
455 455
456 // Returns 'sorted' array in decreasing count order. 456 // Returns 'sorted' array in decreasing count order.
457 static void SortICDataByCount(const ICData& ic_data, 457 static void SortICDataByCount(const ICData& ic_data,
458 GrowableArray<CidTarget>* sorted); 458 GrowableArray<CidTarget>* sorted);
459 459
460 // Use in unoptimized compilation to preserve/reuse ICData.
461 const ICData* InstanceCallICData(intptr_t deopt_id,
462 const String& target_name,
463 const Array& arguments_descriptor,
464 intptr_t num_args_tested);
465
466 const ICData* StaticCallICData(intptr_t deopt_id,
467 const Function& target,
468 const Array& arguments_descriptor,
469 intptr_t num_args_tested);
470
471 const ZoneGrowableArray<const ICData*>& deopt_id_to_ic_data() const {
472 return *deopt_id_to_ic_data_;
473 }
474
460 private: 475 private:
461 friend class CheckStackOverflowSlowPath; // For pending_deoptimization_env_. 476 friend class CheckStackOverflowSlowPath; // For pending_deoptimization_env_.
462 477
463 Isolate* isolate() const { return isolate_; } 478 Isolate* isolate() const { return isolate_; }
464 479
465 void EmitFrameEntry(); 480 void EmitFrameEntry();
466 481
467 void AddStaticCallTarget(const Function& function); 482 void AddStaticCallTarget(const Function& function);
468 483
469 void GenerateDeferredCode(); 484 void GenerateDeferredCode();
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 // Currently instructions generate deopt stubs internally by 611 // Currently instructions generate deopt stubs internally by
597 // calling AddDeoptStub. To communicate deoptimization environment 612 // calling AddDeoptStub. To communicate deoptimization environment
598 // that should be used when deoptimizing we store it in this variable. 613 // that should be used when deoptimizing we store it in this variable.
599 // In future AddDeoptStub should be moved out of the instruction template. 614 // In future AddDeoptStub should be moved out of the instruction template.
600 Environment* pending_deoptimization_env_; 615 Environment* pending_deoptimization_env_;
601 616
602 intptr_t entry_patch_pc_offset_; 617 intptr_t entry_patch_pc_offset_;
603 intptr_t patch_code_pc_offset_; 618 intptr_t patch_code_pc_offset_;
604 intptr_t lazy_deopt_pc_offset_; 619 intptr_t lazy_deopt_pc_offset_;
605 620
621 ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data_;
622
606 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); 623 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler);
607 }; 624 };
608 625
609 } // namespace dart 626 } // namespace dart
610 627
611 #endif // VM_FLOW_GRAPH_COMPILER_H_ 628 #endif // VM_FLOW_GRAPH_COMPILER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698