OLD | NEW |
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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 __ mov(entry_offset, Operand(entry - base)); | 336 __ mov(entry_offset, Operand(entry - base)); |
337 | 337 |
338 if (table_entry->needs_frame) { | 338 if (table_entry->needs_frame) { |
339 DCHECK(!info()->saves_caller_doubles()); | 339 DCHECK(!info()->saves_caller_doubles()); |
340 Comment(";;; call deopt with frame"); | 340 Comment(";;; call deopt with frame"); |
341 __ PushFixedFrame(); | 341 __ PushFixedFrame(); |
342 __ b(&needs_frame, SetLK); | 342 __ b(&needs_frame, SetLK); |
343 } else { | 343 } else { |
344 __ b(&call_deopt_entry, SetLK); | 344 __ b(&call_deopt_entry, SetLK); |
345 } | 345 } |
| 346 info()->LogDeoptCallPosition(masm()->pc_offset(), |
| 347 table_entry->deopt_info.inlining_id); |
346 } | 348 } |
347 | 349 |
348 if (needs_frame.is_linked()) { | 350 if (needs_frame.is_linked()) { |
349 __ bind(&needs_frame); | 351 __ bind(&needs_frame); |
350 // This variant of deopt can only be used with stubs. Since we don't | 352 // This variant of deopt can only be used with stubs. Since we don't |
351 // have a function pointer to install in the stack frame that we're | 353 // have a function pointer to install in the stack frame that we're |
352 // building, install a special marker there instead. | 354 // building, install a special marker there instead. |
353 DCHECK(info()->IsStub()); | 355 DCHECK(info()->IsStub()); |
354 __ LoadSmiLiteral(ip, Smi::FromInt(StackFrame::STUB)); | 356 __ LoadSmiLiteral(ip, Smi::FromInt(StackFrame::STUB)); |
355 __ push(ip); | 357 __ push(ip); |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 } | 804 } |
803 | 805 |
804 Deoptimizer::DeoptInfo deopt_info = MakeDeoptInfo(instr, deopt_reason); | 806 Deoptimizer::DeoptInfo deopt_info = MakeDeoptInfo(instr, deopt_reason); |
805 | 807 |
806 DCHECK(info()->IsStub() || frame_is_built_); | 808 DCHECK(info()->IsStub() || frame_is_built_); |
807 // Go through jump table if we need to handle condition, build frame, or | 809 // Go through jump table if we need to handle condition, build frame, or |
808 // restore caller doubles. | 810 // restore caller doubles. |
809 if (cond == al && frame_is_built_ && !info()->saves_caller_doubles()) { | 811 if (cond == al && frame_is_built_ && !info()->saves_caller_doubles()) { |
810 DeoptComment(deopt_info); | 812 DeoptComment(deopt_info); |
811 __ Call(entry, RelocInfo::RUNTIME_ENTRY); | 813 __ Call(entry, RelocInfo::RUNTIME_ENTRY); |
| 814 info()->LogDeoptCallPosition(masm()->pc_offset(), deopt_info.inlining_id); |
812 } else { | 815 } else { |
813 Deoptimizer::JumpTableEntry table_entry(entry, deopt_info, bailout_type, | 816 Deoptimizer::JumpTableEntry table_entry(entry, deopt_info, bailout_type, |
814 !frame_is_built_); | 817 !frame_is_built_); |
815 // We often have several deopts to the same entry, reuse the last | 818 // We often have several deopts to the same entry, reuse the last |
816 // jump entry if this is the case. | 819 // jump entry if this is the case. |
817 if (FLAG_trace_deopt || isolate()->cpu_profiler()->is_profiling() || | 820 if (FLAG_trace_deopt || isolate()->cpu_profiler()->is_profiling() || |
818 jump_table_.is_empty() || | 821 jump_table_.is_empty() || |
819 !table_entry.IsEquivalentTo(jump_table_.last())) { | 822 !table_entry.IsEquivalentTo(jump_table_.last())) { |
820 jump_table_.Add(table_entry, zone()); | 823 jump_table_.Add(table_entry, zone()); |
821 } | 824 } |
(...skipping 5413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6235 __ Push(scope_info); | 6238 __ Push(scope_info); |
6236 __ push(ToRegister(instr->function())); | 6239 __ push(ToRegister(instr->function())); |
6237 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6240 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6238 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6241 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6239 } | 6242 } |
6240 | 6243 |
6241 | 6244 |
6242 #undef __ | 6245 #undef __ |
6243 } | 6246 } |
6244 } // namespace v8::internal | 6247 } // namespace v8::internal |
OLD | NEW |