OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 // have a function pointer to install in the stack frame that we're | 395 // have a function pointer to install in the stack frame that we're |
396 // building, install a special marker there instead. | 396 // building, install a special marker there instead. |
397 DCHECK(info()->IsStub()); | 397 DCHECK(info()->IsStub()); |
398 __ push(Immediate(Smi::FromInt(StackFrame::STUB))); | 398 __ push(Immediate(Smi::FromInt(StackFrame::STUB))); |
399 // Push a PC inside the function so that the deopt code can find where | 399 // Push a PC inside the function so that the deopt code can find where |
400 // the deopt comes from. It doesn't have to be the precise return | 400 // the deopt comes from. It doesn't have to be the precise return |
401 // address of a "calling" LAZY deopt, it only has to be somewhere | 401 // address of a "calling" LAZY deopt, it only has to be somewhere |
402 // inside the code body. | 402 // inside the code body. |
403 Label push_approx_pc; | 403 Label push_approx_pc; |
404 __ call(&push_approx_pc); | 404 __ call(&push_approx_pc); |
| 405 info()->LogDeoptCallPosition(masm()->pc_offset(), |
| 406 table_entry->deopt_info.inlining_id); |
405 __ bind(&push_approx_pc); | 407 __ bind(&push_approx_pc); |
406 // Push the continuation which was stashed were the ebp should | 408 // Push the continuation which was stashed were the ebp should |
407 // be. Replace it with the saved ebp. | 409 // be. Replace it with the saved ebp. |
408 __ push(MemOperand(esp, 3 * kPointerSize)); | 410 __ push(MemOperand(esp, 3 * kPointerSize)); |
409 __ mov(MemOperand(esp, 4 * kPointerSize), ebp); | 411 __ mov(MemOperand(esp, 4 * kPointerSize), ebp); |
410 __ lea(ebp, MemOperand(esp, 4 * kPointerSize)); | 412 __ lea(ebp, MemOperand(esp, 4 * kPointerSize)); |
411 __ ret(0); // Call the continuation without clobbering registers. | 413 __ ret(0); // Call the continuation without clobbering registers. |
412 } | 414 } |
413 } else { | 415 } else { |
414 __ call(entry, RelocInfo::RUNTIME_ENTRY); | 416 __ call(entry, RelocInfo::RUNTIME_ENTRY); |
| 417 info()->LogDeoptCallPosition(masm()->pc_offset(), |
| 418 table_entry->deopt_info.inlining_id); |
415 } | 419 } |
416 } | 420 } |
417 return !is_aborted(); | 421 return !is_aborted(); |
418 } | 422 } |
419 | 423 |
420 | 424 |
421 bool LCodeGen::GenerateDeferredCode() { | 425 bool LCodeGen::GenerateDeferredCode() { |
422 DCHECK(is_generating()); | 426 DCHECK(is_generating()); |
423 if (deferred_.length() > 0) { | 427 if (deferred_.length() > 0) { |
424 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { | 428 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 __ int3(); | 1147 __ int3(); |
1144 __ bind(&done); | 1148 __ bind(&done); |
1145 } | 1149 } |
1146 | 1150 |
1147 Deoptimizer::DeoptInfo deopt_info = MakeDeoptInfo(instr, deopt_reason); | 1151 Deoptimizer::DeoptInfo deopt_info = MakeDeoptInfo(instr, deopt_reason); |
1148 | 1152 |
1149 DCHECK(info()->IsStub() || frame_is_built_); | 1153 DCHECK(info()->IsStub() || frame_is_built_); |
1150 if (cc == no_condition && frame_is_built_) { | 1154 if (cc == no_condition && frame_is_built_) { |
1151 DeoptComment(deopt_info); | 1155 DeoptComment(deopt_info); |
1152 __ call(entry, RelocInfo::RUNTIME_ENTRY); | 1156 __ call(entry, RelocInfo::RUNTIME_ENTRY); |
| 1157 info()->LogDeoptCallPosition(masm()->pc_offset(), deopt_info.inlining_id); |
1153 } else { | 1158 } else { |
1154 Deoptimizer::JumpTableEntry table_entry(entry, deopt_info, bailout_type, | 1159 Deoptimizer::JumpTableEntry table_entry(entry, deopt_info, bailout_type, |
1155 !frame_is_built_); | 1160 !frame_is_built_); |
1156 // We often have several deopts to the same entry, reuse the last | 1161 // We often have several deopts to the same entry, reuse the last |
1157 // jump entry if this is the case. | 1162 // jump entry if this is the case. |
1158 if (FLAG_trace_deopt || isolate()->cpu_profiler()->is_profiling() || | 1163 if (FLAG_trace_deopt || isolate()->cpu_profiler()->is_profiling() || |
1159 jump_table_.is_empty() || | 1164 jump_table_.is_empty() || |
1160 !table_entry.IsEquivalentTo(jump_table_.last())) { | 1165 !table_entry.IsEquivalentTo(jump_table_.last())) { |
1161 jump_table_.Add(table_entry, zone()); | 1166 jump_table_.Add(table_entry, zone()); |
1162 } | 1167 } |
(...skipping 5224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6387 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6392 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6388 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6393 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6389 } | 6394 } |
6390 | 6395 |
6391 | 6396 |
6392 #undef __ | 6397 #undef __ |
6393 | 6398 |
6394 } } // namespace v8::internal | 6399 } } // namespace v8::internal |
6395 | 6400 |
6396 #endif // V8_TARGET_ARCH_X87 | 6401 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |