| 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 2933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2944 GenerateLoadCallback(object, holder, r0, r2, r3, r1, r4, r5, callback, name, | 2944 GenerateLoadCallback(object, holder, r0, r2, r3, r1, r4, r5, callback, name, |
| 2945 &miss); | 2945 &miss); |
| 2946 __ bind(&miss); | 2946 __ bind(&miss); |
| 2947 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2947 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2948 | 2948 |
| 2949 // Return the generated code. | 2949 // Return the generated code. |
| 2950 return GetCode(Code::CALLBACKS, name); | 2950 return GetCode(Code::CALLBACKS, name); |
| 2951 } | 2951 } |
| 2952 | 2952 |
| 2953 | 2953 |
| 2954 #undef __ |
| 2955 #define __ ACCESS_MASM(masm) |
| 2956 |
| 2957 |
| 2958 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
| 2959 Handle<JSFunction> getter) { |
| 2960 // ----------- S t a t e ------------- |
| 2961 // -- r0 : receiver |
| 2962 // -- r2 : name |
| 2963 // -- lr : return address |
| 2964 // ----------------------------------- |
| 2965 { |
| 2966 FrameScope scope(masm, StackFrame::INTERNAL); |
| 2967 |
| 2968 if (!getter.is_null()) { |
| 2969 // Call the JavaScript getter with the receiver on the stack. |
| 2970 __ push(r0); |
| 2971 ParameterCount actual(0); |
| 2972 __ InvokeFunction(getter, actual, CALL_FUNCTION, NullCallWrapper(), |
| 2973 CALL_AS_METHOD); |
| 2974 } else { |
| 2975 // If we generate a global code snippet for deoptimization only, remember |
| 2976 // the place to continue after deoptimization. |
| 2977 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); |
| 2978 } |
| 2979 |
| 2980 // Restore context register. |
| 2981 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2982 } |
| 2983 __ Ret(); |
| 2984 } |
| 2985 |
| 2986 |
| 2987 #undef __ |
| 2988 #define __ ACCESS_MASM(masm()) |
| 2989 |
| 2990 |
| 2954 Handle<Code> LoadStubCompiler::CompileLoadViaGetter( | 2991 Handle<Code> LoadStubCompiler::CompileLoadViaGetter( |
| 2955 Handle<String> name, | 2992 Handle<String> name, |
| 2956 Handle<JSObject> receiver, | 2993 Handle<JSObject> receiver, |
| 2957 Handle<JSObject> holder, | 2994 Handle<JSObject> holder, |
| 2958 Handle<JSFunction> getter) { | 2995 Handle<JSFunction> getter) { |
| 2959 // ----------- S t a t e ------------- | 2996 // ----------- S t a t e ------------- |
| 2960 // -- r0 : receiver | 2997 // -- r0 : receiver |
| 2961 // -- r2 : name | 2998 // -- r2 : name |
| 2962 // -- lr : return address | 2999 // -- lr : return address |
| 2963 // ----------------------------------- | 3000 // ----------------------------------- |
| 2964 Label miss; | 3001 Label miss; |
| 2965 | 3002 |
| 2966 // Check that the maps haven't changed. | 3003 // Check that the maps haven't changed. |
| 2967 __ JumpIfSmi(r0, &miss); | 3004 __ JumpIfSmi(r0, &miss); |
| 2968 CheckPrototypes(receiver, r0, holder, r3, r4, r1, name, &miss); | 3005 CheckPrototypes(receiver, r0, holder, r3, r4, r1, name, &miss); |
| 2969 | 3006 |
| 2970 { | 3007 GenerateLoadViaGetter(masm(), getter); |
| 2971 FrameScope scope(masm(), StackFrame::INTERNAL); | |
| 2972 | |
| 2973 // Call the JavaScript getter with the receiver on the stack. | |
| 2974 __ push(r0); | |
| 2975 ParameterCount actual(0); | |
| 2976 __ InvokeFunction(getter, actual, CALL_FUNCTION, NullCallWrapper(), | |
| 2977 CALL_AS_METHOD); | |
| 2978 | |
| 2979 // Restore context register. | |
| 2980 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | |
| 2981 } | |
| 2982 __ Ret(); | |
| 2983 | 3008 |
| 2984 __ bind(&miss); | 3009 __ bind(&miss); |
| 2985 GenerateLoadMiss(masm(), Code::LOAD_IC); | 3010 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2986 | 3011 |
| 2987 // Return the generated code. | 3012 // Return the generated code. |
| 2988 return GetCode(Code::CALLBACKS, name); | 3013 return GetCode(Code::CALLBACKS, name); |
| 2989 } | 3014 } |
| 2990 | 3015 |
| 2991 | 3016 |
| 2992 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, | 3017 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, |
| (...skipping 1755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4748 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4773 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
| 4749 } | 4774 } |
| 4750 } | 4775 } |
| 4751 | 4776 |
| 4752 | 4777 |
| 4753 #undef __ | 4778 #undef __ |
| 4754 | 4779 |
| 4755 } } // namespace v8::internal | 4780 } } // namespace v8::internal |
| 4756 | 4781 |
| 4757 #endif // V8_TARGET_ARCH_ARM | 4782 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |