| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 __ j(below, &fast, taken); | 397 __ j(below, &fast, taken); |
| 398 | 398 |
| 399 // Slow case: Push extra copies of the arguments (3). | 399 // Slow case: Push extra copies of the arguments (3). |
| 400 __ bind(&slow); | 400 __ bind(&slow); |
| 401 __ pop(ecx); | 401 __ pop(ecx); |
| 402 __ push(Operand(esp, 1 * kPointerSize)); | 402 __ push(Operand(esp, 1 * kPointerSize)); |
| 403 __ push(Operand(esp, 1 * kPointerSize)); | 403 __ push(Operand(esp, 1 * kPointerSize)); |
| 404 __ push(eax); | 404 __ push(eax); |
| 405 __ push(ecx); | 405 __ push(ecx); |
| 406 // Do tail-call to runtime routine. | 406 // Do tail-call to runtime routine. |
| 407 __ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3); | 407 __ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3, 1); |
| 408 | 408 |
| 409 // Check whether the elements is a pixel array. | 409 // Check whether the elements is a pixel array. |
| 410 // eax: value | 410 // eax: value |
| 411 // ecx: elements array | 411 // ecx: elements array |
| 412 // ebx: index (as a smi) | 412 // ebx: index (as a smi) |
| 413 __ bind(&check_pixel_array); | 413 __ bind(&check_pixel_array); |
| 414 __ cmp(FieldOperand(ecx, HeapObject::kMapOffset), | 414 __ cmp(FieldOperand(ecx, HeapObject::kMapOffset), |
| 415 Immediate(Factory::pixel_array_map())); | 415 Immediate(Factory::pixel_array_map())); |
| 416 __ j(not_equal, &slow); | 416 __ j(not_equal, &slow); |
| 417 // Check that the value is a smi. If a conversion is needed call into the | 417 // Check that the value is a smi. If a conversion is needed call into the |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 __ mov(ebx, Operand(esp, (argc + 2) * kPointerSize)); | 660 __ mov(ebx, Operand(esp, (argc + 2) * kPointerSize)); |
| 661 | 661 |
| 662 // Enter an internal frame. | 662 // Enter an internal frame. |
| 663 __ EnterInternalFrame(); | 663 __ EnterInternalFrame(); |
| 664 | 664 |
| 665 // Push the receiver and the name of the function. | 665 // Push the receiver and the name of the function. |
| 666 __ push(edx); | 666 __ push(edx); |
| 667 __ push(ebx); | 667 __ push(ebx); |
| 668 | 668 |
| 669 // Call the entry. | 669 // Call the entry. |
| 670 CEntryStub stub; | 670 CEntryStub stub(1); |
| 671 __ mov(eax, Immediate(2)); | 671 __ mov(eax, Immediate(2)); |
| 672 __ mov(ebx, Immediate(f)); | 672 __ mov(ebx, Immediate(f)); |
| 673 __ CallStub(&stub); | 673 __ CallStub(&stub); |
| 674 | 674 |
| 675 // Move result to edi and exit the internal frame. | 675 // Move result to edi and exit the internal frame. |
| 676 __ mov(edi, eax); | 676 __ mov(edi, eax); |
| 677 __ LeaveInternalFrame(); | 677 __ LeaveInternalFrame(); |
| 678 | 678 |
| 679 // Check if the receiver is a global object of some sort. | 679 // Check if the receiver is a global object of some sort. |
| 680 Label invoke, global; | 680 Label invoke, global; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 // -- esp[4] : receiver | 792 // -- esp[4] : receiver |
| 793 // ----------------------------------- | 793 // ----------------------------------- |
| 794 | 794 |
| 795 __ mov(eax, Operand(esp, kPointerSize)); | 795 __ mov(eax, Operand(esp, kPointerSize)); |
| 796 __ pop(ebx); | 796 __ pop(ebx); |
| 797 __ push(eax); // receiver | 797 __ push(eax); // receiver |
| 798 __ push(ecx); // name | 798 __ push(ecx); // name |
| 799 __ push(ebx); // return address | 799 __ push(ebx); // return address |
| 800 | 800 |
| 801 // Perform tail call to the entry. | 801 // Perform tail call to the entry. |
| 802 __ TailCallRuntime(f, 2); | 802 __ TailCallRuntime(f, 2, 1); |
| 803 } | 803 } |
| 804 | 804 |
| 805 | 805 |
| 806 // One byte opcode for test eax,0xXXXXXXXX. | 806 // One byte opcode for test eax,0xXXXXXXXX. |
| 807 static const byte kTestEaxByte = 0xA9; | 807 static const byte kTestEaxByte = 0xA9; |
| 808 | 808 |
| 809 | 809 |
| 810 void LoadIC::ClearInlinedVersion(Address address) { | 810 void LoadIC::ClearInlinedVersion(Address address) { |
| 811 // Reset the map check of the inlined inobject property load (if | 811 // Reset the map check of the inlined inobject property load (if |
| 812 // present) to guarantee failure by holding an invalid map (the null | 812 // present) to guarantee failure by holding an invalid map (the null |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 // ----------------------------------- | 920 // ----------------------------------- |
| 921 | 921 |
| 922 __ mov(eax, Operand(esp, kPointerSize)); | 922 __ mov(eax, Operand(esp, kPointerSize)); |
| 923 __ mov(ecx, Operand(esp, 2 * kPointerSize)); | 923 __ mov(ecx, Operand(esp, 2 * kPointerSize)); |
| 924 __ pop(ebx); | 924 __ pop(ebx); |
| 925 __ push(ecx); // receiver | 925 __ push(ecx); // receiver |
| 926 __ push(eax); // name | 926 __ push(eax); // name |
| 927 __ push(ebx); // return address | 927 __ push(ebx); // return address |
| 928 | 928 |
| 929 // Perform tail call to the entry. | 929 // Perform tail call to the entry. |
| 930 __ TailCallRuntime(f, 2); | 930 __ TailCallRuntime(f, 2, 1); |
| 931 } | 931 } |
| 932 | 932 |
| 933 | 933 |
| 934 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 934 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
| 935 // ----------- S t a t e ------------- | 935 // ----------- S t a t e ------------- |
| 936 // -- eax : value | 936 // -- eax : value |
| 937 // -- ecx : name | 937 // -- ecx : name |
| 938 // -- esp[0] : return address | 938 // -- esp[0] : return address |
| 939 // -- esp[4] : receiver | 939 // -- esp[4] : receiver |
| 940 // ----------------------------------- | 940 // ----------------------------------- |
| (...skipping 19 matching lines...) Expand all Loading... |
| 960 // ----------------------------------- | 960 // ----------------------------------- |
| 961 | 961 |
| 962 __ pop(ebx); | 962 __ pop(ebx); |
| 963 __ push(Operand(esp, 0)); // receiver | 963 __ push(Operand(esp, 0)); // receiver |
| 964 __ push(ecx); // transition map | 964 __ push(ecx); // transition map |
| 965 __ push(eax); // value | 965 __ push(eax); // value |
| 966 __ push(ebx); // return address | 966 __ push(ebx); // return address |
| 967 | 967 |
| 968 // Perform tail call to the entry. | 968 // Perform tail call to the entry. |
| 969 __ TailCallRuntime( | 969 __ TailCallRuntime( |
| 970 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); | 970 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1); |
| 971 } | 971 } |
| 972 | 972 |
| 973 | 973 |
| 974 void StoreIC::Generate(MacroAssembler* masm, const ExternalReference& f) { | 974 void StoreIC::Generate(MacroAssembler* masm, const ExternalReference& f) { |
| 975 // ----------- S t a t e ------------- | 975 // ----------- S t a t e ------------- |
| 976 // -- eax : value | 976 // -- eax : value |
| 977 // -- ecx : name | 977 // -- ecx : name |
| 978 // -- esp[0] : return address | 978 // -- esp[0] : return address |
| 979 // -- esp[4] : receiver | 979 // -- esp[4] : receiver |
| 980 // ----------------------------------- | 980 // ----------------------------------- |
| 981 | 981 |
| 982 // Move the return address below the arguments. | 982 // Move the return address below the arguments. |
| 983 __ pop(ebx); | 983 __ pop(ebx); |
| 984 __ push(Operand(esp, 0)); | 984 __ push(Operand(esp, 0)); |
| 985 __ push(ecx); | 985 __ push(ecx); |
| 986 __ push(eax); | 986 __ push(eax); |
| 987 __ push(ebx); | 987 __ push(ebx); |
| 988 | 988 |
| 989 // Perform tail call to the entry. | 989 // Perform tail call to the entry. |
| 990 __ TailCallRuntime(f, 3); | 990 __ TailCallRuntime(f, 3, 1); |
| 991 } | 991 } |
| 992 | 992 |
| 993 | 993 |
| 994 // Defined in ic.cc. | 994 // Defined in ic.cc. |
| 995 Object* KeyedStoreIC_Miss(Arguments args); | 995 Object* KeyedStoreIC_Miss(Arguments args); |
| 996 | 996 |
| 997 void KeyedStoreIC::Generate(MacroAssembler* masm, const ExternalReference& f) { | 997 void KeyedStoreIC::Generate(MacroAssembler* masm, const ExternalReference& f) { |
| 998 // ----------- S t a t e ------------- | 998 // ----------- S t a t e ------------- |
| 999 // -- eax : value | 999 // -- eax : value |
| 1000 // -- esp[0] : return address | 1000 // -- esp[0] : return address |
| 1001 // -- esp[4] : key | 1001 // -- esp[4] : key |
| 1002 // -- esp[8] : receiver | 1002 // -- esp[8] : receiver |
| 1003 // ----------------------------------- | 1003 // ----------------------------------- |
| 1004 | 1004 |
| 1005 // Move the return address below the arguments. | 1005 // Move the return address below the arguments. |
| 1006 __ pop(ecx); | 1006 __ pop(ecx); |
| 1007 __ push(Operand(esp, 1 * kPointerSize)); | 1007 __ push(Operand(esp, 1 * kPointerSize)); |
| 1008 __ push(Operand(esp, 1 * kPointerSize)); | 1008 __ push(Operand(esp, 1 * kPointerSize)); |
| 1009 __ push(eax); | 1009 __ push(eax); |
| 1010 __ push(ecx); | 1010 __ push(ecx); |
| 1011 | 1011 |
| 1012 // Do tail-call to runtime routine. | 1012 // Do tail-call to runtime routine. |
| 1013 __ TailCallRuntime(f, 3); | 1013 __ TailCallRuntime(f, 3, 1); |
| 1014 } | 1014 } |
| 1015 | 1015 |
| 1016 | 1016 |
| 1017 void KeyedStoreIC::GenerateExtendStorage(MacroAssembler* masm) { | 1017 void KeyedStoreIC::GenerateExtendStorage(MacroAssembler* masm) { |
| 1018 // ----------- S t a t e ------------- | 1018 // ----------- S t a t e ------------- |
| 1019 // -- eax : value | 1019 // -- eax : value |
| 1020 // -- ecx : transition map | 1020 // -- ecx : transition map |
| 1021 // -- esp[0] : return address | 1021 // -- esp[0] : return address |
| 1022 // -- esp[4] : key | 1022 // -- esp[4] : key |
| 1023 // -- esp[8] : receiver | 1023 // -- esp[8] : receiver |
| 1024 // ----------------------------------- | 1024 // ----------------------------------- |
| 1025 | 1025 |
| 1026 // Move the return address below the arguments. | 1026 // Move the return address below the arguments. |
| 1027 __ pop(ebx); | 1027 __ pop(ebx); |
| 1028 __ push(Operand(esp, 1 * kPointerSize)); | 1028 __ push(Operand(esp, 1 * kPointerSize)); |
| 1029 __ push(ecx); | 1029 __ push(ecx); |
| 1030 __ push(eax); | 1030 __ push(eax); |
| 1031 __ push(ebx); | 1031 __ push(ebx); |
| 1032 | 1032 |
| 1033 // Do tail-call to runtime routine. | 1033 // Do tail-call to runtime routine. |
| 1034 __ TailCallRuntime( | 1034 __ TailCallRuntime( |
| 1035 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); | 1035 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1); |
| 1036 } | 1036 } |
| 1037 | 1037 |
| 1038 #undef __ | 1038 #undef __ |
| 1039 | 1039 |
| 1040 | 1040 |
| 1041 } } // namespace v8::internal | 1041 } } // namespace v8::internal |
| OLD | NEW |