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 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 Label success; | 1303 Label success; |
1304 __ Branch(&success); | 1304 __ Branch(&success); |
1305 GenerateRestoreName(masm(), miss, name); | 1305 GenerateRestoreName(masm(), miss, name); |
1306 TailCallBuiltin(masm(), MissBuiltin(kind())); | 1306 TailCallBuiltin(masm(), MissBuiltin(kind())); |
1307 __ bind(&success); | 1307 __ bind(&success); |
1308 } | 1308 } |
1309 } | 1309 } |
1310 | 1310 |
1311 | 1311 |
1312 Register LoadStubCompiler::CallbackHandlerFrontend( | 1312 Register LoadStubCompiler::CallbackHandlerFrontend( |
1313 Handle<Object> object, | 1313 Handle<Type> type, |
1314 Register object_reg, | 1314 Register object_reg, |
1315 Handle<JSObject> holder, | 1315 Handle<JSObject> holder, |
1316 Handle<Name> name, | 1316 Handle<Name> name, |
1317 Handle<Object> callback) { | 1317 Handle<Object> callback) { |
1318 Label miss; | 1318 Label miss; |
1319 | 1319 |
1320 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); | 1320 Register reg = HandlerFrontendHeader(type, object_reg, holder, name, &miss); |
1321 | 1321 |
1322 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { | 1322 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { |
1323 ASSERT(!reg.is(scratch2())); | 1323 ASSERT(!reg.is(scratch2())); |
1324 ASSERT(!reg.is(scratch3())); | 1324 ASSERT(!reg.is(scratch3())); |
1325 ASSERT(!reg.is(scratch4())); | 1325 ASSERT(!reg.is(scratch4())); |
1326 | 1326 |
1327 // Load the properties dictionary. | 1327 // Load the properties dictionary. |
1328 Register dictionary = scratch4(); | 1328 Register dictionary = scratch4(); |
1329 __ lw(dictionary, FieldMemOperand(reg, JSObject::kPropertiesOffset)); | 1329 __ lw(dictionary, FieldMemOperand(reg, JSObject::kPropertiesOffset)); |
1330 | 1330 |
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2803 // Return the generated code. | 2803 // Return the generated code. |
2804 return GetCode(Code::NORMAL, name); | 2804 return GetCode(Code::NORMAL, name); |
2805 } | 2805 } |
2806 | 2806 |
2807 | 2807 |
2808 Handle<Code> StoreStubCompiler::CompileStoreCallback( | 2808 Handle<Code> StoreStubCompiler::CompileStoreCallback( |
2809 Handle<JSObject> object, | 2809 Handle<JSObject> object, |
2810 Handle<JSObject> holder, | 2810 Handle<JSObject> holder, |
2811 Handle<Name> name, | 2811 Handle<Name> name, |
2812 Handle<ExecutableAccessorInfo> callback) { | 2812 Handle<ExecutableAccessorInfo> callback) { |
2813 HandlerFrontend(object, receiver(), holder, name); | 2813 HandlerFrontend(IC::CurrentTypeOf(object, isolate()), |
| 2814 receiver(), holder, name); |
2814 | 2815 |
2815 // Stub never generated for non-global objects that require access | 2816 // Stub never generated for non-global objects that require access |
2816 // checks. | 2817 // checks. |
2817 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded()); | 2818 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded()); |
2818 | 2819 |
2819 __ push(receiver()); // Receiver. | 2820 __ push(receiver()); // Receiver. |
2820 __ li(at, Operand(callback)); // Callback info. | 2821 __ li(at, Operand(callback)); // Callback info. |
2821 __ push(at); | 2822 __ push(at); |
2822 __ li(at, Operand(name)); | 2823 __ li(at, Operand(name)); |
2823 __ Push(at, value()); | 2824 __ Push(at, value()); |
2824 | 2825 |
2825 // Do tail-call to the runtime system. | 2826 // Do tail-call to the runtime system. |
2826 ExternalReference store_callback_property = | 2827 ExternalReference store_callback_property = |
2827 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); | 2828 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); |
2828 __ TailCallExternalReference(store_callback_property, 4, 1); | 2829 __ TailCallExternalReference(store_callback_property, 4, 1); |
2829 | 2830 |
2830 // Return the generated code. | 2831 // Return the generated code. |
2831 return GetCode(kind(), Code::FAST, name); | 2832 return GetCode(kind(), Code::FAST, name); |
2832 } | 2833 } |
2833 | 2834 |
2834 | 2835 |
2835 Handle<Code> StoreStubCompiler::CompileStoreCallback( | 2836 Handle<Code> StoreStubCompiler::CompileStoreCallback( |
2836 Handle<JSObject> object, | 2837 Handle<JSObject> object, |
2837 Handle<JSObject> holder, | 2838 Handle<JSObject> holder, |
2838 Handle<Name> name, | 2839 Handle<Name> name, |
2839 const CallOptimization& call_optimization) { | 2840 const CallOptimization& call_optimization) { |
2840 HandlerFrontend(object, receiver(), holder, name); | 2841 HandlerFrontend(IC::CurrentTypeOf(object, isolate()), |
| 2842 receiver(), holder, name); |
2841 | 2843 |
2842 Register values[] = { value() }; | 2844 Register values[] = { value() }; |
2843 GenerateFastApiCall( | 2845 GenerateFastApiCall( |
2844 masm(), call_optimization, receiver(), scratch3(), 1, values); | 2846 masm(), call_optimization, receiver(), scratch3(), 1, values); |
2845 | 2847 |
2846 // Return the generated code. | 2848 // Return the generated code. |
2847 return GetCode(kind(), Code::FAST, name); | 2849 return GetCode(kind(), Code::FAST, name); |
2848 } | 2850 } |
2849 | 2851 |
2850 | 2852 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2925 | 2927 |
2926 // Handle store cache miss. | 2928 // Handle store cache miss. |
2927 __ bind(&miss); | 2929 __ bind(&miss); |
2928 TailCallBuiltin(masm(), MissBuiltin(kind())); | 2930 TailCallBuiltin(masm(), MissBuiltin(kind())); |
2929 | 2931 |
2930 // Return the generated code. | 2932 // Return the generated code. |
2931 return GetCode(kind(), Code::FAST, name); | 2933 return GetCode(kind(), Code::FAST, name); |
2932 } | 2934 } |
2933 | 2935 |
2934 | 2936 |
2935 Handle<Code> LoadStubCompiler::CompileLoadNonexistent( | 2937 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<Type> type, |
2936 Handle<Object> object, | 2938 Handle<JSObject> last, |
2937 Handle<JSObject> last, | 2939 Handle<Name> name) { |
2938 Handle<Name> name, | 2940 NonexistentHandlerFrontend(type, last, name); |
2939 Handle<JSGlobalObject> global) { | |
2940 NonexistentHandlerFrontend(object, last, name, global); | |
2941 | 2941 |
2942 // Return undefined if maps of the full prototype chain is still the same. | 2942 // Return undefined if maps of the full prototype chain is still the same. |
2943 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); | 2943 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); |
2944 __ Ret(); | 2944 __ Ret(); |
2945 | 2945 |
2946 // Return the generated code. | 2946 // Return the generated code. |
2947 return GetCode(kind(), Code::FAST, name); | 2947 return GetCode(kind(), Code::FAST, name); |
2948 } | 2948 } |
2949 | 2949 |
2950 | 2950 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3023 } | 3023 } |
3024 __ Ret(); | 3024 __ Ret(); |
3025 } | 3025 } |
3026 | 3026 |
3027 | 3027 |
3028 #undef __ | 3028 #undef __ |
3029 #define __ ACCESS_MASM(masm()) | 3029 #define __ ACCESS_MASM(masm()) |
3030 | 3030 |
3031 | 3031 |
3032 Handle<Code> LoadStubCompiler::CompileLoadGlobal( | 3032 Handle<Code> LoadStubCompiler::CompileLoadGlobal( |
3033 Handle<Object> object, | 3033 Handle<Type> type, |
3034 Handle<GlobalObject> global, | 3034 Handle<GlobalObject> global, |
3035 Handle<PropertyCell> cell, | 3035 Handle<PropertyCell> cell, |
3036 Handle<Name> name, | 3036 Handle<Name> name, |
3037 bool is_dont_delete) { | 3037 bool is_dont_delete) { |
3038 Label miss; | 3038 Label miss; |
3039 | 3039 |
3040 HandlerFrontendHeader(object, receiver(), global, name, &miss); | 3040 HandlerFrontendHeader(type, receiver(), global, name, &miss); |
3041 | 3041 |
3042 // Get the value from the cell. | 3042 // Get the value from the cell. |
3043 __ li(a3, Operand(cell)); | 3043 __ li(a3, Operand(cell)); |
3044 __ lw(t0, FieldMemOperand(a3, Cell::kValueOffset)); | 3044 __ lw(t0, FieldMemOperand(a3, Cell::kValueOffset)); |
3045 | 3045 |
3046 // Check for deleted property if property can actually be deleted. | 3046 // Check for deleted property if property can actually be deleted. |
3047 if (!is_dont_delete) { | 3047 if (!is_dont_delete) { |
3048 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 3048 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
3049 __ Branch(&miss, eq, t0, Operand(at)); | 3049 __ Branch(&miss, eq, t0, Operand(at)); |
3050 } | 3050 } |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3183 // ----------------------------------- | 3183 // ----------------------------------- |
3184 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 3184 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
3185 } | 3185 } |
3186 | 3186 |
3187 | 3187 |
3188 #undef __ | 3188 #undef __ |
3189 | 3189 |
3190 } } // namespace v8::internal | 3190 } } // namespace v8::internal |
3191 | 3191 |
3192 #endif // V8_TARGET_ARCH_MIPS | 3192 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |