| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 Register scratch3, | 793 Register scratch3, |
| 794 String* name, | 794 String* name, |
| 795 JSObject* interceptor_holder, | 795 JSObject* interceptor_holder, |
| 796 Label* miss_label) { | 796 Label* miss_label) { |
| 797 Register holder = | 797 Register holder = |
| 798 stub_compiler_->CheckPrototypes(object, receiver, interceptor_holder, | 798 stub_compiler_->CheckPrototypes(object, receiver, interceptor_holder, |
| 799 scratch1, scratch2, scratch3, name, | 799 scratch1, scratch2, scratch3, name, |
| 800 miss_label); | 800 miss_label); |
| 801 | 801 |
| 802 // Call a runtime function to load the interceptor property. | 802 // Call a runtime function to load the interceptor property. |
| 803 FrameScope scope(masm, StackFrame::INTERNAL); | 803 __ EnterInternalFrame(); |
| 804 // Save the name_ register across the call. | 804 // Save the name_ register across the call. |
| 805 __ push(name_); | 805 __ push(name_); |
| 806 | 806 |
| 807 PushInterceptorArguments(masm, | 807 PushInterceptorArguments(masm, |
| 808 receiver, | 808 receiver, |
| 809 holder, | 809 holder, |
| 810 name_, | 810 name_, |
| 811 interceptor_holder); | 811 interceptor_holder); |
| 812 | 812 |
| 813 __ CallExternalReference( | 813 __ CallExternalReference( |
| 814 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorForCall), | 814 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorForCall), |
| 815 masm->isolate()), | 815 masm->isolate()), |
| 816 5); | 816 5); |
| 817 | 817 |
| 818 // Restore the name_ register. | 818 // Restore the name_ register. |
| 819 __ pop(name_); | 819 __ pop(name_); |
| 820 | 820 __ LeaveInternalFrame(); |
| 821 // Leave the internal frame. | |
| 822 } | 821 } |
| 823 | 822 |
| 824 void LoadWithInterceptor(MacroAssembler* masm, | 823 void LoadWithInterceptor(MacroAssembler* masm, |
| 825 Register receiver, | 824 Register receiver, |
| 826 Register holder, | 825 Register holder, |
| 827 JSObject* holder_obj, | 826 JSObject* holder_obj, |
| 828 Register scratch, | 827 Register scratch, |
| 829 Label* interceptor_succeeded) { | 828 Label* interceptor_succeeded) { |
| 830 { | 829 __ EnterInternalFrame(); |
| 831 FrameScope scope(masm, StackFrame::INTERNAL); | 830 __ Push(holder, name_); |
| 832 __ Push(holder, name_); | |
| 833 | 831 |
| 834 CompileCallLoadPropertyWithInterceptor(masm, | 832 CompileCallLoadPropertyWithInterceptor(masm, |
| 835 receiver, | 833 receiver, |
| 836 holder, | 834 holder, |
| 837 name_, | 835 name_, |
| 838 holder_obj); | 836 holder_obj); |
| 839 | 837 |
| 840 __ pop(name_); // Restore the name. | 838 __ pop(name_); // Restore the name. |
| 841 __ pop(receiver); // Restore the holder. | 839 __ pop(receiver); // Restore the holder. |
| 842 } | 840 __ LeaveInternalFrame(); |
| 843 | 841 |
| 844 // If interceptor returns no-result sentinel, call the constant function. | 842 // If interceptor returns no-result sentinel, call the constant function. |
| 845 __ LoadRoot(scratch, Heap::kNoInterceptorResultSentinelRootIndex); | 843 __ LoadRoot(scratch, Heap::kNoInterceptorResultSentinelRootIndex); |
| 846 __ cmp(r0, scratch); | 844 __ cmp(r0, scratch); |
| 847 __ b(ne, interceptor_succeeded); | 845 __ b(ne, interceptor_succeeded); |
| 848 } | 846 } |
| 849 | 847 |
| 850 StubCompiler* stub_compiler_; | 848 StubCompiler* stub_compiler_; |
| 851 const ParameterCount& arguments_; | 849 const ParameterCount& arguments_; |
| 852 Register name_; | 850 Register name_; |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1293 // Compile the interceptor call, followed by inline code to load the | 1291 // Compile the interceptor call, followed by inline code to load the |
| 1294 // property from further up the prototype chain if the call fails. | 1292 // property from further up the prototype chain if the call fails. |
| 1295 // Check that the maps haven't changed. | 1293 // Check that the maps haven't changed. |
| 1296 Register holder_reg = CheckPrototypes(object, receiver, interceptor_holder, | 1294 Register holder_reg = CheckPrototypes(object, receiver, interceptor_holder, |
| 1297 scratch1, scratch2, scratch3, | 1295 scratch1, scratch2, scratch3, |
| 1298 name, miss); | 1296 name, miss); |
| 1299 ASSERT(holder_reg.is(receiver) || holder_reg.is(scratch1)); | 1297 ASSERT(holder_reg.is(receiver) || holder_reg.is(scratch1)); |
| 1300 | 1298 |
| 1301 // Save necessary data before invoking an interceptor. | 1299 // Save necessary data before invoking an interceptor. |
| 1302 // Requires a frame to make GC aware of pushed pointers. | 1300 // Requires a frame to make GC aware of pushed pointers. |
| 1303 { | 1301 __ EnterInternalFrame(); |
| 1304 FrameScope frame_scope(masm(), StackFrame::INTERNAL); | |
| 1305 | 1302 |
| 1306 if (lookup->type() == CALLBACKS && !receiver.is(holder_reg)) { | 1303 if (lookup->type() == CALLBACKS && !receiver.is(holder_reg)) { |
| 1307 // CALLBACKS case needs a receiver to be passed into C++ callback. | 1304 // CALLBACKS case needs a receiver to be passed into C++ callback. |
| 1308 __ Push(receiver, holder_reg, name_reg); | 1305 __ Push(receiver, holder_reg, name_reg); |
| 1309 } else { | 1306 } else { |
| 1310 __ Push(holder_reg, name_reg); | 1307 __ Push(holder_reg, name_reg); |
| 1311 } | 1308 } |
| 1312 | 1309 |
| 1313 // Invoke an interceptor. Note: map checks from receiver to | 1310 // Invoke an interceptor. Note: map checks from receiver to |
| 1314 // interceptor's holder has been compiled before (see a caller | 1311 // interceptor's holder has been compiled before (see a caller |
| 1315 // of this method.) | 1312 // of this method.) |
| 1316 CompileCallLoadPropertyWithInterceptor(masm(), | 1313 CompileCallLoadPropertyWithInterceptor(masm(), |
| 1317 receiver, | 1314 receiver, |
| 1318 holder_reg, | 1315 holder_reg, |
| 1319 name_reg, | 1316 name_reg, |
| 1320 interceptor_holder); | 1317 interceptor_holder); |
| 1321 | 1318 |
| 1322 // Check if interceptor provided a value for property. If it's | 1319 // Check if interceptor provided a value for property. If it's |
| 1323 // the case, return immediately. | 1320 // the case, return immediately. |
| 1324 Label interceptor_failed; | 1321 Label interceptor_failed; |
| 1325 __ LoadRoot(scratch1, Heap::kNoInterceptorResultSentinelRootIndex); | 1322 __ LoadRoot(scratch1, Heap::kNoInterceptorResultSentinelRootIndex); |
| 1326 __ cmp(r0, scratch1); | 1323 __ cmp(r0, scratch1); |
| 1327 __ b(eq, &interceptor_failed); | 1324 __ b(eq, &interceptor_failed); |
| 1328 frame_scope.GenerateLeaveFrame(); | 1325 __ LeaveInternalFrame(); |
| 1329 __ Ret(); | 1326 __ Ret(); |
| 1330 | 1327 |
| 1331 __ bind(&interceptor_failed); | 1328 __ bind(&interceptor_failed); |
| 1332 __ pop(name_reg); | 1329 __ pop(name_reg); |
| 1333 __ pop(holder_reg); | 1330 __ pop(holder_reg); |
| 1334 if (lookup->type() == CALLBACKS && !receiver.is(holder_reg)) { | 1331 if (lookup->type() == CALLBACKS && !receiver.is(holder_reg)) { |
| 1335 __ pop(receiver); | 1332 __ pop(receiver); |
| 1336 } | 1333 } |
| 1337 | 1334 |
| 1338 // Leave the internal frame. | 1335 __ LeaveInternalFrame(); |
| 1339 } | |
| 1340 | 1336 |
| 1341 // Check that the maps from interceptor's holder to lookup's holder | 1337 // Check that the maps from interceptor's holder to lookup's holder |
| 1342 // haven't changed. And load lookup's holder into |holder| register. | 1338 // haven't changed. And load lookup's holder into |holder| register. |
| 1343 if (interceptor_holder != lookup->holder()) { | 1339 if (interceptor_holder != lookup->holder()) { |
| 1344 holder_reg = CheckPrototypes(interceptor_holder, | 1340 holder_reg = CheckPrototypes(interceptor_holder, |
| 1345 holder_reg, | 1341 holder_reg, |
| 1346 lookup->holder(), | 1342 lookup->holder(), |
| 1347 scratch1, | 1343 scratch1, |
| 1348 scratch2, | 1344 scratch2, |
| 1349 scratch3, | 1345 scratch3, |
| (...skipping 2883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4233 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 4229 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
| 4234 __ Jump(ic, RelocInfo::CODE_TARGET); | 4230 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 4235 } | 4231 } |
| 4236 | 4232 |
| 4237 | 4233 |
| 4238 #undef __ | 4234 #undef __ |
| 4239 | 4235 |
| 4240 } } // namespace v8::internal | 4236 } } // namespace v8::internal |
| 4241 | 4237 |
| 4242 #endif // V8_TARGET_ARCH_ARM | 4238 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |