OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 Label* miss) { | 769 Label* miss) { |
770 // Check that the receiver isn't a smi. | 770 // Check that the receiver isn't a smi. |
771 __ test(receiver, Immediate(kSmiTagMask)); | 771 __ test(receiver, Immediate(kSmiTagMask)); |
772 __ j(zero, miss, not_taken); | 772 __ j(zero, miss, not_taken); |
773 | 773 |
774 // Check that the maps haven't changed. | 774 // Check that the maps haven't changed. |
775 Register reg = | 775 Register reg = |
776 CheckPrototypes(object, receiver, holder, | 776 CheckPrototypes(object, receiver, holder, |
777 scratch1, scratch2, name, miss); | 777 scratch1, scratch2, name, miss); |
778 | 778 |
779 Handle<AccessorInfo> callback_handle(callback); | 779 // Push the arguments on the JS stack of the caller. |
780 | 780 __ pop(scratch2); // remove return address |
781 Register other = reg.is(scratch1) ? scratch2 : scratch1; | |
782 __ EnterInternalFrame(); | |
783 __ PushHandleScope(other); | |
784 // Push the stack address where the list of arguments ends | |
785 __ mov(other, esp); | |
786 __ sub(Operand(other), Immediate(2 * kPointerSize)); | |
787 __ push(other); | |
788 __ push(receiver); // receiver | 781 __ push(receiver); // receiver |
789 __ push(reg); // holder | 782 __ push(reg); // holder |
790 __ mov(other, Immediate(callback_handle)); | 783 __ mov(reg, Immediate(Handle<AccessorInfo>(callback))); // callback data |
791 __ push(other); | 784 __ push(reg); |
792 __ push(FieldOperand(other, AccessorInfo::kDataOffset)); // data | 785 __ push(FieldOperand(reg, AccessorInfo::kDataOffset)); |
793 __ push(name_reg); // name | 786 __ push(name_reg); // name |
794 // Save a pointer to where we pushed the arguments pointer. | 787 __ push(scratch2); // restore return address |
795 // This will be passed as the const Arguments& to the C++ callback. | |
796 __ mov(eax, esp); | |
797 __ add(Operand(eax), Immediate(5 * kPointerSize)); | |
798 __ mov(ebx, esp); | |
799 | 788 |
800 // Do call through the api. | 789 // Do tail-call to the runtime system. |
801 ASSERT_EQ(6, ApiGetterEntryStub::kStackSpace); | 790 ExternalReference load_callback_property = |
802 Address getter_address = v8::ToCData<Address>(callback->getter()); | 791 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); |
803 ApiFunction fun(getter_address); | 792 __ TailCallRuntime(load_callback_property, 5, 1); |
804 ApiGetterEntryStub stub(callback_handle, &fun); | |
805 __ CallStub(&stub); | |
806 | |
807 Register tmp = other.is(eax) ? reg : other; | |
808 __ PopHandleScope(tmp); | |
809 __ LeaveInternalFrame(); | |
810 | |
811 __ ret(0); | |
812 } | 793 } |
813 | 794 |
814 | 795 |
815 void StubCompiler::GenerateLoadConstant(JSObject* object, | 796 void StubCompiler::GenerateLoadConstant(JSObject* object, |
816 JSObject* holder, | 797 JSObject* holder, |
817 Register receiver, | 798 Register receiver, |
818 Register scratch1, | 799 Register scratch1, |
819 Register scratch2, | 800 Register scratch2, |
820 Object* value, | 801 Object* value, |
821 String* name, | 802 String* name, |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1886 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 1867 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
1887 | 1868 |
1888 // Return the generated code. | 1869 // Return the generated code. |
1889 return GetCode(); | 1870 return GetCode(); |
1890 } | 1871 } |
1891 | 1872 |
1892 | 1873 |
1893 #undef __ | 1874 #undef __ |
1894 | 1875 |
1895 } } // namespace v8::internal | 1876 } } // namespace v8::internal |
OLD | NEW |