OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 // r0: elements | 479 // r0: elements |
480 // Search the dictionary - put result in register r1. | 480 // Search the dictionary - put result in register r1. |
481 GenerateDictionaryLoad(masm, &miss, r0, r2, r1, r3, r4); | 481 GenerateDictionaryLoad(masm, &miss, r0, r2, r1, r3, r4); |
482 | 482 |
483 GenerateFunctionTailCall(masm, argc, &miss, r4); | 483 GenerateFunctionTailCall(masm, argc, &miss, r4); |
484 | 484 |
485 __ bind(&miss); | 485 __ bind(&miss); |
486 } | 486 } |
487 | 487 |
488 | 488 |
489 static void GenerateCallMiss(MacroAssembler* masm, | 489 void CallICBase::GenerateMiss(MacroAssembler* masm, |
490 int argc, | 490 int argc, |
491 IC::UtilityId id, | 491 IC::UtilityId id, |
492 Code::ExtraICState extra_ic_state) { | 492 Code::ExtraICState extra_state) { |
493 // ----------- S t a t e ------------- | 493 // ----------- S t a t e ------------- |
494 // -- r2 : name | 494 // -- r2 : name |
495 // -- lr : return address | 495 // -- lr : return address |
496 // ----------------------------------- | 496 // ----------------------------------- |
497 Isolate* isolate = masm->isolate(); | 497 Isolate* isolate = masm->isolate(); |
498 | 498 |
499 if (id == IC::kCallIC_Miss) { | 499 if (id == IC::kCallIC_Miss) { |
500 __ IncrementCounter(isolate->counters()->call_miss(), 1, r3, r4); | 500 __ IncrementCounter(isolate->counters()->call_miss(), 1, r3, r4); |
501 } else { | 501 } else { |
502 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, r3, r4); | 502 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, r3, r4); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 __ b(ne, &invoke); | 534 __ b(ne, &invoke); |
535 | 535 |
536 // Patch the receiver on the stack. | 536 // Patch the receiver on the stack. |
537 __ bind(&global); | 537 __ bind(&global); |
538 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset)); | 538 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset)); |
539 __ str(r2, MemOperand(sp, argc * kPointerSize)); | 539 __ str(r2, MemOperand(sp, argc * kPointerSize)); |
540 __ bind(&invoke); | 540 __ bind(&invoke); |
541 } | 541 } |
542 | 542 |
543 // Invoke the function. | 543 // Invoke the function. |
544 CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state) | 544 CallKind call_kind = CallICBase::Contextual::decode(extra_state) |
545 ? CALL_AS_FUNCTION | 545 ? CALL_AS_FUNCTION |
546 : CALL_AS_METHOD; | 546 : CALL_AS_METHOD; |
547 ParameterCount actual(argc); | 547 ParameterCount actual(argc); |
548 __ InvokeFunction(r1, | 548 __ InvokeFunction(r1, |
549 actual, | 549 actual, |
550 JUMP_FUNCTION, | 550 JUMP_FUNCTION, |
551 NullCallWrapper(), | 551 NullCallWrapper(), |
552 call_kind); | 552 call_kind); |
553 } | 553 } |
554 | 554 |
555 | 555 |
556 void CallIC::GenerateMiss(MacroAssembler* masm, | |
557 int argc, | |
558 Code::ExtraICState extra_ic_state) { | |
559 // ----------- S t a t e ------------- | |
560 // -- r2 : name | |
561 // -- lr : return address | |
562 // ----------------------------------- | |
563 | |
564 GenerateCallMiss(masm, argc, IC::kCallIC_Miss, extra_ic_state); | |
565 } | |
566 | |
567 | |
568 void CallIC::GenerateMegamorphic(MacroAssembler* masm, | 556 void CallIC::GenerateMegamorphic(MacroAssembler* masm, |
569 int argc, | 557 int argc, |
570 Code::ExtraICState extra_ic_state) { | 558 Code::ExtraICState extra_ic_state) { |
571 // ----------- S t a t e ------------- | 559 // ----------- S t a t e ------------- |
572 // -- r2 : name | 560 // -- r2 : name |
573 // -- lr : return address | 561 // -- lr : return address |
574 // ----------------------------------- | 562 // ----------------------------------- |
575 | 563 |
576 // Get the receiver of the function from the stack into r1. | 564 // Get the receiver of the function from the stack into r1. |
577 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); | 565 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); |
578 GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, extra_ic_state); | 566 GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, extra_ic_state); |
579 GenerateMiss(masm, argc, extra_ic_state); | 567 GenerateMiss(masm, argc, extra_ic_state); |
580 } | 568 } |
581 | 569 |
582 | 570 |
583 void CallIC::GenerateNormal(MacroAssembler* masm, int argc) { | 571 void CallIC::GenerateNormal(MacroAssembler* masm, int argc) { |
584 // ----------- S t a t e ------------- | 572 // ----------- S t a t e ------------- |
585 // -- r2 : name | 573 // -- r2 : name |
586 // -- lr : return address | 574 // -- lr : return address |
587 // ----------------------------------- | 575 // ----------------------------------- |
588 | 576 |
589 GenerateCallNormal(masm, argc); | 577 GenerateCallNormal(masm, argc); |
590 GenerateMiss(masm, argc, Code::kNoExtraICState); | 578 GenerateMiss(masm, argc, Code::kNoExtraICState); |
591 } | 579 } |
592 | 580 |
593 | 581 |
594 void KeyedCallIC::GenerateMiss(MacroAssembler* masm, int argc) { | |
595 // ----------- S t a t e ------------- | |
596 // -- r2 : name | |
597 // -- lr : return address | |
598 // ----------------------------------- | |
599 | |
600 GenerateCallMiss(masm, argc, IC::kKeyedCallIC_Miss, Code::kNoExtraICState); | |
601 } | |
602 | |
603 | |
604 void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { | 582 void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { |
605 // ----------- S t a t e ------------- | 583 // ----------- S t a t e ------------- |
606 // -- r2 : name | 584 // -- r2 : name |
607 // -- lr : return address | 585 // -- lr : return address |
608 // ----------------------------------- | 586 // ----------------------------------- |
609 | 587 |
610 // Get the receiver of the function from the stack into r1. | 588 // Get the receiver of the function from the stack into r1. |
611 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); | 589 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); |
612 | 590 |
613 Label do_call, slow_call, slow_load, slow_reload_receiver; | 591 Label do_call, slow_call, slow_load, slow_reload_receiver; |
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1705 Register reg = Assembler::GetRn(instr_at_patch); | 1683 Register reg = Assembler::GetRn(instr_at_patch); |
1706 patcher.masm()->tst(reg, Operand(kSmiTagMask)); | 1684 patcher.masm()->tst(reg, Operand(kSmiTagMask)); |
1707 patcher.EmitCondition(eq); | 1685 patcher.EmitCondition(eq); |
1708 } | 1686 } |
1709 } | 1687 } |
1710 | 1688 |
1711 | 1689 |
1712 } } // namespace v8::internal | 1690 } } // namespace v8::internal |
1713 | 1691 |
1714 #endif // V8_TARGET_ARCH_ARM | 1692 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |