| 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 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1335 Label success; | 1335 Label success; |
| 1336 __ jmp(&success); | 1336 __ jmp(&success); |
| 1337 GenerateRestoreName(masm(), miss, name); | 1337 GenerateRestoreName(masm(), miss, name); |
| 1338 TailCallBuiltin(masm(), MissBuiltin(kind())); | 1338 TailCallBuiltin(masm(), MissBuiltin(kind())); |
| 1339 __ bind(&success); | 1339 __ bind(&success); |
| 1340 } | 1340 } |
| 1341 } | 1341 } |
| 1342 | 1342 |
| 1343 | 1343 |
| 1344 Register LoadStubCompiler::CallbackHandlerFrontend( | 1344 Register LoadStubCompiler::CallbackHandlerFrontend( |
| 1345 Handle<Object> object, | 1345 Handle<Type> type, |
| 1346 Register object_reg, | 1346 Register object_reg, |
| 1347 Handle<JSObject> holder, | 1347 Handle<JSObject> holder, |
| 1348 Handle<Name> name, | 1348 Handle<Name> name, |
| 1349 Handle<Object> callback) { | 1349 Handle<Object> callback) { |
| 1350 Label miss; | 1350 Label miss; |
| 1351 | 1351 |
| 1352 Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); | 1352 Register reg = HandlerFrontendHeader(type, object_reg, holder, name, &miss); |
| 1353 | 1353 |
| 1354 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { | 1354 if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { |
| 1355 ASSERT(!reg.is(scratch2())); | 1355 ASSERT(!reg.is(scratch2())); |
| 1356 ASSERT(!reg.is(scratch3())); | 1356 ASSERT(!reg.is(scratch3())); |
| 1357 Register dictionary = scratch1(); | 1357 Register dictionary = scratch1(); |
| 1358 bool must_preserve_dictionary_reg = reg.is(dictionary); | 1358 bool must_preserve_dictionary_reg = reg.is(dictionary); |
| 1359 | 1359 |
| 1360 // Load the properties dictionary. | 1360 // Load the properties dictionary. |
| 1361 if (must_preserve_dictionary_reg) { | 1361 if (must_preserve_dictionary_reg) { |
| 1362 __ push(dictionary); | 1362 __ push(dictionary); |
| (...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2945 // Return the generated code. | 2945 // Return the generated code. |
| 2946 return GetCode(Code::NORMAL, name); | 2946 return GetCode(Code::NORMAL, name); |
| 2947 } | 2947 } |
| 2948 | 2948 |
| 2949 | 2949 |
| 2950 Handle<Code> StoreStubCompiler::CompileStoreCallback( | 2950 Handle<Code> StoreStubCompiler::CompileStoreCallback( |
| 2951 Handle<JSObject> object, | 2951 Handle<JSObject> object, |
| 2952 Handle<JSObject> holder, | 2952 Handle<JSObject> holder, |
| 2953 Handle<Name> name, | 2953 Handle<Name> name, |
| 2954 Handle<ExecutableAccessorInfo> callback) { | 2954 Handle<ExecutableAccessorInfo> callback) { |
| 2955 HandlerFrontend(object, receiver(), holder, name); | 2955 HandlerFrontend(IC::CurrentTypeOf(object, isolate()), |
| 2956 receiver(), holder, name); |
| 2956 | 2957 |
| 2957 __ pop(scratch1()); // remove the return address | 2958 __ pop(scratch1()); // remove the return address |
| 2958 __ push(receiver()); | 2959 __ push(receiver()); |
| 2959 __ Push(callback); | 2960 __ Push(callback); |
| 2960 __ Push(name); | 2961 __ Push(name); |
| 2961 __ push(value()); | 2962 __ push(value()); |
| 2962 __ push(scratch1()); // restore return address | 2963 __ push(scratch1()); // restore return address |
| 2963 | 2964 |
| 2964 // Do tail-call to the runtime system. | 2965 // Do tail-call to the runtime system. |
| 2965 ExternalReference store_callback_property = | 2966 ExternalReference store_callback_property = |
| 2966 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); | 2967 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); |
| 2967 __ TailCallExternalReference(store_callback_property, 4, 1); | 2968 __ TailCallExternalReference(store_callback_property, 4, 1); |
| 2968 | 2969 |
| 2969 // Return the generated code. | 2970 // Return the generated code. |
| 2970 return GetCode(kind(), Code::FAST, name); | 2971 return GetCode(kind(), Code::FAST, name); |
| 2971 } | 2972 } |
| 2972 | 2973 |
| 2973 | 2974 |
| 2974 Handle<Code> StoreStubCompiler::CompileStoreCallback( | 2975 Handle<Code> StoreStubCompiler::CompileStoreCallback( |
| 2975 Handle<JSObject> object, | 2976 Handle<JSObject> object, |
| 2976 Handle<JSObject> holder, | 2977 Handle<JSObject> holder, |
| 2977 Handle<Name> name, | 2978 Handle<Name> name, |
| 2978 const CallOptimization& call_optimization) { | 2979 const CallOptimization& call_optimization) { |
| 2979 HandlerFrontend(object, receiver(), holder, name); | 2980 HandlerFrontend(IC::CurrentTypeOf(object, isolate()), |
| 2981 receiver(), holder, name); |
| 2980 | 2982 |
| 2981 Register values[] = { value() }; | 2983 Register values[] = { value() }; |
| 2982 GenerateFastApiCall( | 2984 GenerateFastApiCall( |
| 2983 masm(), call_optimization, receiver(), scratch1(), | 2985 masm(), call_optimization, receiver(), scratch1(), |
| 2984 scratch2(), this->name(), 1, values); | 2986 scratch2(), this->name(), 1, values); |
| 2985 | 2987 |
| 2986 // Return the generated code. | 2988 // Return the generated code. |
| 2987 return GetCode(kind(), Code::FAST, name); | 2989 return GetCode(kind(), Code::FAST, name); |
| 2988 } | 2990 } |
| 2989 | 2991 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3076 } | 3078 } |
| 3077 __ bind(&miss); | 3079 __ bind(&miss); |
| 3078 TailCallBuiltin(masm(), MissBuiltin(kind())); | 3080 TailCallBuiltin(masm(), MissBuiltin(kind())); |
| 3079 | 3081 |
| 3080 // Return the generated code. | 3082 // Return the generated code. |
| 3081 return GetICCode( | 3083 return GetICCode( |
| 3082 kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); | 3084 kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); |
| 3083 } | 3085 } |
| 3084 | 3086 |
| 3085 | 3087 |
| 3086 Handle<Code> LoadStubCompiler::CompileLoadNonexistent( | 3088 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<Type> type, |
| 3087 Handle<Object> object, | 3089 Handle<JSObject> last, |
| 3088 Handle<JSObject> last, | 3090 Handle<Name> name) { |
| 3089 Handle<Name> name, | 3091 NonexistentHandlerFrontend(type, last, name); |
| 3090 Handle<JSGlobalObject> global) { | |
| 3091 NonexistentHandlerFrontend(object, last, name, global); | |
| 3092 | 3092 |
| 3093 // Return undefined if maps of the full prototype chain are still the | 3093 // Return undefined if maps of the full prototype chain are still the |
| 3094 // same and no global property with this name contains a value. | 3094 // same and no global property with this name contains a value. |
| 3095 __ mov(eax, isolate()->factory()->undefined_value()); | 3095 __ mov(eax, isolate()->factory()->undefined_value()); |
| 3096 __ ret(0); | 3096 __ ret(0); |
| 3097 | 3097 |
| 3098 // Return the generated code. | 3098 // Return the generated code. |
| 3099 return GetCode(kind(), Code::FAST, name); | 3099 return GetCode(kind(), Code::FAST, name); |
| 3100 } | 3100 } |
| 3101 | 3101 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3172 } | 3172 } |
| 3173 __ ret(0); | 3173 __ ret(0); |
| 3174 } | 3174 } |
| 3175 | 3175 |
| 3176 | 3176 |
| 3177 #undef __ | 3177 #undef __ |
| 3178 #define __ ACCESS_MASM(masm()) | 3178 #define __ ACCESS_MASM(masm()) |
| 3179 | 3179 |
| 3180 | 3180 |
| 3181 Handle<Code> LoadStubCompiler::CompileLoadGlobal( | 3181 Handle<Code> LoadStubCompiler::CompileLoadGlobal( |
| 3182 Handle<Object> object, | 3182 Handle<Type> type, |
| 3183 Handle<GlobalObject> global, | 3183 Handle<GlobalObject> global, |
| 3184 Handle<PropertyCell> cell, | 3184 Handle<PropertyCell> cell, |
| 3185 Handle<Name> name, | 3185 Handle<Name> name, |
| 3186 bool is_dont_delete) { | 3186 bool is_dont_delete) { |
| 3187 Label miss; | 3187 Label miss; |
| 3188 | 3188 |
| 3189 HandlerFrontendHeader(object, receiver(), global, name, &miss); | 3189 HandlerFrontendHeader(type, receiver(), global, name, &miss); |
| 3190 // Get the value from the cell. | 3190 // Get the value from the cell. |
| 3191 if (Serializer::enabled()) { | 3191 if (Serializer::enabled()) { |
| 3192 __ mov(eax, Immediate(cell)); | 3192 __ mov(eax, Immediate(cell)); |
| 3193 __ mov(eax, FieldOperand(eax, PropertyCell::kValueOffset)); | 3193 __ mov(eax, FieldOperand(eax, PropertyCell::kValueOffset)); |
| 3194 } else { | 3194 } else { |
| 3195 __ mov(eax, Operand::ForCell(cell)); | 3195 __ mov(eax, Operand::ForCell(cell)); |
| 3196 } | 3196 } |
| 3197 | 3197 |
| 3198 // Check for deleted property if property can actually be deleted. | 3198 // Check for deleted property if property can actually be deleted. |
| 3199 if (!is_dont_delete) { | 3199 if (!is_dont_delete) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3307 // ----------------------------------- | 3307 // ----------------------------------- |
| 3308 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 3308 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 3309 } | 3309 } |
| 3310 | 3310 |
| 3311 | 3311 |
| 3312 #undef __ | 3312 #undef __ |
| 3313 | 3313 |
| 3314 } } // namespace v8::internal | 3314 } } // namespace v8::internal |
| 3315 | 3315 |
| 3316 #endif // V8_TARGET_ARCH_IA32 | 3316 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |