| 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 3535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3546 | 3546 |
| 3547 | 3547 |
| 3548 void LCodeGen::DoTailCallThroughMegamorphicCache( | 3548 void LCodeGen::DoTailCallThroughMegamorphicCache( |
| 3549 LTailCallThroughMegamorphicCache* instr) { | 3549 LTailCallThroughMegamorphicCache* instr) { |
| 3550 Register receiver = ToRegister(instr->receiver()); | 3550 Register receiver = ToRegister(instr->receiver()); |
| 3551 Register name = ToRegister(instr->name()); | 3551 Register name = ToRegister(instr->name()); |
| 3552 DCHECK(receiver.is(LoadDescriptor::ReceiverRegister())); | 3552 DCHECK(receiver.is(LoadDescriptor::ReceiverRegister())); |
| 3553 DCHECK(name.is(LoadDescriptor::NameRegister())); | 3553 DCHECK(name.is(LoadDescriptor::NameRegister())); |
| 3554 Register scratch = rdi; | 3554 Register scratch = rdi; |
| 3555 DCHECK(!scratch.is(receiver) && !scratch.is(name)); | 3555 DCHECK(!scratch.is(receiver) && !scratch.is(name)); |
| 3556 DCHECK(!FLAG_vector_ics || | |
| 3557 !AreAliased(ToRegister(instr->slot()), ToRegister(instr->vector()), | |
| 3558 scratch)); | |
| 3559 | 3556 |
| 3560 // Important for the tail-call. | 3557 // The probe will tail call to a handler if found. |
| 3561 bool must_teardown_frame = NeedsEagerFrame(); | 3558 isolate()->stub_cache()->GenerateProbe(masm(), Code::LOAD_IC, |
| 3559 instr->hydrogen()->flags(), false, |
| 3560 receiver, name, scratch, no_reg); |
| 3562 | 3561 |
| 3563 if (!instr->hydrogen()->is_just_miss()) { | 3562 LoadIC::GenerateMiss(masm()); |
| 3564 // The probe will tail call to a handler if found. | |
| 3565 DCHECK(!instr->hydrogen()->is_keyed_load()); | |
| 3566 isolate()->stub_cache()->GenerateProbe( | |
| 3567 masm(), Code::LOAD_IC, instr->hydrogen()->flags(), must_teardown_frame, | |
| 3568 receiver, name, scratch, no_reg); | |
| 3569 } | |
| 3570 | |
| 3571 // Tail call to miss if we ended up here. | |
| 3572 if (must_teardown_frame) __ leave(); | |
| 3573 if (instr->hydrogen()->is_keyed_load()) { | |
| 3574 KeyedLoadIC::GenerateMiss(masm()); | |
| 3575 } else { | |
| 3576 LoadIC::GenerateMiss(masm()); | |
| 3577 } | |
| 3578 } | 3563 } |
| 3579 | 3564 |
| 3580 | 3565 |
| 3581 void LCodeGen::DoCallWithDescriptor(LCallWithDescriptor* instr) { | 3566 void LCodeGen::DoCallWithDescriptor(LCallWithDescriptor* instr) { |
| 3582 DCHECK(ToRegister(instr->result()).is(rax)); | 3567 DCHECK(ToRegister(instr->result()).is(rax)); |
| 3583 | 3568 |
| 3584 if (instr->hydrogen()->IsTailCall()) { | 3569 if (instr->hydrogen()->IsTailCall()) { |
| 3585 if (NeedsEagerFrame()) __ leave(); | 3570 if (NeedsEagerFrame()) __ leave(); |
| 3586 | 3571 |
| 3587 if (instr->target()->IsConstantOperand()) { | 3572 if (instr->target()->IsConstantOperand()) { |
| (...skipping 2338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5926 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5911 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5927 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5912 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5928 } | 5913 } |
| 5929 | 5914 |
| 5930 | 5915 |
| 5931 #undef __ | 5916 #undef __ |
| 5932 | 5917 |
| 5933 } } // namespace v8::internal | 5918 } } // namespace v8::internal |
| 5934 | 5919 |
| 5935 #endif // V8_TARGET_ARCH_X64 | 5920 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |