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

Side by Side Diff: src/compiler/instruction.h

Issue 635213003: [turbofan] fix block mapping in code comments (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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
« no previous file with comments | « src/compiler/code-generator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_INSTRUCTION_H_ 5 #ifndef V8_COMPILER_INSTRUCTION_H_
6 #define V8_COMPILER_INSTRUCTION_H_ 6 #define V8_COMPILER_INSTRUCTION_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <iosfwd> 9 #include <iosfwd>
10 #include <map> 10 #include <map>
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 }; 591 };
592 592
593 593
594 // This special kind of gap move instruction represents the beginning of a 594 // This special kind of gap move instruction represents the beginning of a
595 // block of code. 595 // block of code.
596 // TODO(titzer): move code_start and code_end from BasicBlock to here. 596 // TODO(titzer): move code_start and code_end from BasicBlock to here.
597 class BlockStartInstruction FINAL : public GapInstruction { 597 class BlockStartInstruction FINAL : public GapInstruction {
598 public: 598 public:
599 Label* label() { return &label_; } 599 Label* label() { return &label_; }
600 BasicBlock::RpoNumber rpo_number() const { return rpo_number_; } 600 BasicBlock::RpoNumber rpo_number() const { return rpo_number_; }
601 BasicBlock::Id id() const { return id_; }
601 602
602 static BlockStartInstruction* New(Zone* zone, BasicBlock* block) { 603 static BlockStartInstruction* New(Zone* zone, BasicBlock* block) {
603 void* buffer = zone->New(sizeof(BlockStartInstruction)); 604 void* buffer = zone->New(sizeof(BlockStartInstruction));
604 return new (buffer) BlockStartInstruction(block); 605 return new (buffer) BlockStartInstruction(block);
605 } 606 }
606 607
607 static BlockStartInstruction* cast(Instruction* instr) { 608 static BlockStartInstruction* cast(Instruction* instr) {
608 DCHECK(instr->IsBlockStart()); 609 DCHECK(instr->IsBlockStart());
609 return static_cast<BlockStartInstruction*>(instr); 610 return static_cast<BlockStartInstruction*>(instr);
610 } 611 }
611 612
612 private: 613 private:
613 explicit BlockStartInstruction(BasicBlock* block) 614 explicit BlockStartInstruction(BasicBlock* block)
614 : GapInstruction(kBlockStartInstruction), 615 : GapInstruction(kBlockStartInstruction),
616 id_(block->id()),
615 rpo_number_(block->GetRpoNumber()) {} 617 rpo_number_(block->GetRpoNumber()) {}
616 618
619 BasicBlock::Id id_;
617 BasicBlock::RpoNumber rpo_number_; 620 BasicBlock::RpoNumber rpo_number_;
618 Label label_; 621 Label label_;
619 }; 622 };
620 623
621 624
622 class SourcePositionInstruction FINAL : public Instruction { 625 class SourcePositionInstruction FINAL : public Instruction {
623 public: 626 public:
624 static SourcePositionInstruction* New(Zone* zone, SourcePosition position) { 627 static SourcePositionInstruction* New(Zone* zone, SourcePosition position) {
625 void* buffer = zone->New(sizeof(SourcePositionInstruction)); 628 void* buffer = zone->New(sizeof(SourcePositionInstruction));
626 return new (buffer) SourcePositionInstruction(position); 629 return new (buffer) SourcePositionInstruction(position);
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 DeoptimizationVector deoptimization_entries_; 950 DeoptimizationVector deoptimization_entries_;
948 }; 951 };
949 952
950 std::ostream& operator<<(std::ostream& os, const InstructionSequence& code); 953 std::ostream& operator<<(std::ostream& os, const InstructionSequence& code);
951 954
952 } // namespace compiler 955 } // namespace compiler
953 } // namespace internal 956 } // namespace internal
954 } // namespace v8 957 } // namespace v8
955 958
956 #endif // V8_COMPILER_INSTRUCTION_H_ 959 #endif // V8_COMPILER_INSTRUCTION_H_
OLDNEW
« no previous file with comments | « src/compiler/code-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698