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/crankshaft/lithium-codegen.h" | 5 #include "src/crankshaft/lithium-codegen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #if V8_TARGET_ARCH_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
10 #include "src/crankshaft/ia32/lithium-ia32.h" // NOLINT | 10 #include "src/crankshaft/ia32/lithium-ia32.h" // NOLINT |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // issues when the stack allocated buffer goes out of scope. | 151 // issues when the stack allocated buffer goes out of scope. |
152 size_t length = builder.position(); | 152 size_t length = builder.position(); |
153 Vector<char> copy = Vector<char>::New(static_cast<int>(length) + 1); | 153 Vector<char> copy = Vector<char>::New(static_cast<int>(length) + 1); |
154 MemCopy(copy.start(), builder.Finalize(), copy.length()); | 154 MemCopy(copy.start(), builder.Finalize(), copy.length()); |
155 masm()->RecordComment(copy.start()); | 155 masm()->RecordComment(copy.start()); |
156 } | 156 } |
157 | 157 |
158 | 158 |
159 void LCodeGenBase::DeoptComment(const Deoptimizer::DeoptInfo& deopt_info) { | 159 void LCodeGenBase::DeoptComment(const Deoptimizer::DeoptInfo& deopt_info) { |
160 SourcePosition position = deopt_info.position; | 160 SourcePosition position = deopt_info.position; |
161 int inlining_id = deopt_info.inlining_id; | 161 int deopt_id = deopt_info.deopt_id; |
162 int raw_position = position.IsUnknown() ? 0 : position.raw(); | 162 int raw_position = position.IsUnknown() ? 0 : position.raw(); |
163 masm()->RecordDeoptReason(deopt_info.deopt_reason, raw_position, inlining_id); | 163 masm()->RecordDeoptReason(deopt_info.deopt_reason, raw_position, deopt_id); |
164 } | 164 } |
165 | 165 |
166 | 166 |
167 int LCodeGenBase::GetNextEmittedBlock() const { | 167 int LCodeGenBase::GetNextEmittedBlock() const { |
168 for (int i = current_block_ + 1; i < graph()->blocks()->length(); ++i) { | 168 for (int i = current_block_ + 1; i < graph()->blocks()->length(); ++i) { |
169 if (!graph()->blocks()->at(i)->IsReachable()) continue; | 169 if (!graph()->blocks()->at(i)->IsReachable()) continue; |
170 if (!chunk_->GetLabel(i)->HasReplacement()) return i; | 170 if (!chunk_->GetLabel(i)->HasReplacement()) return i; |
171 } | 171 } |
172 return -1; | 172 return -1; |
173 } | 173 } |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 359 |
360 // Define deoptimization literals for all unoptimized code objects of inlined | 360 // Define deoptimization literals for all unoptimized code objects of inlined |
361 // functions. This ensures unoptimized code is kept alive by optimized code. | 361 // functions. This ensures unoptimized code is kept alive by optimized code. |
362 AllowDeferredHandleDereference allow_shared_function_info_dereference; | 362 AllowDeferredHandleDereference allow_shared_function_info_dereference; |
363 for (Handle<SharedFunctionInfo> function : chunk()->inlined_functions()) { | 363 for (Handle<SharedFunctionInfo> function : chunk()->inlined_functions()) { |
364 DefineDeoptimizationLiteral(handle(function->code())); | 364 DefineDeoptimizationLiteral(handle(function->code())); |
365 } | 365 } |
366 } | 366 } |
367 | 367 |
368 Deoptimizer::DeoptInfo LCodeGenBase::MakeDeoptInfo( | 368 Deoptimizer::DeoptInfo LCodeGenBase::MakeDeoptInfo( |
369 LInstruction* instr, Deoptimizer::DeoptReason deopt_reason) { | 369 LInstruction* instr, Deoptimizer::DeoptReason deopt_reason, int deopt_id) { |
370 HEnterInlined* enter_inlined = instr->environment()->entry(); | |
371 int inlining_id = enter_inlined ? enter_inlined->inlining_id() : 0; | |
372 Deoptimizer::DeoptInfo deopt_info(instr->hydrogen_value()->position(), | 370 Deoptimizer::DeoptInfo deopt_info(instr->hydrogen_value()->position(), |
373 deopt_reason, inlining_id); | 371 deopt_reason, deopt_id); |
374 return deopt_info; | 372 return deopt_info; |
375 } | 373 } |
376 } // namespace internal | 374 } // namespace internal |
377 } // namespace v8 | 375 } // namespace v8 |
OLD | NEW |