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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 DCHECK(!info()->saves_caller_doubles()); | 310 DCHECK(!info()->saves_caller_doubles()); |
311 __ Move(kScratchRegister, ExternalReference::ForDeoptEntry(entry)); | 311 __ Move(kScratchRegister, ExternalReference::ForDeoptEntry(entry)); |
312 __ call(&needs_frame); | 312 __ call(&needs_frame); |
313 } else { | 313 } else { |
314 if (info()->saves_caller_doubles()) { | 314 if (info()->saves_caller_doubles()) { |
315 DCHECK(info()->IsStub()); | 315 DCHECK(info()->IsStub()); |
316 RestoreCallerDoubles(); | 316 RestoreCallerDoubles(); |
317 } | 317 } |
318 __ call(entry, RelocInfo::RUNTIME_ENTRY); | 318 __ call(entry, RelocInfo::RUNTIME_ENTRY); |
319 } | 319 } |
| 320 info()->LogDeoptCallPosition(masm()->pc_offset(), |
| 321 table_entry->deopt_info.inlining_id); |
320 } | 322 } |
321 | 323 |
322 if (needs_frame.is_linked()) { | 324 if (needs_frame.is_linked()) { |
323 __ bind(&needs_frame); | 325 __ bind(&needs_frame); |
324 /* stack layout | 326 /* stack layout |
325 4: return address <-- rsp | 327 4: return address <-- rsp |
326 3: garbage | 328 3: garbage |
327 2: garbage | 329 2: garbage |
328 1: garbage | 330 1: garbage |
329 0: garbage | 331 0: garbage |
(...skipping 21 matching lines...) Expand all Loading... |
351 __ movp(MemOperand(rsp, 4 * kPointerSize), rbp); | 353 __ movp(MemOperand(rsp, 4 * kPointerSize), rbp); |
352 __ leap(rbp, MemOperand(rsp, 4 * kPointerSize)); | 354 __ leap(rbp, MemOperand(rsp, 4 * kPointerSize)); |
353 | 355 |
354 // This variant of deopt can only be used with stubs. Since we don't | 356 // This variant of deopt can only be used with stubs. Since we don't |
355 // have a function pointer to install in the stack frame that we're | 357 // have a function pointer to install in the stack frame that we're |
356 // building, install a special marker there instead. | 358 // building, install a special marker there instead. |
357 DCHECK(info()->IsStub()); | 359 DCHECK(info()->IsStub()); |
358 __ Move(MemOperand(rsp, 2 * kPointerSize), Smi::FromInt(StackFrame::STUB)); | 360 __ Move(MemOperand(rsp, 2 * kPointerSize), Smi::FromInt(StackFrame::STUB)); |
359 | 361 |
360 /* stack layout | 362 /* stack layout |
361 4: old ebp | 363 4: old rbp |
362 3: context pointer | 364 3: context pointer |
363 2: stub marker | 365 2: stub marker |
364 1: return address | 366 1: return address |
365 0: entry address <-- rsp | 367 0: entry address <-- rsp |
366 */ | 368 */ |
367 __ ret(0); | 369 __ ret(0); |
368 } | 370 } |
369 | 371 |
370 return !is_aborted(); | 372 return !is_aborted(); |
371 } | 373 } |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 | 806 |
805 Deoptimizer::DeoptInfo deopt_info = MakeDeoptInfo(instr, deopt_reason); | 807 Deoptimizer::DeoptInfo deopt_info = MakeDeoptInfo(instr, deopt_reason); |
806 | 808 |
807 DCHECK(info()->IsStub() || frame_is_built_); | 809 DCHECK(info()->IsStub() || frame_is_built_); |
808 // Go through jump table if we need to handle condition, build frame, or | 810 // Go through jump table if we need to handle condition, build frame, or |
809 // restore caller doubles. | 811 // restore caller doubles. |
810 if (cc == no_condition && frame_is_built_ && | 812 if (cc == no_condition && frame_is_built_ && |
811 !info()->saves_caller_doubles()) { | 813 !info()->saves_caller_doubles()) { |
812 DeoptComment(deopt_info); | 814 DeoptComment(deopt_info); |
813 __ call(entry, RelocInfo::RUNTIME_ENTRY); | 815 __ call(entry, RelocInfo::RUNTIME_ENTRY); |
| 816 info()->LogDeoptCallPosition(masm()->pc_offset(), deopt_info.inlining_id); |
814 } else { | 817 } else { |
815 Deoptimizer::JumpTableEntry table_entry(entry, deopt_info, bailout_type, | 818 Deoptimizer::JumpTableEntry table_entry(entry, deopt_info, bailout_type, |
816 !frame_is_built_); | 819 !frame_is_built_); |
817 // We often have several deopts to the same entry, reuse the last | 820 // We often have several deopts to the same entry, reuse the last |
818 // jump entry if this is the case. | 821 // jump entry if this is the case. |
819 if (FLAG_trace_deopt || isolate()->cpu_profiler()->is_profiling() || | 822 if (FLAG_trace_deopt || isolate()->cpu_profiler()->is_profiling() || |
820 jump_table_.is_empty() || | 823 jump_table_.is_empty() || |
821 !table_entry.IsEquivalentTo(jump_table_.last())) { | 824 !table_entry.IsEquivalentTo(jump_table_.last())) { |
822 jump_table_.Add(table_entry, zone()); | 825 jump_table_.Add(table_entry, zone()); |
823 } | 826 } |
(...skipping 5148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5972 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5975 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5973 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5976 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5974 } | 5977 } |
5975 | 5978 |
5976 | 5979 |
5977 #undef __ | 5980 #undef __ |
5978 | 5981 |
5979 } } // namespace v8::internal | 5982 } } // namespace v8::internal |
5980 | 5983 |
5981 #endif // V8_TARGET_ARCH_X64 | 5984 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |