| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/ic-inl.h" | 10 #include "src/ic-inl.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 __ mov(eax, scratch1); | 257 __ mov(eax, scratch1); |
| 258 __ ret(0); | 258 __ ret(0); |
| 259 } | 259 } |
| 260 | 260 |
| 261 | 261 |
| 262 static void PushInterceptorArguments(MacroAssembler* masm, | 262 static void PushInterceptorArguments(MacroAssembler* masm, |
| 263 Register receiver, | 263 Register receiver, |
| 264 Register holder, | 264 Register holder, |
| 265 Register name, | 265 Register name, |
| 266 Handle<JSObject> holder_obj) { | 266 Handle<JSObject> holder_obj) { |
| 267 STATIC_ASSERT(StubCache::kInterceptorArgsNameIndex == 0); | 267 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); |
| 268 STATIC_ASSERT(StubCache::kInterceptorArgsInfoIndex == 1); | 268 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsInfoIndex == 1); |
| 269 STATIC_ASSERT(StubCache::kInterceptorArgsThisIndex == 2); | 269 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 2); |
| 270 STATIC_ASSERT(StubCache::kInterceptorArgsHolderIndex == 3); | 270 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 3); |
| 271 STATIC_ASSERT(StubCache::kInterceptorArgsLength == 4); | 271 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 4); |
| 272 __ push(name); | 272 __ push(name); |
| 273 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor()); | 273 Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor()); |
| 274 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor)); | 274 ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor)); |
| 275 Register scratch = name; | 275 Register scratch = name; |
| 276 __ mov(scratch, Immediate(interceptor)); | 276 __ mov(scratch, Immediate(interceptor)); |
| 277 __ push(scratch); | 277 __ push(scratch); |
| 278 __ push(receiver); | 278 __ push(receiver); |
| 279 __ push(holder); | 279 __ push(holder); |
| 280 } | 280 } |
| 281 | 281 |
| 282 | 282 |
| 283 static void CompileCallLoadPropertyWithInterceptor( | 283 static void CompileCallLoadPropertyWithInterceptor( |
| 284 MacroAssembler* masm, | 284 MacroAssembler* masm, |
| 285 Register receiver, | 285 Register receiver, |
| 286 Register holder, | 286 Register holder, |
| 287 Register name, | 287 Register name, |
| 288 Handle<JSObject> holder_obj, | 288 Handle<JSObject> holder_obj, |
| 289 IC::UtilityId id) { | 289 IC::UtilityId id) { |
| 290 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 290 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
| 291 __ CallExternalReference( | 291 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()), |
| 292 ExternalReference(IC_Utility(id), masm->isolate()), | 292 NamedLoadHandlerCompiler::kInterceptorArgsLength); |
| 293 StubCache::kInterceptorArgsLength); | |
| 294 } | 293 } |
| 295 | 294 |
| 296 | 295 |
| 297 // Generate call to api function. | 296 // Generate call to api function. |
| 298 // This function uses push() to generate smaller, faster code than | 297 // This function uses push() to generate smaller, faster code than |
| 299 // the version above. It is an optimization that should will be removed | 298 // the version above. It is an optimization that should will be removed |
| 300 // when api call ICs are generated in hydrogen. | 299 // when api call ICs are generated in hydrogen. |
| 301 void PropertyHandlerCompiler::GenerateFastApiCall( | 300 void PropertyHandlerCompiler::GenerateFastApiCall( |
| 302 MacroAssembler* masm, const CallOptimization& optimization, | 301 MacroAssembler* masm, const CallOptimization& optimization, |
| 303 Handle<Map> receiver_map, Register receiver, Register scratch_in, | 302 Handle<Map> receiver_map, Register receiver, Register scratch_in, |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 // Call the runtime system to load the interceptor. | 1028 // Call the runtime system to load the interceptor. |
| 1030 // Check that the maps haven't changed. | 1029 // Check that the maps haven't changed. |
| 1031 __ pop(scratch2()); // save old return address | 1030 __ pop(scratch2()); // save old return address |
| 1032 PushInterceptorArguments(masm(), receiver(), holder_reg, | 1031 PushInterceptorArguments(masm(), receiver(), holder_reg, |
| 1033 this->name(), interceptor_holder); | 1032 this->name(), interceptor_holder); |
| 1034 __ push(scratch2()); // restore old return address | 1033 __ push(scratch2()); // restore old return address |
| 1035 | 1034 |
| 1036 ExternalReference ref = | 1035 ExternalReference ref = |
| 1037 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptor), | 1036 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptor), |
| 1038 isolate()); | 1037 isolate()); |
| 1039 __ TailCallExternalReference(ref, StubCache::kInterceptorArgsLength, 1); | 1038 __ TailCallExternalReference( |
| 1039 ref, NamedLoadHandlerCompiler::kInterceptorArgsLength, 1); |
| 1040 } | 1040 } |
| 1041 } | 1041 } |
| 1042 | 1042 |
| 1043 | 1043 |
| 1044 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 1044 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
| 1045 Handle<JSObject> object, Handle<JSObject> holder, Handle<Name> name, | 1045 Handle<JSObject> object, Handle<JSObject> holder, Handle<Name> name, |
| 1046 Handle<ExecutableAccessorInfo> callback) { | 1046 Handle<ExecutableAccessorInfo> callback) { |
| 1047 Register holder_reg = | 1047 Register holder_reg = |
| 1048 Frontend(IC::CurrentTypeOf(object, isolate()), receiver(), holder, name); | 1048 Frontend(IC::CurrentTypeOf(object, isolate()), receiver(), holder, name); |
| 1049 | 1049 |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1388 // ----------------------------------- | 1388 // ----------------------------------- |
| 1389 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1389 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 1390 } | 1390 } |
| 1391 | 1391 |
| 1392 | 1392 |
| 1393 #undef __ | 1393 #undef __ |
| 1394 | 1394 |
| 1395 } } // namespace v8::internal | 1395 } } // namespace v8::internal |
| 1396 | 1396 |
| 1397 #endif // V8_TARGET_ARCH_IA32 | 1397 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |