OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/lithium-codegen.h" | 5 #include "src/lithium-codegen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // Copy the string before recording it in the assembler to avoid | 146 // Copy the string before recording it in the assembler to avoid |
147 // issues when the stack allocated buffer goes out of scope. | 147 // issues when the stack allocated buffer goes out of scope. |
148 size_t length = builder.position(); | 148 size_t length = builder.position(); |
149 Vector<char> copy = Vector<char>::New(static_cast<int>(length) + 1); | 149 Vector<char> copy = Vector<char>::New(static_cast<int>(length) + 1); |
150 MemCopy(copy.start(), builder.Finalize(), copy.length()); | 150 MemCopy(copy.start(), builder.Finalize(), copy.length()); |
151 masm()->RecordComment(copy.start()); | 151 masm()->RecordComment(copy.start()); |
152 } | 152 } |
153 | 153 |
154 | 154 |
155 void LCodeGenBase::DeoptComment(const Deoptimizer::Reason& reason) { | 155 void LCodeGenBase::DeoptComment(const Deoptimizer::Reason& reason) { |
156 masm()->RecordDeoptReason(reason.deopt_reason, reason.raw_position); | 156 std::ostringstream os; |
| 157 os << ";;; deoptimize at " << HSourcePosition(reason.raw_position) << " " |
| 158 << reason.mnemonic; |
| 159 if (reason.detail != NULL) os << ": " << reason.detail; |
| 160 Comment("%s", os.str().c_str()); |
157 } | 161 } |
158 | 162 |
159 | 163 |
160 int LCodeGenBase::GetNextEmittedBlock() const { | 164 int LCodeGenBase::GetNextEmittedBlock() const { |
161 for (int i = current_block_ + 1; i < graph()->blocks()->length(); ++i) { | 165 for (int i = current_block_ + 1; i < graph()->blocks()->length(); ++i) { |
162 if (!graph()->blocks()->at(i)->IsReachable()) continue; | 166 if (!graph()->blocks()->at(i)->IsReachable()) continue; |
163 if (!chunk_->GetLabel(i)->HasReplacement()) return i; | 167 if (!chunk_->GetLabel(i)->HasReplacement()) return i; |
164 } | 168 } |
165 return -1; | 169 return -1; |
166 } | 170 } |
(...skipping 16 matching lines...) Expand all Loading... |
183 chunk_->AddDeprecationDependency(map); | 187 chunk_->AddDeprecationDependency(map); |
184 } | 188 } |
185 | 189 |
186 | 190 |
187 void LCodeGenBase::AddStabilityDependency(Handle<Map> map) { | 191 void LCodeGenBase::AddStabilityDependency(Handle<Map> map) { |
188 if (!map->is_stable()) return Retry(kMapBecameUnstable); | 192 if (!map->is_stable()) return Retry(kMapBecameUnstable); |
189 chunk_->AddStabilityDependency(map); | 193 chunk_->AddStabilityDependency(map); |
190 } | 194 } |
191 | 195 |
192 } } // namespace v8::internal | 196 } } // namespace v8::internal |
OLD | NEW |