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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 | 596 |
597 if (id == IC::kCallIC_Miss) { | 597 if (id == IC::kCallIC_Miss) { |
598 __ IncrementCounter(isolate->counters()->call_miss(), 1, r3, r4); | 598 __ IncrementCounter(isolate->counters()->call_miss(), 1, r3, r4); |
599 } else { | 599 } else { |
600 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, r3, r4); | 600 __ IncrementCounter(isolate->counters()->keyed_call_miss(), 1, r3, r4); |
601 } | 601 } |
602 | 602 |
603 // Get the receiver of the function from the stack. | 603 // Get the receiver of the function from the stack. |
604 __ ldr(r3, MemOperand(sp, argc * kPointerSize)); | 604 __ ldr(r3, MemOperand(sp, argc * kPointerSize)); |
605 | 605 |
606 { | 606 __ EnterInternalFrame(); |
607 FrameScope scope(masm, StackFrame::INTERNAL); | |
608 | 607 |
609 // Push the receiver and the name of the function. | 608 // Push the receiver and the name of the function. |
610 __ Push(r3, r2); | 609 __ Push(r3, r2); |
611 | 610 |
612 // Call the entry. | 611 // Call the entry. |
613 __ mov(r0, Operand(2)); | 612 __ mov(r0, Operand(2)); |
614 __ mov(r1, Operand(ExternalReference(IC_Utility(id), isolate))); | 613 __ mov(r1, Operand(ExternalReference(IC_Utility(id), isolate))); |
615 | 614 |
616 CEntryStub stub(1); | 615 CEntryStub stub(1); |
617 __ CallStub(&stub); | 616 __ CallStub(&stub); |
618 | 617 |
619 // Move result to r1 and leave the internal frame. | 618 // Move result to r1 and leave the internal frame. |
620 __ mov(r1, Operand(r0)); | 619 __ mov(r1, Operand(r0)); |
621 } | 620 __ LeaveInternalFrame(); |
622 | 621 |
623 // Check if the receiver is a global object of some sort. | 622 // Check if the receiver is a global object of some sort. |
624 // This can happen only for regular CallIC but not KeyedCallIC. | 623 // This can happen only for regular CallIC but not KeyedCallIC. |
625 if (id == IC::kCallIC_Miss) { | 624 if (id == IC::kCallIC_Miss) { |
626 Label invoke, global; | 625 Label invoke, global; |
627 __ ldr(r2, MemOperand(sp, argc * kPointerSize)); // receiver | 626 __ ldr(r2, MemOperand(sp, argc * kPointerSize)); // receiver |
628 __ tst(r2, Operand(kSmiTagMask)); | 627 __ tst(r2, Operand(kSmiTagMask)); |
629 __ b(eq, &invoke); | 628 __ b(eq, &invoke); |
630 __ CompareObjectType(r2, r3, r3, JS_GLOBAL_OBJECT_TYPE); | 629 __ CompareObjectType(r2, r3, r3, JS_GLOBAL_OBJECT_TYPE); |
631 __ b(eq, &global); | 630 __ b(eq, &global); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 __ mov(r0, Operand(r2, ASR, kSmiTagSize)); | 743 __ mov(r0, Operand(r2, ASR, kSmiTagSize)); |
745 // r0: untagged index | 744 // r0: untagged index |
746 GenerateNumberDictionaryLoad(masm, &slow_load, r4, r2, r1, r0, r3, r5); | 745 GenerateNumberDictionaryLoad(masm, &slow_load, r4, r2, r1, r0, r3, r5); |
747 __ IncrementCounter(counters->keyed_call_generic_smi_dict(), 1, r0, r3); | 746 __ IncrementCounter(counters->keyed_call_generic_smi_dict(), 1, r0, r3); |
748 __ jmp(&do_call); | 747 __ jmp(&do_call); |
749 | 748 |
750 __ bind(&slow_load); | 749 __ bind(&slow_load); |
751 // This branch is taken when calling KeyedCallIC_Miss is neither required | 750 // This branch is taken when calling KeyedCallIC_Miss is neither required |
752 // nor beneficial. | 751 // nor beneficial. |
753 __ IncrementCounter(counters->keyed_call_generic_slow_load(), 1, r0, r3); | 752 __ IncrementCounter(counters->keyed_call_generic_slow_load(), 1, r0, r3); |
754 { | 753 __ EnterInternalFrame(); |
755 FrameScope scope(masm, StackFrame::INTERNAL); | 754 __ push(r2); // save the key |
756 __ push(r2); // save the key | 755 __ Push(r1, r2); // pass the receiver and the key |
757 __ Push(r1, r2); // pass the receiver and the key | 756 __ CallRuntime(Runtime::kKeyedGetProperty, 2); |
758 __ CallRuntime(Runtime::kKeyedGetProperty, 2); | 757 __ pop(r2); // restore the key |
759 __ pop(r2); // restore the key | 758 __ LeaveInternalFrame(); |
760 } | |
761 __ mov(r1, r0); | 759 __ mov(r1, r0); |
762 __ jmp(&do_call); | 760 __ jmp(&do_call); |
763 | 761 |
764 __ bind(&check_string); | 762 __ bind(&check_string); |
765 GenerateKeyStringCheck(masm, r2, r0, r3, &index_string, &slow_call); | 763 GenerateKeyStringCheck(masm, r2, r0, r3, &index_string, &slow_call); |
766 | 764 |
767 // The key is known to be a symbol. | 765 // The key is known to be a symbol. |
768 // If the receiver is a regular JS object with slow properties then do | 766 // If the receiver is a regular JS object with slow properties then do |
769 // a quick inline probe of the receiver's dictionary. | 767 // a quick inline probe of the receiver's dictionary. |
770 // Otherwise do the monomorphic cache probe. | 768 // Otherwise do the monomorphic cache probe. |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1556 Register reg = Assembler::GetRn(instr_at_patch); | 1554 Register reg = Assembler::GetRn(instr_at_patch); |
1557 patcher.masm()->tst(reg, Operand(kSmiTagMask)); | 1555 patcher.masm()->tst(reg, Operand(kSmiTagMask)); |
1558 patcher.EmitCondition(eq); | 1556 patcher.EmitCondition(eq); |
1559 } | 1557 } |
1560 } | 1558 } |
1561 | 1559 |
1562 | 1560 |
1563 } } // namespace v8::internal | 1561 } } // namespace v8::internal |
1564 | 1562 |
1565 #endif // V8_TARGET_ARCH_ARM | 1563 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |