OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2853 GenerateLoadCallback(object, holder, edx, ecx, ebx, eax, edi, callback, | 2853 GenerateLoadCallback(object, holder, edx, ecx, ebx, eax, edi, callback, |
2854 name, &miss); | 2854 name, &miss); |
2855 __ bind(&miss); | 2855 __ bind(&miss); |
2856 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2856 GenerateLoadMiss(masm(), Code::LOAD_IC); |
2857 | 2857 |
2858 // Return the generated code. | 2858 // Return the generated code. |
2859 return GetCode(CALLBACKS, name); | 2859 return GetCode(CALLBACKS, name); |
2860 } | 2860 } |
2861 | 2861 |
2862 | 2862 |
| 2863 Handle<Code> LoadStubCompiler::CompileLoadViaGetter( |
| 2864 Handle<String> name, |
| 2865 Handle<JSObject> receiver, |
| 2866 Handle<JSObject> holder, |
| 2867 Handle<JSFunction> getter) { |
| 2868 // ----------- S t a t e ------------- |
| 2869 // -- ecx : name |
| 2870 // -- edx : receiver |
| 2871 // -- esp[0] : return address |
| 2872 // ----------------------------------- |
| 2873 Label miss; |
| 2874 |
| 2875 // Check that the maps haven't changed. |
| 2876 __ JumpIfSmi(edx, &miss); |
| 2877 CheckPrototypes(receiver, edx, holder, ebx, eax, edi, name, &miss); |
| 2878 |
| 2879 { |
| 2880 FrameScope scope(masm(), StackFrame::INTERNAL); |
| 2881 |
| 2882 // Call the JavaScript getter with the receiver on the stack. |
| 2883 __ push(edx); |
| 2884 __ InvokeFunction(getter, ParameterCount(0), CALL_FUNCTION, |
| 2885 NullCallWrapper(), CALL_AS_METHOD); |
| 2886 |
| 2887 // Restore context register. |
| 2888 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 2889 } |
| 2890 __ ret(0); |
| 2891 |
| 2892 __ bind(&miss); |
| 2893 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2894 |
| 2895 // Return the generated code. |
| 2896 return GetCode(CALLBACKS, name); |
| 2897 } |
| 2898 |
| 2899 |
2863 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, | 2900 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, |
2864 Handle<JSObject> holder, | 2901 Handle<JSObject> holder, |
2865 Handle<JSFunction> value, | 2902 Handle<JSFunction> value, |
2866 Handle<String> name) { | 2903 Handle<String> name) { |
2867 // ----------- S t a t e ------------- | 2904 // ----------- S t a t e ------------- |
2868 // -- ecx : name | 2905 // -- ecx : name |
2869 // -- edx : receiver | 2906 // -- edx : receiver |
2870 // -- esp[0] : return address | 2907 // -- esp[0] : return address |
2871 // ----------------------------------- | 2908 // ----------------------------------- |
2872 Label miss; | 2909 Label miss; |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4154 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 4191 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
4155 } | 4192 } |
4156 } | 4193 } |
4157 | 4194 |
4158 | 4195 |
4159 #undef __ | 4196 #undef __ |
4160 | 4197 |
4161 } } // namespace v8::internal | 4198 } } // namespace v8::internal |
4162 | 4199 |
4163 #endif // V8_TARGET_ARCH_IA32 | 4200 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |