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

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

Issue 14740005: Initial support for polymorphic inlining. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 intptr_t index_scale, 445 intptr_t index_scale,
446 Register array, 446 Register array,
447 Register index); 447 Register index);
448 static Address ExternalElementAddressForIntIndex(intptr_t index_scale, 448 static Address ExternalElementAddressForIntIndex(intptr_t index_scale,
449 Register array, 449 Register array,
450 intptr_t offset); 450 intptr_t offset);
451 static Address ExternalElementAddressForRegIndex(intptr_t index_scale, 451 static Address ExternalElementAddressForRegIndex(intptr_t index_scale,
452 Register array, 452 Register array,
453 Register index); 453 Register index);
454 454
455 // Returns 'sorted' array in decreasing count order.
456 static void SortICDataByCount(const ICData& ic_data,
457 GrowableArray<CidTarget>* sorted);
458
455 private: 459 private:
456 friend class CheckStackOverflowSlowPath; // For pending_deoptimization_env_. 460 friend class CheckStackOverflowSlowPath; // For pending_deoptimization_env_.
457 461
458 void EmitFrameEntry(); 462 void EmitFrameEntry();
459 463
460 void AddStaticCallTarget(const Function& function); 464 void AddStaticCallTarget(const Function& function);
461 465
462 void GenerateDeferredCode(); 466 void GenerateDeferredCode();
463 467
464 void EmitInstructionPrologue(Instruction* instr); 468 void EmitInstructionPrologue(Instruction* instr);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 // Perform a greedy local register allocation. Consider all registers free. 538 // Perform a greedy local register allocation. Consider all registers free.
535 void AllocateRegistersLocally(Instruction* instr); 539 void AllocateRegistersLocally(Instruction* instr);
536 540
537 // Map a block number in a forward iteration into the block number in the 541 // Map a block number in a forward iteration into the block number in the
538 // corresponding reverse iteration. Used to obtain an index into 542 // corresponding reverse iteration. Used to obtain an index into
539 // block_order for reverse iterations. 543 // block_order for reverse iterations.
540 intptr_t reverse_index(intptr_t index) const { 544 intptr_t reverse_index(intptr_t index) const {
541 return block_order_.length() - index - 1; 545 return block_order_.length() - index - 1;
542 } 546 }
543 547
544 // Returns 'sorted' array in decreasing count order.
545 // The expected number of elements to sort is less than 10.
546 static void SortICDataByCount(const ICData& ic_data,
547 GrowableArray<CidTarget>* sorted);
548
549 void CompactBlock(BlockEntryInstr* block); 548 void CompactBlock(BlockEntryInstr* block);
550 void CompactBlocks(); 549 void CompactBlocks();
551 550
552 class Assembler* assembler_; 551 class Assembler* assembler_;
553 const ParsedFunction& parsed_function_; 552 const ParsedFunction& parsed_function_;
554 const FlowGraph& flow_graph_; 553 const FlowGraph& flow_graph_;
555 const GrowableArray<BlockEntryInstr*>& block_order_; 554 const GrowableArray<BlockEntryInstr*>& block_order_;
556 555
557 // Compiler specific per-block state. Indexed by postorder block number 556 // Compiler specific per-block state. Indexed by postorder block number
558 // for convenience. This is not the block's index in the block order, 557 // for convenience. This is not the block's index in the block order,
(...skipping 22 matching lines...) Expand all
581 // that should be used when deoptimizing we store it in this variable. 580 // that should be used when deoptimizing we store it in this variable.
582 // In future AddDeoptStub should be moved out of the instruction template. 581 // In future AddDeoptStub should be moved out of the instruction template.
583 Environment* pending_deoptimization_env_; 582 Environment* pending_deoptimization_env_;
584 583
585 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); 584 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler);
586 }; 585 };
587 586
588 } // namespace dart 587 } // namespace dart
589 588
590 #endif // VM_FLOW_GRAPH_COMPILER_H_ 589 #endif // VM_FLOW_GRAPH_COMPILER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698