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

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

Issue 8892002: Filter out maps from different global context when collecting type feedback. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: addressed latest comments Created 9 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/stub-cache.h ('k') | src/type-info.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 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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 } 870 }
871 for (int j = 0; j < kSecondaryTableSize; j++) { 871 for (int j = 0; j < kSecondaryTableSize; j++) {
872 secondary_[j].key = heap()->empty_string(); 872 secondary_[j].key = heap()->empty_string();
873 secondary_[j].value = empty; 873 secondary_[j].value = empty;
874 } 874 }
875 } 875 }
876 876
877 877
878 void StubCache::CollectMatchingMaps(SmallMapList* types, 878 void StubCache::CollectMatchingMaps(SmallMapList* types,
879 String* name, 879 String* name,
880 Code::Flags flags) { 880 Code::Flags flags,
881 Handle<Context> global_context) {
881 for (int i = 0; i < kPrimaryTableSize; i++) { 882 for (int i = 0; i < kPrimaryTableSize; i++) {
882 if (primary_[i].key == name) { 883 if (primary_[i].key == name) {
883 Map* map = primary_[i].value->FindFirstMap(); 884 Map* map = primary_[i].value->FindFirstMap();
884 // Map can be NULL, if the stub is constant function call 885 // Map can be NULL, if the stub is constant function call
885 // with a primitive receiver. 886 // with a primitive receiver.
886 if (map == NULL) continue; 887 if (map == NULL) continue;
887 888
888 int offset = PrimaryOffset(name, flags, map); 889 int offset = PrimaryOffset(name, flags, map);
889 if (entry(primary_, offset) == &primary_[i]) { 890 if (entry(primary_, offset) == &primary_[i] &&
891 !TypeFeedbackOracle::CanRetainOtherContext(map, *global_context)) {
890 types->Add(Handle<Map>(map)); 892 types->Add(Handle<Map>(map));
891 } 893 }
892 } 894 }
893 } 895 }
894 896
895 for (int i = 0; i < kSecondaryTableSize; i++) { 897 for (int i = 0; i < kSecondaryTableSize; i++) {
896 if (secondary_[i].key == name) { 898 if (secondary_[i].key == name) {
897 Map* map = secondary_[i].value->FindFirstMap(); 899 Map* map = secondary_[i].value->FindFirstMap();
898 // Map can be NULL, if the stub is constant function call 900 // Map can be NULL, if the stub is constant function call
899 // with a primitive receiver. 901 // with a primitive receiver.
900 if (map == NULL) continue; 902 if (map == NULL) continue;
901 903
902 // Lookup in primary table and skip duplicates. 904 // Lookup in primary table and skip duplicates.
903 int primary_offset = PrimaryOffset(name, flags, map); 905 int primary_offset = PrimaryOffset(name, flags, map);
904 Entry* primary_entry = entry(primary_, primary_offset); 906 Entry* primary_entry = entry(primary_, primary_offset);
905 if (primary_entry->key == name) { 907 if (primary_entry->key == name) {
906 Map* primary_map = primary_entry->value->FindFirstMap(); 908 Map* primary_map = primary_entry->value->FindFirstMap();
907 if (map == primary_map) continue; 909 if (map == primary_map) continue;
908 } 910 }
909 911
910 // Lookup in secondary table and add matches. 912 // Lookup in secondary table and add matches.
911 int offset = SecondaryOffset(name, flags, primary_offset); 913 int offset = SecondaryOffset(name, flags, primary_offset);
912 if (entry(secondary_, offset) == &secondary_[i]) { 914 if (entry(secondary_, offset) == &secondary_[i] &&
915 !TypeFeedbackOracle::CanRetainOtherContext(map, *global_context)) {
913 types->Add(Handle<Map>(map)); 916 types->Add(Handle<Map>(map));
914 } 917 }
915 } 918 }
916 } 919 }
917 } 920 }
918 921
919 922
920 // ------------------------------------------------------------------------ 923 // ------------------------------------------------------------------------
921 // StubCompiler implementation. 924 // StubCompiler implementation.
922 925
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 Handle<FunctionTemplateInfo>( 1509 Handle<FunctionTemplateInfo>(
1507 FunctionTemplateInfo::cast(signature->receiver())); 1510 FunctionTemplateInfo::cast(signature->receiver()));
1508 } 1511 }
1509 } 1512 }
1510 1513
1511 is_simple_api_call_ = true; 1514 is_simple_api_call_ = true;
1512 } 1515 }
1513 1516
1514 1517
1515 } } // namespace v8::internal 1518 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/type-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698