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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 3455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3466 } | 3466 } |
3467 } | 3467 } |
3468 | 3468 |
3469 | 3469 |
3470 void LCodeGen::DoTailCallThroughMegamorphicCache( | 3470 void LCodeGen::DoTailCallThroughMegamorphicCache( |
3471 LTailCallThroughMegamorphicCache* instr) { | 3471 LTailCallThroughMegamorphicCache* instr) { |
3472 Register receiver = ToRegister(instr->receiver()); | 3472 Register receiver = ToRegister(instr->receiver()); |
3473 Register name = ToRegister(instr->name()); | 3473 Register name = ToRegister(instr->name()); |
3474 DCHECK(receiver.is(LoadDescriptor::ReceiverRegister())); | 3474 DCHECK(receiver.is(LoadDescriptor::ReceiverRegister())); |
3475 DCHECK(name.is(LoadDescriptor::NameRegister())); | 3475 DCHECK(name.is(LoadDescriptor::NameRegister())); |
3476 Register slot = FLAG_vector_ics ? ToRegister(instr->slot()) : no_reg; | |
3477 Register vector = FLAG_vector_ics ? ToRegister(instr->vector()) : no_reg; | |
3478 | |
3479 Register scratch = ebx; | 3476 Register scratch = ebx; |
3480 Register extra = edi; | 3477 Register extra = edi; |
3481 DCHECK(!extra.is(slot) && !extra.is(vector)); | |
3482 DCHECK(!scratch.is(receiver) && !scratch.is(name)); | 3478 DCHECK(!scratch.is(receiver) && !scratch.is(name)); |
3483 DCHECK(!extra.is(receiver) && !extra.is(name)); | 3479 DCHECK(!extra.is(receiver) && !extra.is(name)); |
3484 | 3480 |
3485 // Important for the tail-call. | 3481 // The probe will tail call to a handler if found. |
3486 bool must_teardown_frame = NeedsEagerFrame(); | 3482 // If --vector-ics is on, then it knows to pop the two args first. |
| 3483 isolate()->stub_cache()->GenerateProbe(masm(), Code::LOAD_IC, |
| 3484 instr->hydrogen()->flags(), false, |
| 3485 receiver, name, scratch, extra); |
3487 | 3486 |
3488 if (!instr->hydrogen()->is_just_miss()) { | 3487 LoadIC::GenerateMiss(masm()); |
3489 if (FLAG_vector_ics) { | |
3490 __ push(slot); | |
3491 __ push(vector); | |
3492 } | |
3493 | |
3494 // The probe will tail call to a handler if found. | |
3495 // If --vector-ics is on, then it knows to pop the two args first. | |
3496 DCHECK(!instr->hydrogen()->is_keyed_load()); | |
3497 isolate()->stub_cache()->GenerateProbe( | |
3498 masm(), Code::LOAD_IC, instr->hydrogen()->flags(), must_teardown_frame, | |
3499 receiver, name, scratch, extra); | |
3500 | |
3501 if (FLAG_vector_ics) { | |
3502 __ pop(vector); | |
3503 __ pop(slot); | |
3504 } | |
3505 } | |
3506 | |
3507 // Tail call to miss if we ended up here. | |
3508 if (must_teardown_frame) __ leave(); | |
3509 if (instr->hydrogen()->is_keyed_load()) { | |
3510 KeyedLoadIC::GenerateMiss(masm()); | |
3511 } else { | |
3512 LoadIC::GenerateMiss(masm()); | |
3513 } | |
3514 } | 3488 } |
3515 | 3489 |
3516 | 3490 |
3517 void LCodeGen::DoCallWithDescriptor(LCallWithDescriptor* instr) { | 3491 void LCodeGen::DoCallWithDescriptor(LCallWithDescriptor* instr) { |
3518 DCHECK(ToRegister(instr->result()).is(eax)); | 3492 DCHECK(ToRegister(instr->result()).is(eax)); |
3519 | 3493 |
3520 if (instr->hydrogen()->IsTailCall()) { | 3494 if (instr->hydrogen()->IsTailCall()) { |
3521 if (NeedsEagerFrame()) __ leave(); | 3495 if (NeedsEagerFrame()) __ leave(); |
3522 | 3496 |
3523 if (instr->target()->IsConstantOperand()) { | 3497 if (instr->target()->IsConstantOperand()) { |
(...skipping 2238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5762 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5736 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5763 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5737 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5764 } | 5738 } |
5765 | 5739 |
5766 | 5740 |
5767 #undef __ | 5741 #undef __ |
5768 | 5742 |
5769 } } // namespace v8::internal | 5743 } } // namespace v8::internal |
5770 | 5744 |
5771 #endif // V8_TARGET_ARCH_IA32 | 5745 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |