Chromium Code Reviews| 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 2841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2852 GenerateLoadCallback(object, holder, edx, ecx, ebx, eax, edi, callback, | 2852 GenerateLoadCallback(object, holder, edx, ecx, ebx, eax, edi, callback, |
| 2853 name, &miss); | 2853 name, &miss); |
| 2854 __ bind(&miss); | 2854 __ bind(&miss); |
| 2855 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2855 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2856 | 2856 |
| 2857 // Return the generated code. | 2857 // Return the generated code. |
| 2858 return GetCode(CALLBACKS, name); | 2858 return GetCode(CALLBACKS, name); |
| 2859 } | 2859 } |
| 2860 | 2860 |
| 2861 | 2861 |
| 2862 Handle<Code> LoadStubCompiler::CompileLoadViaGetter( | |
| 2863 Handle<String> name, | |
| 2864 Handle<JSObject> receiver, | |
| 2865 Handle<JSObject> holder, | |
| 2866 Handle<JSFunction> getter) { | |
| 2867 // ----------- S t a t e ------------- | |
| 2868 // -- ecx : name | |
| 2869 // -- edx : receiver | |
| 2870 // -- esp[0] : return address | |
| 2871 // ----------------------------------- | |
| 2872 Label miss; | |
| 2873 | |
| 2874 // Check that the receiver isn't a smi. | |
| 2875 __ JumpIfSmi(edx, &miss); | |
| 2876 | |
| 2877 // Check that the maps haven't changed. | |
| 2878 CheckPrototypes(receiver, edx, holder, ebx, eax, edi, name, &miss); | |
| 2879 | |
| 2880 { | |
| 2881 FrameScope scope(masm(), StackFrame::INTERNAL); | |
| 2882 | |
| 2883 // The JavaScript getter expects the receiver on the stack. | |
| 2884 __ push(edx); | |
| 2885 | |
| 2886 // TODO(svenpanne) Use CALL_AS_FUNCTION or CALL_AS_METHOD? | |
| 2887 __ InvokeFunction(getter, ParameterCount(0), CALL_FUNCTION, | |
| 2888 NullCallWrapper(), CALL_AS_FUNCTION); | |
|
Vyacheslav Egorov (Google)
2012/06/05 14:56:05
I think it should be CALL_AS_METHOD because it's t
| |
| 2889 | |
| 2890 // Restore context register. | |
| 2891 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | |
| 2892 } | |
| 2893 __ ret(0); | |
| 2894 | |
| 2895 __ bind(&miss); | |
| 2896 GenerateLoadMiss(masm(), Code::LOAD_IC); | |
| 2897 | |
| 2898 // Return the generated code. | |
| 2899 return GetCode(CALLBACKS, name); | |
| 2900 } | |
| 2901 | |
| 2902 | |
| 2862 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, | 2903 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, |
| 2863 Handle<JSObject> holder, | 2904 Handle<JSObject> holder, |
| 2864 Handle<JSFunction> value, | 2905 Handle<JSFunction> value, |
| 2865 Handle<String> name) { | 2906 Handle<String> name) { |
| 2866 // ----------- S t a t e ------------- | 2907 // ----------- S t a t e ------------- |
| 2867 // -- ecx : name | 2908 // -- ecx : name |
| 2868 // -- edx : receiver | 2909 // -- edx : receiver |
| 2869 // -- esp[0] : return address | 2910 // -- esp[0] : return address |
| 2870 // ----------------------------------- | 2911 // ----------------------------------- |
| 2871 Label miss; | 2912 Label miss; |
| (...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4153 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 4194 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
| 4154 } | 4195 } |
| 4155 } | 4196 } |
| 4156 | 4197 |
| 4157 | 4198 |
| 4158 #undef __ | 4199 #undef __ |
| 4159 | 4200 |
| 4160 } } // namespace v8::internal | 4201 } } // namespace v8::internal |
| 4161 | 4202 |
| 4162 #endif // V8_TARGET_ARCH_IA32 | 4203 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |