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

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

Issue 108913006: Fix patching the receiver (global object -> global proxy) after the interceptor. (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 | « no previous file | src/ia32/stub-cache-ia32.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 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 LoadWithInterceptor(masm, receiver, holder, interceptor_holder, scratch2, 1012 LoadWithInterceptor(masm, receiver, holder, interceptor_holder, scratch2,
1013 &regular_invoke); 1013 &regular_invoke);
1014 1014
1015 // Interceptor returned nothing for this property. Try to use cached 1015 // Interceptor returned nothing for this property. Try to use cached
1016 // constant function. 1016 // constant function.
1017 1017
1018 // Check that the maps from interceptor's holder to constant function's 1018 // Check that the maps from interceptor's holder to constant function's
1019 // holder haven't changed and thus we can use cached constant function. 1019 // holder haven't changed and thus we can use cached constant function.
1020 if (*interceptor_holder != lookup->holder()) { 1020 if (*interceptor_holder != lookup->holder()) {
1021 stub_compiler_->CheckPrototypes( 1021 stub_compiler_->CheckPrototypes(
1022 IC::CurrentTypeOf(interceptor_holder, masm->isolate()), receiver, 1022 IC::CurrentTypeOf(interceptor_holder, masm->isolate()), holder,
1023 handle(lookup->holder()), scratch1, scratch2, scratch3, 1023 handle(lookup->holder()), scratch1, scratch2, scratch3,
1024 name, depth2, miss); 1024 name, depth2, miss);
1025 } else { 1025 } else {
1026 // CheckPrototypes has a side effect of fetching a 'holder' 1026 // CheckPrototypes has a side effect of fetching a 'holder'
1027 // for API (object which is instanceof for the signature). It's 1027 // for API (object which is instanceof for the signature). It's
1028 // safe to omit it here, as if present, it should be fetched 1028 // safe to omit it here, as if present, it should be fetched
1029 // by the previous CheckPrototypes. 1029 // by the previous CheckPrototypes.
1030 ASSERT(depth2 == kInvalidProtoDepth); 1030 ASSERT(depth2 == kInvalidProtoDepth);
1031 } 1031 }
1032 1032
1033 // Invoke function. 1033 // Invoke function.
1034 if (can_do_fast_api_call) { 1034 if (can_do_fast_api_call) {
1035 GenerateFastApiDirectCall( 1035 GenerateFastApiDirectCall(
1036 masm, optimization, arguments_.immediate(), false); 1036 masm, optimization, arguments_.immediate(), false);
1037 } else { 1037 } else {
1038 Handle<JSFunction> function = optimization.constant_function(); 1038 Handle<JSFunction> function = optimization.constant_function();
1039 stub_compiler_->GenerateJumpFunctionIgnoreReceiver(function); 1039 stub_compiler_->GenerateJumpFunction(object, function);
1040 } 1040 }
1041 1041
1042 // Deferred code for fast API call case---clean preallocated space. 1042 // Deferred code for fast API call case---clean preallocated space.
1043 if (can_do_fast_api_call) { 1043 if (can_do_fast_api_call) {
1044 __ bind(&miss_cleanup); 1044 __ bind(&miss_cleanup);
1045 FreeSpaceForFastApiCall(masm); 1045 FreeSpaceForFastApiCall(masm);
1046 __ b(miss_label); 1046 __ b(miss_label);
1047 } 1047 }
1048 1048
1049 // Invoke a regular function. 1049 // Invoke a regular function.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 Handle<JSObject> holder_obj, 1087 Handle<JSObject> holder_obj,
1088 Register scratch, 1088 Register scratch,
1089 Label* interceptor_succeeded) { 1089 Label* interceptor_succeeded) {
1090 { 1090 {
1091 FrameScope scope(masm, StackFrame::INTERNAL); 1091 FrameScope scope(masm, StackFrame::INTERNAL);
1092 __ Push(holder, name_); 1092 __ Push(holder, name_);
1093 CompileCallLoadPropertyWithInterceptor( 1093 CompileCallLoadPropertyWithInterceptor(
1094 masm, receiver, holder, name_, holder_obj, 1094 masm, receiver, holder, name_, holder_obj,
1095 IC::kLoadPropertyWithInterceptorOnly); 1095 IC::kLoadPropertyWithInterceptorOnly);
1096 __ pop(name_); // Restore the name. 1096 __ pop(name_); // Restore the name.
1097 __ pop(receiver); // Restore the holder. 1097 __ pop(holder); // Restore the holder.
1098 } 1098 }
1099 // If interceptor returns no-result sentinel, call the constant function. 1099 // If interceptor returns no-result sentinel, call the constant function.
1100 __ LoadRoot(scratch, Heap::kNoInterceptorResultSentinelRootIndex); 1100 __ LoadRoot(scratch, Heap::kNoInterceptorResultSentinelRootIndex);
1101 __ cmp(r0, scratch); 1101 __ cmp(r0, scratch);
1102 __ b(ne, interceptor_succeeded); 1102 __ b(ne, interceptor_succeeded);
1103 } 1103 }
1104 1104
1105 CallStubCompiler* stub_compiler_; 1105 CallStubCompiler* stub_compiler_;
1106 const ParameterCount& arguments_; 1106 const ParameterCount& arguments_;
1107 Register name_; 1107 Register name_;
(...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after
2888 // ----------------------------------- 2888 // -----------------------------------
2889 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 2889 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
2890 } 2890 }
2891 2891
2892 2892
2893 #undef __ 2893 #undef __
2894 2894
2895 } } // namespace v8::internal 2895 } } // namespace v8::internal
2896 2896
2897 #endif // V8_TARGET_ARCH_ARM 2897 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698