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

Side by Side Diff: src/x64/lithium-x64.cc

Issue 6128008: X64 Crankshaft: Add LTemplatedInstruction and some derived classes to lithium... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 11 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/x64/lithium-x64.h ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 13 matching lines...) Expand all
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #include "x64/lithium-x64.h" 28 #include "x64/lithium-x64.h"
29 #include "x64/lithium-codegen-x64.h" 29 #include "x64/lithium-codegen-x64.h"
30 30
31 namespace v8 { 31 namespace v8 {
32 namespace internal { 32 namespace internal {
33 33
34 LOsrEntry::LOsrEntry() {
35 for (int i = 0; i < Register::kNumAllocatableRegisters; ++i) {
36 register_spills_[i] = NULL;
37 }
38 for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; ++i) {
39 double_register_spills_[i] = NULL;
40 }
41 }
42
43
44 void LOsrEntry::MarkSpilledRegister(int allocation_index,
45 LOperand* spill_operand) {
46 ASSERT(spill_operand->IsStackSlot());
47 ASSERT(register_spills_[allocation_index] == NULL);
48 register_spills_[allocation_index] = spill_operand;
49 }
50
51
52 void LOsrEntry::MarkSpilledDoubleRegister(int allocation_index,
53 LOperand* spill_operand) {
54 ASSERT(spill_operand->IsDoubleStackSlot());
55 ASSERT(double_register_spills_[allocation_index] == NULL);
56 double_register_spills_[allocation_index] = spill_operand;
57 }
58
59
60 void LOsrEntry::CompileToNative(LCodeGen* generator) {
61 UNIMPLEMENTED();
62 // Implement in lithium-codegen-x64.cc.
63 }
64
65
66 void LInstruction::PrintTo(StringStream* stream) {
67 stream->Add("%s ", this->Mnemonic());
68 if (HasResult()) {
69 LTemplateInstruction<1>::cast(this)->result()->PrintTo(stream);
70 stream->Add(" ");
71 }
72 PrintDataTo(stream);
73
74 if (HasEnvironment()) {
75 stream->Add(" ");
76 // environment()->PrintTo(stream);
Lasse Reichstein 2011/01/11 11:23:20 What is this commented code?
77 }
78
79 if (HasPointerMap()) {
80 stream->Add(" ");
81 //pointer_map()->PrintTo(stream);
Lasse Reichstein 2011/01/11 11:23:20 Ditto?
82 }
83 }
84
85
86 void LLabel::PrintDataTo(StringStream* stream) {
87 LGap::PrintDataTo(stream);
88 LLabel* rep = replacement();
89 if (rep != NULL) {
90 stream->Add(" Dead block replaced with B%d", rep->block_id());
91 }
92 }
93
94
34 bool LGap::IsRedundant() const { 95 bool LGap::IsRedundant() const {
35 for (int i = 0; i < 4; i++) { 96 for (int i = 0; i < 4; i++) {
36 if (parallel_moves_[i] != NULL && !parallel_moves_[i]->IsRedundant()) { 97 if (parallel_moves_[i] != NULL && !parallel_moves_[i]->IsRedundant()) {
37 return false; 98 return false;
38 } 99 }
39 } 100 }
40 101
41 return true; 102 return true;
42 } 103 }
43 104
44 105
45 void LGap::PrintDataTo(StringStream* stream) const { 106 void LGap::PrintDataTo(StringStream* stream) {
46 for (int i = 0; i < 4; i++) { 107 for (int i = 0; i < 4; i++) {
47 stream->Add("("); 108 stream->Add("(");
48 if (parallel_moves_[i] != NULL) { 109 if (parallel_moves_[i] != NULL) {
49 parallel_moves_[i]->PrintDataTo(stream); 110 parallel_moves_[i]->PrintDataTo(stream);
50 } 111 }
51 stream->Add(") "); 112 stream->Add(") ");
52 } 113 }
53 } 114 }
54 115
55 116
117 void LGoto::PrintDataTo(StringStream* stream) {
118 stream->Add("B%d", block_id());
119 }
120
121
56 LChunk* LChunkBuilder::Build() { 122 LChunk* LChunkBuilder::Build() {
57 ASSERT(is_unused()); 123 ASSERT(is_unused());
58 chunk_ = new LChunk(graph()); 124 chunk_ = new LChunk(graph());
59 HPhase phase("Building chunk", chunk_); 125 HPhase phase("Building chunk", chunk_);
60 status_ = BUILDING; 126 status_ = BUILDING;
61 const ZoneList<HBasicBlock*>* blocks = graph()->blocks(); 127 const ZoneList<HBasicBlock*>* blocks = graph()->blocks();
62 for (int i = 0; i < blocks->length(); i++) { 128 for (int i = 0; i < blocks->length(); i++) {
63 HBasicBlock* next = NULL; 129 HBasicBlock* next = NULL;
64 if (i < blocks->length() - 1) next = blocks->at(i + 1); 130 if (i < blocks->length() - 1) next = blocks->at(i + 1);
65 DoBasicBlock(blocks->at(i), next); 131 DoBasicBlock(blocks->at(i), next);
(...skipping 18 matching lines...) Expand all
84 } 150 }
85 151
86 152
87 void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { 153 void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) {
88 ASSERT(is_building()); 154 ASSERT(is_building());
89 Abort("Lithium not implemented on x64."); 155 Abort("Lithium not implemented on x64.");
90 } 156 }
91 157
92 158
93 } } // namespace v8::internal 159 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698