Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/ia32/stub-cache-ia32.cc

Issue 82743003: Minor cleanup in calling interceptors for loading properties. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 __ push(receiver); 398 __ push(receiver);
399 __ push(holder); 399 __ push(holder);
400 } 400 }
401 401
402 402
403 static void CompileCallLoadPropertyWithInterceptor( 403 static void CompileCallLoadPropertyWithInterceptor(
404 MacroAssembler* masm, 404 MacroAssembler* masm,
405 Register receiver, 405 Register receiver,
406 Register holder, 406 Register holder,
407 Register name, 407 Register name,
408 Handle<JSObject> holder_obj) { 408 Handle<JSObject> holder_obj,
409 IC::UtilityId id) {
409 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); 410 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
410 __ CallExternalReference( 411 __ CallExternalReference(
411 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly), 412 ExternalReference(IC_Utility(id), masm->isolate()),
412 masm->isolate()),
413 StubCache::kInterceptorArgsLength); 413 StubCache::kInterceptorArgsLength);
414 } 414 }
415 415
416 416
417 // Number of pointers to be reserved on stack for fast API call. 417 // Number of pointers to be reserved on stack for fast API call.
418 static const int kFastApiCallArguments = FunctionCallbackArguments::kArgsLength; 418 static const int kFastApiCallArguments = FunctionCallbackArguments::kArgsLength;
419 419
420 420
421 // Reserves space for the extra arguments to API function in the 421 // Reserves space for the extra arguments to API function in the
422 // caller's frame. 422 // caller's frame.
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 Label* miss_label) { 790 Label* miss_label) {
791 Register holder = 791 Register holder =
792 stub_compiler_->CheckPrototypes( 792 stub_compiler_->CheckPrototypes(
793 IC::CurrentTypeOf(object, masm->isolate()), receiver, 793 IC::CurrentTypeOf(object, masm->isolate()), receiver,
794 interceptor_holder, scratch1, scratch2, scratch3, name, miss_label); 794 interceptor_holder, scratch1, scratch2, scratch3, name, miss_label);
795 795
796 FrameScope scope(masm, StackFrame::INTERNAL); 796 FrameScope scope(masm, StackFrame::INTERNAL);
797 // Save the name_ register across the call. 797 // Save the name_ register across the call.
798 __ push(name_); 798 __ push(name_);
799 799
800 PushInterceptorArguments(masm, receiver, holder, name_, interceptor_holder); 800 CompileCallLoadPropertyWithInterceptor(
801 801 masm, receiver, holder, name_, interceptor_holder,
802 __ CallExternalReference( 802 IC::kLoadPropertyWithInterceptorForCall);
803 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorForCall),
804 masm->isolate()),
805 StubCache::kInterceptorArgsLength);
806 803
807 // Restore the name_ register. 804 // Restore the name_ register.
808 __ pop(name_); 805 __ pop(name_);
809 806
810 // Leave the internal frame. 807 // Leave the internal frame.
811 } 808 }
812 809
813 void LoadWithInterceptor(MacroAssembler* masm, 810 void LoadWithInterceptor(MacroAssembler* masm,
814 Register receiver, 811 Register receiver,
815 Register holder, 812 Register holder,
816 Handle<JSObject> holder_obj, 813 Handle<JSObject> holder_obj,
817 Label* interceptor_succeeded) { 814 Label* interceptor_succeeded) {
818 { 815 {
819 FrameScope scope(masm, StackFrame::INTERNAL); 816 FrameScope scope(masm, StackFrame::INTERNAL);
820 __ push(holder); // Save the holder. 817 __ push(holder); // Save the holder.
821 __ push(name_); // Save the name. 818 __ push(name_); // Save the name.
822 819
823 CompileCallLoadPropertyWithInterceptor(masm, 820 CompileCallLoadPropertyWithInterceptor(
824 receiver, 821 masm, receiver, holder, name_, holder_obj,
825 holder, 822 IC::kLoadPropertyWithInterceptorOnly);
826 name_,
827 holder_obj);
828 823
829 __ pop(name_); // Restore the name. 824 __ pop(name_); // Restore the name.
830 __ pop(receiver); // Restore the holder. 825 __ pop(receiver); // Restore the holder.
831 // Leave the internal frame. 826 // Leave the internal frame.
832 } 827 }
833 828
834 __ cmp(eax, masm->isolate()->factory()->no_interceptor_result_sentinel()); 829 __ cmp(eax, masm->isolate()->factory()->no_interceptor_result_sentinel());
835 __ j(not_equal, interceptor_succeeded); 830 __ j(not_equal, interceptor_succeeded);
836 } 831 }
837 832
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 1541
1547 if (must_preserve_receiver_reg) { 1542 if (must_preserve_receiver_reg) {
1548 __ push(receiver()); 1543 __ push(receiver());
1549 } 1544 }
1550 __ push(holder_reg); 1545 __ push(holder_reg);
1551 __ push(this->name()); 1546 __ push(this->name());
1552 1547
1553 // Invoke an interceptor. Note: map checks from receiver to 1548 // Invoke an interceptor. Note: map checks from receiver to
1554 // interceptor's holder has been compiled before (see a caller 1549 // interceptor's holder has been compiled before (see a caller
1555 // of this method.) 1550 // of this method.)
1556 CompileCallLoadPropertyWithInterceptor(masm(), 1551 CompileCallLoadPropertyWithInterceptor(
1557 receiver(), 1552 masm(), receiver(), holder_reg, this->name(), interceptor_holder,
1558 holder_reg, 1553 IC::kLoadPropertyWithInterceptorOnly);
1559 this->name(),
1560 interceptor_holder);
1561 1554
1562 // Check if interceptor provided a value for property. If it's 1555 // Check if interceptor provided a value for property. If it's
1563 // the case, return immediately. 1556 // the case, return immediately.
1564 Label interceptor_failed; 1557 Label interceptor_failed;
1565 __ cmp(eax, factory()->no_interceptor_result_sentinel()); 1558 __ cmp(eax, factory()->no_interceptor_result_sentinel());
1566 __ j(equal, &interceptor_failed); 1559 __ j(equal, &interceptor_failed);
1567 frame_scope.GenerateLeaveFrame(); 1560 frame_scope.GenerateLeaveFrame();
1568 __ ret(0); 1561 __ ret(0);
1569 1562
1570 // Clobber registers when generating debug-code to provoke errors. 1563 // Clobber registers when generating debug-code to provoke errors.
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after
3071 // ----------------------------------- 3064 // -----------------------------------
3072 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 3065 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
3073 } 3066 }
3074 3067
3075 3068
3076 #undef __ 3069 #undef __
3077 3070
3078 } } // namespace v8::internal 3071 } } // namespace v8::internal
3079 3072
3080 #endif // V8_TARGET_ARCH_IA32 3073 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698