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

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

Issue 84943008: MIPS: Minor cleanup in calling interceptors for loading properties. (Closed) Base URL: https://github.com/v8/v8.git@gbl
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
« no previous file with comments | « no previous file | no next file » | 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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 __ li(scratch, Operand(interceptor)); 778 __ li(scratch, Operand(interceptor));
779 __ Push(scratch, receiver, holder); 779 __ Push(scratch, receiver, holder);
780 } 780 }
781 781
782 782
783 static void CompileCallLoadPropertyWithInterceptor( 783 static void CompileCallLoadPropertyWithInterceptor(
784 MacroAssembler* masm, 784 MacroAssembler* masm,
785 Register receiver, 785 Register receiver,
786 Register holder, 786 Register holder,
787 Register name, 787 Register name,
788 Handle<JSObject> holder_obj) { 788 Handle<JSObject> holder_obj,
789 IC::UtilityId id) {
789 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); 790 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
790 791 __ CallExternalReference(
791 ExternalReference ref = 792 ExternalReference(IC_Utility(id), masm->isolate()),
792 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly), 793 StubCache::kInterceptorArgsLength);
793 masm->isolate());
794 __ PrepareCEntryArgs(StubCache::kInterceptorArgsLength);
795 __ PrepareCEntryFunction(ref);
796
797 CEntryStub stub(1);
798 __ CallStub(&stub);
799 } 794 }
800 795
801 796
802 static const int kFastApiCallArguments = FunctionCallbackArguments::kArgsLength; 797 static const int kFastApiCallArguments = FunctionCallbackArguments::kArgsLength;
803 798
804 // Reserves space for the extra arguments to API function in the 799 // Reserves space for the extra arguments to API function in the
805 // caller's frame. 800 // caller's frame.
806 // 801 //
807 // These arguments are set by CheckPrototypes and GenerateFastApiDirectCall. 802 // These arguments are set by CheckPrototypes and GenerateFastApiDirectCall.
808 static void ReserveSpaceForFastApiCall(MacroAssembler* masm, 803 static void ReserveSpaceForFastApiCall(MacroAssembler* masm,
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 Register holder = 1089 Register holder =
1095 stub_compiler_->CheckPrototypes( 1090 stub_compiler_->CheckPrototypes(
1096 IC::CurrentTypeOf(object, masm->isolate()), receiver, 1091 IC::CurrentTypeOf(object, masm->isolate()), receiver,
1097 interceptor_holder, scratch1, scratch2, scratch3, name, miss_label); 1092 interceptor_holder, scratch1, scratch2, scratch3, name, miss_label);
1098 1093
1099 // Call a runtime function to load the interceptor property. 1094 // Call a runtime function to load the interceptor property.
1100 FrameScope scope(masm, StackFrame::INTERNAL); 1095 FrameScope scope(masm, StackFrame::INTERNAL);
1101 // Save the name_ register across the call. 1096 // Save the name_ register across the call.
1102 __ push(name_); 1097 __ push(name_);
1103 1098
1104 PushInterceptorArguments(masm, receiver, holder, name_, interceptor_holder); 1099 CompileCallLoadPropertyWithInterceptor(
1100 masm, receiver, holder, name_, interceptor_holder,
1101 IC::kLoadPropertyWithInterceptorForCall);
1105 1102
1106 __ CallExternalReference(
1107 ExternalReference(
1108 IC_Utility(IC::kLoadPropertyWithInterceptorForCall),
1109 masm->isolate()),
1110 StubCache::kInterceptorArgsLength);
1111 // Restore the name_ register. 1103 // Restore the name_ register.
1112 __ pop(name_); 1104 __ pop(name_);
1113 // Leave the internal frame. 1105 // Leave the internal frame.
1114 } 1106 }
1115 1107
1116 void LoadWithInterceptor(MacroAssembler* masm, 1108 void LoadWithInterceptor(MacroAssembler* masm,
1117 Register receiver, 1109 Register receiver,
1118 Register holder, 1110 Register holder,
1119 Handle<JSObject> holder_obj, 1111 Handle<JSObject> holder_obj,
1120 Register scratch, 1112 Register scratch,
1121 Label* interceptor_succeeded) { 1113 Label* interceptor_succeeded) {
1122 { 1114 {
1123 FrameScope scope(masm, StackFrame::INTERNAL); 1115 FrameScope scope(masm, StackFrame::INTERNAL);
1124 1116
1125 __ Push(holder, name_); 1117 __ Push(holder, name_);
1126 CompileCallLoadPropertyWithInterceptor(masm, 1118 CompileCallLoadPropertyWithInterceptor(
1127 receiver, 1119 masm, receiver, holder, name_, holder_obj,
1128 holder, 1120 IC::kLoadPropertyWithInterceptorOnly);
1129 name_,
1130 holder_obj);
1131 __ pop(name_); // Restore the name. 1121 __ pop(name_); // Restore the name.
1132 __ pop(receiver); // Restore the holder. 1122 __ pop(receiver); // Restore the holder.
1133 } 1123 }
1134 // If interceptor returns no-result sentinel, call the constant function. 1124 // If interceptor returns no-result sentinel, call the constant function.
1135 __ LoadRoot(scratch, Heap::kNoInterceptorResultSentinelRootIndex); 1125 __ LoadRoot(scratch, Heap::kNoInterceptorResultSentinelRootIndex);
1136 __ Branch(interceptor_succeeded, ne, v0, Operand(scratch)); 1126 __ Branch(interceptor_succeeded, ne, v0, Operand(scratch));
1137 } 1127 }
1138 1128
1139 StubCompiler* stub_compiler_; 1129 StubCompiler* stub_compiler_;
1140 const ParameterCount& arguments_; 1130 const ParameterCount& arguments_;
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 { 1479 {
1490 FrameScope frame_scope(masm(), StackFrame::INTERNAL); 1480 FrameScope frame_scope(masm(), StackFrame::INTERNAL);
1491 if (must_preserve_receiver_reg) { 1481 if (must_preserve_receiver_reg) {
1492 __ Push(receiver(), holder_reg, this->name()); 1482 __ Push(receiver(), holder_reg, this->name());
1493 } else { 1483 } else {
1494 __ Push(holder_reg, this->name()); 1484 __ Push(holder_reg, this->name());
1495 } 1485 }
1496 // Invoke an interceptor. Note: map checks from receiver to 1486 // Invoke an interceptor. Note: map checks from receiver to
1497 // interceptor's holder has been compiled before (see a caller 1487 // interceptor's holder has been compiled before (see a caller
1498 // of this method). 1488 // of this method).
1499 CompileCallLoadPropertyWithInterceptor(masm(), 1489 CompileCallLoadPropertyWithInterceptor(
1500 receiver(), 1490 masm(), receiver(), holder_reg, this->name(), interceptor_holder,
1501 holder_reg, 1491 IC::kLoadPropertyWithInterceptorOnly);
1502 this->name(), 1492
1503 interceptor_holder);
1504 // Check if interceptor provided a value for property. If it's 1493 // Check if interceptor provided a value for property. If it's
1505 // the case, return immediately. 1494 // the case, return immediately.
1506 Label interceptor_failed; 1495 Label interceptor_failed;
1507 __ LoadRoot(scratch1(), Heap::kNoInterceptorResultSentinelRootIndex); 1496 __ LoadRoot(scratch1(), Heap::kNoInterceptorResultSentinelRootIndex);
1508 __ Branch(&interceptor_failed, eq, v0, Operand(scratch1())); 1497 __ Branch(&interceptor_failed, eq, v0, Operand(scratch1()));
1509 frame_scope.GenerateLeaveFrame(); 1498 frame_scope.GenerateLeaveFrame();
1510 __ Ret(); 1499 __ Ret();
1511 1500
1512 __ bind(&interceptor_failed); 1501 __ bind(&interceptor_failed);
1513 __ pop(this->name()); 1502 __ pop(this->name());
(...skipping 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after
3188 // ----------------------------------- 3177 // -----------------------------------
3189 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 3178 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
3190 } 3179 }
3191 3180
3192 3181
3193 #undef __ 3182 #undef __
3194 3183
3195 } } // namespace v8::internal 3184 } } // namespace v8::internal
3196 3185
3197 #endif // V8_TARGET_ARCH_MIPS 3186 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698