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 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 Label success; | 1277 Label success; |
1278 __ jmp(&success); | 1278 __ jmp(&success); |
1279 GenerateRestoreName(masm(), miss, name); | 1279 GenerateRestoreName(masm(), miss, name); |
1280 TailCallBuiltin(masm(), MissBuiltin(kind())); | 1280 TailCallBuiltin(masm(), MissBuiltin(kind())); |
1281 __ bind(&success); | 1281 __ bind(&success); |
1282 } | 1282 } |
1283 } | 1283 } |
1284 | 1284 |
1285 | 1285 |
1286 Register LoadStubCompiler::CallbackHandlerFrontend( | 1286 Register LoadStubCompiler::CallbackHandlerFrontend( |
1287 Handle<Object> object, | 1287 Handle<Type> type, |
1288 Register object_reg, | 1288 Register object_reg, |
1289 Handle<JSObject> holder, | 1289 Handle<JSObject> holder, |
1290 Handle<Name> name, | 1290 Handle<Name> name, |
1291 Handle<Object> callback) { | 1291 Handle<Object> callback) { |
1292 Label miss; | 1292 Label miss; |
1293 | 1293 |
1294 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); | 1294 Register reg = HandlerFrontendHeader(type, object_reg, holder, name, &miss); |
1295 | 1295 |
1296 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { | 1296 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { |
1297 ASSERT(!reg.is(scratch2())); | 1297 ASSERT(!reg.is(scratch2())); |
1298 ASSERT(!reg.is(scratch3())); | 1298 ASSERT(!reg.is(scratch3())); |
1299 ASSERT(!reg.is(scratch4())); | 1299 ASSERT(!reg.is(scratch4())); |
1300 | 1300 |
1301 // Load the properties dictionary. | 1301 // Load the properties dictionary. |
1302 Register dictionary = scratch4(); | 1302 Register dictionary = scratch4(); |
1303 __ movq(dictionary, FieldOperand(reg, JSObject::kPropertiesOffset)); | 1303 __ movq(dictionary, FieldOperand(reg, JSObject::kPropertiesOffset)); |
1304 | 1304 |
(...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2855 // Return the generated code. | 2855 // Return the generated code. |
2856 return GetCode(Code::NORMAL, name); | 2856 return GetCode(Code::NORMAL, name); |
2857 } | 2857 } |
2858 | 2858 |
2859 | 2859 |
2860 Handle<Code> StoreStubCompiler::CompileStoreCallback( | 2860 Handle<Code> StoreStubCompiler::CompileStoreCallback( |
2861 Handle<JSObject> object, | 2861 Handle<JSObject> object, |
2862 Handle<JSObject> holder, | 2862 Handle<JSObject> holder, |
2863 Handle<Name> name, | 2863 Handle<Name> name, |
2864 Handle<ExecutableAccessorInfo> callback) { | 2864 Handle<ExecutableAccessorInfo> callback) { |
2865 HandlerFrontend(object, receiver(), holder, name); | 2865 HandlerFrontend(IC::CurrentTypeOf(object, isolate()), |
| 2866 receiver(), holder, name); |
2866 | 2867 |
2867 __ PopReturnAddressTo(scratch1()); | 2868 __ PopReturnAddressTo(scratch1()); |
2868 __ push(receiver()); | 2869 __ push(receiver()); |
2869 __ Push(callback); // callback info | 2870 __ Push(callback); // callback info |
2870 __ Push(name); | 2871 __ Push(name); |
2871 __ push(value()); | 2872 __ push(value()); |
2872 __ PushReturnAddressFrom(scratch1()); | 2873 __ PushReturnAddressFrom(scratch1()); |
2873 | 2874 |
2874 // Do tail-call to the runtime system. | 2875 // Do tail-call to the runtime system. |
2875 ExternalReference store_callback_property = | 2876 ExternalReference store_callback_property = |
2876 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); | 2877 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); |
2877 __ TailCallExternalReference(store_callback_property, 4, 1); | 2878 __ TailCallExternalReference(store_callback_property, 4, 1); |
2878 | 2879 |
2879 // Return the generated code. | 2880 // Return the generated code. |
2880 return GetCode(kind(), Code::FAST, name); | 2881 return GetCode(kind(), Code::FAST, name); |
2881 } | 2882 } |
2882 | 2883 |
2883 | 2884 |
2884 Handle<Code> StoreStubCompiler::CompileStoreCallback( | 2885 Handle<Code> StoreStubCompiler::CompileStoreCallback( |
2885 Handle<JSObject> object, | 2886 Handle<JSObject> object, |
2886 Handle<JSObject> holder, | 2887 Handle<JSObject> holder, |
2887 Handle<Name> name, | 2888 Handle<Name> name, |
2888 const CallOptimization& call_optimization) { | 2889 const CallOptimization& call_optimization) { |
2889 HandlerFrontend(object, receiver(), holder, name); | 2890 HandlerFrontend(IC::CurrentTypeOf(object, isolate()), |
| 2891 receiver(), holder, name); |
2890 | 2892 |
2891 Register values[] = { value() }; | 2893 Register values[] = { value() }; |
2892 GenerateFastApiCall( | 2894 GenerateFastApiCall( |
2893 masm(), call_optimization, receiver(), scratch1(), | 2895 masm(), call_optimization, receiver(), scratch1(), |
2894 scratch2(), this->name(), 1, values); | 2896 scratch2(), this->name(), 1, values); |
2895 | 2897 |
2896 // Return the generated code. | 2898 // Return the generated code. |
2897 return GetCode(kind(), Code::FAST, name); | 2899 return GetCode(kind(), Code::FAST, name); |
2898 } | 2900 } |
2899 | 2901 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2993 __ bind(&miss); | 2995 __ bind(&miss); |
2994 | 2996 |
2995 TailCallBuiltin(masm(), MissBuiltin(kind())); | 2997 TailCallBuiltin(masm(), MissBuiltin(kind())); |
2996 | 2998 |
2997 // Return the generated code. | 2999 // Return the generated code. |
2998 return GetICCode( | 3000 return GetICCode( |
2999 kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); | 3001 kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); |
3000 } | 3002 } |
3001 | 3003 |
3002 | 3004 |
3003 Handle<Code> LoadStubCompiler::CompileLoadNonexistent( | 3005 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<Type> type, |
3004 Handle<Object> object, | 3006 Handle<JSObject> last, |
3005 Handle<JSObject> last, | 3007 Handle<Name> name) { |
3006 Handle<Name> name, | 3008 NonexistentHandlerFrontend(type, last, name); |
3007 Handle<JSGlobalObject> global) { | |
3008 NonexistentHandlerFrontend(object, last, name, global); | |
3009 | 3009 |
3010 // Return undefined if maps of the full prototype chain are still the | 3010 // Return undefined if maps of the full prototype chain are still the |
3011 // same and no global property with this name contains a value. | 3011 // same and no global property with this name contains a value. |
3012 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); | 3012 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); |
3013 __ ret(0); | 3013 __ ret(0); |
3014 | 3014 |
3015 // Return the generated code. | 3015 // Return the generated code. |
3016 return GetCode(kind(), Code::FAST, name); | 3016 return GetCode(kind(), Code::FAST, name); |
3017 } | 3017 } |
3018 | 3018 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3094 } | 3094 } |
3095 __ ret(0); | 3095 __ ret(0); |
3096 } | 3096 } |
3097 | 3097 |
3098 | 3098 |
3099 #undef __ | 3099 #undef __ |
3100 #define __ ACCESS_MASM(masm()) | 3100 #define __ ACCESS_MASM(masm()) |
3101 | 3101 |
3102 | 3102 |
3103 Handle<Code> LoadStubCompiler::CompileLoadGlobal( | 3103 Handle<Code> LoadStubCompiler::CompileLoadGlobal( |
3104 Handle<Object> object, | 3104 Handle<Type> type, |
3105 Handle<GlobalObject> global, | 3105 Handle<GlobalObject> global, |
3106 Handle<PropertyCell> cell, | 3106 Handle<PropertyCell> cell, |
3107 Handle<Name> name, | 3107 Handle<Name> name, |
3108 bool is_dont_delete) { | 3108 bool is_dont_delete) { |
3109 Label miss; | 3109 Label miss; |
3110 // TODO(verwaest): Directly store to rax. Currently we cannot do this, since | 3110 // TODO(verwaest): Directly store to rax. Currently we cannot do this, since |
3111 // rax is used as receiver(), which we would otherwise clobber before a | 3111 // rax is used as receiver(), which we would otherwise clobber before a |
3112 // potential miss. | 3112 // potential miss. |
3113 HandlerFrontendHeader(object, receiver(), global, name, &miss); | 3113 HandlerFrontendHeader(type, receiver(), global, name, &miss); |
3114 | 3114 |
3115 // Get the value from the cell. | 3115 // Get the value from the cell. |
3116 __ Move(rbx, cell); | 3116 __ Move(rbx, cell); |
3117 __ movq(rbx, FieldOperand(rbx, PropertyCell::kValueOffset)); | 3117 __ movq(rbx, FieldOperand(rbx, PropertyCell::kValueOffset)); |
3118 | 3118 |
3119 // Check for deleted property if property can actually be deleted. | 3119 // Check for deleted property if property can actually be deleted. |
3120 if (!is_dont_delete) { | 3120 if (!is_dont_delete) { |
3121 __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex); | 3121 __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex); |
3122 __ j(equal, &miss); | 3122 __ j(equal, &miss); |
3123 } else if (FLAG_debug_code) { | 3123 } else if (FLAG_debug_code) { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3227 // ----------------------------------- | 3227 // ----------------------------------- |
3228 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 3228 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
3229 } | 3229 } |
3230 | 3230 |
3231 | 3231 |
3232 #undef __ | 3232 #undef __ |
3233 | 3233 |
3234 } } // namespace v8::internal | 3234 } } // namespace v8::internal |
3235 | 3235 |
3236 #endif // V8_TARGET_ARCH_X64 | 3236 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |