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

Side by Side Diff: src/ic.cc

Issue 151063003: let load and store api callbacks use global proxy as receiver (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix Created 6 years, 10 months 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/ia32/stub-cache-ia32.cc ('k') | src/stub-cache.h » ('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 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 Handle<JSFunction> function = Handle<JSFunction>::cast(getter); 931 Handle<JSFunction> function = Handle<JSFunction>::cast(getter);
932 if (!object->IsJSObject() && 932 if (!object->IsJSObject() &&
933 !function->IsBuiltin() && 933 !function->IsBuiltin() &&
934 function->shared()->is_classic_mode()) { 934 function->shared()->is_classic_mode()) {
935 // Calling non-strict non-builtins with a value as the receiver 935 // Calling non-strict non-builtins with a value as the receiver
936 // requires boxing. 936 // requires boxing.
937 break; 937 break;
938 } 938 }
939 CallOptimization call_optimization(function); 939 CallOptimization call_optimization(function);
940 if (call_optimization.is_simple_api_call() && 940 if (call_optimization.is_simple_api_call() &&
941 call_optimization.IsCompatibleReceiver(*object)) { 941 call_optimization.IsCompatibleReceiver(object, holder)) {
942 return compiler.CompileLoadCallback( 942 return compiler.CompileLoadCallback(
943 type, holder, name, call_optimization); 943 type, holder, name, call_optimization);
944 } 944 }
945 return compiler.CompileLoadViaGetter(type, holder, name, function); 945 return compiler.CompileLoadViaGetter(type, holder, name, function);
946 } 946 }
947 // TODO(dcarney): Handle correctly. 947 // TODO(dcarney): Handle correctly.
948 if (callback->IsDeclaredAccessorInfo()) break; 948 if (callback->IsDeclaredAccessorInfo()) break;
949 ASSERT(callback->IsForeign()); 949 ASSERT(callback->IsForeign());
950 // No IC support for old-style native accessors. 950 // No IC support for old-style native accessors.
951 break; 951 break;
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 return compiler.CompileStoreCallback(receiver, holder, name, info); 1357 return compiler.CompileStoreCallback(receiver, holder, name, info);
1358 } else if (callback->IsAccessorPair()) { 1358 } else if (callback->IsAccessorPair()) {
1359 Handle<Object> setter( 1359 Handle<Object> setter(
1360 Handle<AccessorPair>::cast(callback)->setter(), isolate()); 1360 Handle<AccessorPair>::cast(callback)->setter(), isolate());
1361 if (!setter->IsJSFunction()) break; 1361 if (!setter->IsJSFunction()) break;
1362 if (holder->IsGlobalObject()) break; 1362 if (holder->IsGlobalObject()) break;
1363 if (!holder->HasFastProperties()) break; 1363 if (!holder->HasFastProperties()) break;
1364 Handle<JSFunction> function = Handle<JSFunction>::cast(setter); 1364 Handle<JSFunction> function = Handle<JSFunction>::cast(setter);
1365 CallOptimization call_optimization(function); 1365 CallOptimization call_optimization(function);
1366 if (call_optimization.is_simple_api_call() && 1366 if (call_optimization.is_simple_api_call() &&
1367 call_optimization.IsCompatibleReceiver(*receiver)) { 1367 call_optimization.IsCompatibleReceiver(receiver, holder)) {
1368 return compiler.CompileStoreCallback( 1368 return compiler.CompileStoreCallback(
1369 receiver, holder, name, call_optimization); 1369 receiver, holder, name, call_optimization);
1370 } 1370 }
1371 return compiler.CompileStoreViaSetter( 1371 return compiler.CompileStoreViaSetter(
1372 receiver, holder, name, Handle<JSFunction>::cast(setter)); 1372 receiver, holder, name, Handle<JSFunction>::cast(setter));
1373 } 1373 }
1374 // TODO(dcarney): Handle correctly. 1374 // TODO(dcarney): Handle correctly.
1375 if (callback->IsDeclaredAccessorInfo()) break; 1375 if (callback->IsDeclaredAccessorInfo()) break;
1376 ASSERT(callback->IsForeign()); 1376 ASSERT(callback->IsForeign());
1377 // No IC support for old-style native accessors. 1377 // No IC support for old-style native accessors.
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after
2805 #undef ADDR 2805 #undef ADDR
2806 }; 2806 };
2807 2807
2808 2808
2809 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2809 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2810 return IC_utilities[id]; 2810 return IC_utilities[id];
2811 } 2811 }
2812 2812
2813 2813
2814 } } // namespace v8::internal 2814 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698