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

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

Issue 513213002: Generate some intrinsics using our IR. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 private: 55 private:
56 ParallelMoveResolver* resolver_; 56 ParallelMoveResolver* resolver_;
57 Register reg_; 57 Register reg_;
58 bool spilled_; 58 bool spilled_;
59 }; 59 };
60 60
61 61
62 bool IsScratchLocation(Location loc); 62 bool IsScratchLocation(Location loc);
63 intptr_t AllocateScratchRegister(Location::Kind kind, 63 intptr_t AllocateScratchRegister(Location::Kind kind,
64 intptr_t blocked, 64 uword blocked_mask,
65 intptr_t first_free_register, 65 intptr_t first_free_register,
66 intptr_t last_free_register, 66 intptr_t last_free_register,
67 bool* spilled); 67 bool* spilled);
68 68
69 void SpillScratch(Register reg); 69 void SpillScratch(Register reg);
70 void RestoreScratch(Register reg); 70 void RestoreScratch(Register reg);
71 void SpillFpuScratch(FpuRegister reg); 71 void SpillFpuScratch(FpuRegister reg);
72 void RestoreFpuScratch(FpuRegister reg); 72 void RestoreFpuScratch(FpuRegister reg);
73 73
74 // friend class ScratchXmmRegisterScope; 74 // friend class ScratchXmmRegisterScope;
(...skipping 14 matching lines...) Expand all
89 89
90 // Verify the move list before performing moves. 90 // Verify the move list before performing moves.
91 void Verify(); 91 void Verify();
92 92
93 // Helpers for non-trivial source-destination combinations that cannot 93 // Helpers for non-trivial source-destination combinations that cannot
94 // be handled by a single instruction. 94 // be handled by a single instruction.
95 void MoveMemoryToMemory(const Address& dst, const Address& src); 95 void MoveMemoryToMemory(const Address& dst, const Address& src);
96 void StoreObject(const Address& dst, const Object& obj); 96 void StoreObject(const Address& dst, const Object& obj);
97 void Exchange(Register reg, const Address& mem); 97 void Exchange(Register reg, const Address& mem);
98 void Exchange(const Address& mem1, const Address& mem2); 98 void Exchange(const Address& mem1, const Address& mem2);
99 void Exchange(Register reg, intptr_t stack_offset); 99 void Exchange(Register reg, Register base_reg, intptr_t stack_offset);
100 void Exchange(intptr_t stack_offset1, intptr_t stack_offset2); 100 void Exchange(Register base_reg1,
101 intptr_t stack_offset1,
102 Register base_reg2,
103 intptr_t stack_offset2);
101 104
102 FlowGraphCompiler* compiler_; 105 FlowGraphCompiler* compiler_;
103 106
104 // List of moves not yet resolved. 107 // List of moves not yet resolved.
105 GrowableArray<MoveOperands*> moves_; 108 GrowableArray<MoveOperands*> moves_;
106 }; 109 };
107 110
108 111
109 // Used for describing a deoptimization point after call (lazy deoptimization). 112 // Used for describing a deoptimization point after call (lazy deoptimization).
110 // For deoptimization before instruction use class CompilerDeoptInfoWithStub. 113 // For deoptimization before instruction use class CompilerDeoptInfoWithStub.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 285 }
283 BlockEntryInstr* current_block() const { return current_block_; } 286 BlockEntryInstr* current_block() const { return current_block_; }
284 void set_current_block(BlockEntryInstr* value) { 287 void set_current_block(BlockEntryInstr* value) {
285 current_block_ = value; 288 current_block_ = value;
286 } 289 }
287 static bool CanOptimize(); 290 static bool CanOptimize();
288 bool CanOptimizeFunction() const; 291 bool CanOptimizeFunction() const;
289 bool CanOSRFunction() const; 292 bool CanOSRFunction() const;
290 bool is_optimizing() const { return is_optimizing_; } 293 bool is_optimizing() const { return is_optimizing_; }
291 294
295 void EnterIntrinsicMode();
296 void ExitIntrinsicMode();
297 bool intrinsic_mode() const { return intrinsic_mode_; }
298
292 bool ForceSlowPathForStackOverflow() const; 299 bool ForceSlowPathForStackOverflow() const;
293 300
294 const GrowableArray<BlockInfo*>& block_info() const { return block_info_; } 301 const GrowableArray<BlockInfo*>& block_info() const { return block_info_; }
295 ParallelMoveResolver* parallel_move_resolver() { 302 ParallelMoveResolver* parallel_move_resolver() {
296 return &parallel_move_resolver_; 303 return &parallel_move_resolver_;
297 } 304 }
298 305
299 // Constructor is lighweight, major initialization work should occur here. 306 // Constructor is lighweight, major initialization work should occur here.
300 // This makes it easier to measure time spent in the compiler. 307 // This makes it easier to measure time spent in the compiler.
301 void InitCompiler(); 308 void InitCompiler();
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 DescriptorList* pc_descriptors_list_; 617 DescriptorList* pc_descriptors_list_;
611 StackmapTableBuilder* stackmap_table_builder_; 618 StackmapTableBuilder* stackmap_table_builder_;
612 GrowableArray<BlockInfo*> block_info_; 619 GrowableArray<BlockInfo*> block_info_;
613 GrowableArray<CompilerDeoptInfo*> deopt_infos_; 620 GrowableArray<CompilerDeoptInfo*> deopt_infos_;
614 GrowableArray<SlowPathCode*> slow_path_code_; 621 GrowableArray<SlowPathCode*> slow_path_code_;
615 // Stores: [code offset, function, null(code)]. 622 // Stores: [code offset, function, null(code)].
616 const GrowableObjectArray& static_calls_target_table_; 623 const GrowableObjectArray& static_calls_target_table_;
617 const bool is_optimizing_; 624 const bool is_optimizing_;
618 // Set to true if optimized code has IC calls. 625 // Set to true if optimized code has IC calls.
619 bool may_reoptimize_; 626 bool may_reoptimize_;
627 // True while emitting intrinsic code.
628 bool intrinsic_mode_;
629 Label intrinsic_deopt_label_;
620 630
621 const Class& double_class_; 631 const Class& double_class_;
622 const Class& mint_class_; 632 const Class& mint_class_;
623 const Class& float32x4_class_; 633 const Class& float32x4_class_;
624 const Class& float64x2_class_; 634 const Class& float64x2_class_;
625 const Class& int32x4_class_; 635 const Class& int32x4_class_;
626 const Class& list_class_; 636 const Class& list_class_;
627 637
628 ParallelMoveResolver parallel_move_resolver_; 638 ParallelMoveResolver parallel_move_resolver_;
629 639
630 // Currently instructions generate deopt stubs internally by 640 // Currently instructions generate deopt stubs internally by
631 // calling AddDeoptStub. To communicate deoptimization environment 641 // calling AddDeoptStub. To communicate deoptimization environment
632 // that should be used when deoptimizing we store it in this variable. 642 // that should be used when deoptimizing we store it in this variable.
633 // In future AddDeoptStub should be moved out of the instruction template. 643 // In future AddDeoptStub should be moved out of the instruction template.
634 Environment* pending_deoptimization_env_; 644 Environment* pending_deoptimization_env_;
635 645
636 intptr_t entry_patch_pc_offset_; 646 intptr_t entry_patch_pc_offset_;
637 intptr_t patch_code_pc_offset_; 647 intptr_t patch_code_pc_offset_;
638 intptr_t lazy_deopt_pc_offset_; 648 intptr_t lazy_deopt_pc_offset_;
639 649
640 ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data_; 650 ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data_;
641 651
642 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); 652 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler);
643 }; 653 };
644 654
645 } // namespace dart 655 } // namespace dart
646 656
647 #endif // VM_FLOW_GRAPH_COMPILER_H_ 657 #endif // VM_FLOW_GRAPH_COMPILER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698