| OLD | NEW |
| 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 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 primary_[i].value = empty; | 1052 primary_[i].value = empty; |
| 1053 } | 1053 } |
| 1054 for (int j = 0; j < kSecondaryTableSize; j++) { | 1054 for (int j = 0; j < kSecondaryTableSize; j++) { |
| 1055 secondary_[j].key = heap()->empty_string(); | 1055 secondary_[j].key = heap()->empty_string(); |
| 1056 secondary_[j].value = empty; | 1056 secondary_[j].value = empty; |
| 1057 } | 1057 } |
| 1058 } | 1058 } |
| 1059 | 1059 |
| 1060 | 1060 |
| 1061 void StubCache::CollectMatchingMaps(SmallMapList* types, | 1061 void StubCache::CollectMatchingMaps(SmallMapList* types, |
| 1062 Name* name, | 1062 Handle<Name> name, |
| 1063 Code::Flags flags, | 1063 Code::Flags flags, |
| 1064 Handle<Context> native_context, | 1064 Handle<Context> native_context, |
| 1065 Zone* zone) { | 1065 Zone* zone) { |
| 1066 for (int i = 0; i < kPrimaryTableSize; i++) { | 1066 for (int i = 0; i < kPrimaryTableSize; i++) { |
| 1067 if (primary_[i].key == name) { | 1067 if (primary_[i].key == *name) { |
| 1068 Map* map = primary_[i].map; | 1068 Map* map = primary_[i].map; |
| 1069 // Map can be NULL, if the stub is constant function call | 1069 // Map can be NULL, if the stub is constant function call |
| 1070 // with a primitive receiver. | 1070 // with a primitive receiver. |
| 1071 if (map == NULL) continue; | 1071 if (map == NULL) continue; |
| 1072 | 1072 |
| 1073 int offset = PrimaryOffset(name, flags, map); | 1073 int offset = PrimaryOffset(*name, flags, map); |
| 1074 if (entry(primary_, offset) == &primary_[i] && | 1074 if (entry(primary_, offset) == &primary_[i] && |
| 1075 !TypeFeedbackOracle::CanRetainOtherContext(map, *native_context)) { | 1075 !TypeFeedbackOracle::CanRetainOtherContext(map, *native_context)) { |
| 1076 types->Add(Handle<Map>(map), zone); | 1076 types->AddMapIfMissing(Handle<Map>(map), zone); |
| 1077 } | 1077 } |
| 1078 } | 1078 } |
| 1079 } | 1079 } |
| 1080 | 1080 |
| 1081 for (int i = 0; i < kSecondaryTableSize; i++) { | 1081 for (int i = 0; i < kSecondaryTableSize; i++) { |
| 1082 if (secondary_[i].key == name) { | 1082 if (secondary_[i].key == *name) { |
| 1083 Map* map = secondary_[i].map; | 1083 Map* map = secondary_[i].map; |
| 1084 // Map can be NULL, if the stub is constant function call | 1084 // Map can be NULL, if the stub is constant function call |
| 1085 // with a primitive receiver. | 1085 // with a primitive receiver. |
| 1086 if (map == NULL) continue; | 1086 if (map == NULL) continue; |
| 1087 | 1087 |
| 1088 // Lookup in primary table and skip duplicates. | 1088 // Lookup in primary table and skip duplicates. |
| 1089 int primary_offset = PrimaryOffset(name, flags, map); | 1089 int primary_offset = PrimaryOffset(*name, flags, map); |
| 1090 Entry* primary_entry = entry(primary_, primary_offset); | |
| 1091 if (primary_entry->key == name) { | |
| 1092 Map* primary_map = primary_entry->map; | |
| 1093 if (map == primary_map) continue; | |
| 1094 } | |
| 1095 | 1090 |
| 1096 // Lookup in secondary table and add matches. | 1091 // Lookup in secondary table and add matches. |
| 1097 int offset = SecondaryOffset(name, flags, primary_offset); | 1092 int offset = SecondaryOffset(*name, flags, primary_offset); |
| 1098 if (entry(secondary_, offset) == &secondary_[i] && | 1093 if (entry(secondary_, offset) == &secondary_[i] && |
| 1099 !TypeFeedbackOracle::CanRetainOtherContext(map, *native_context)) { | 1094 !TypeFeedbackOracle::CanRetainOtherContext(map, *native_context)) { |
| 1100 types->Add(Handle<Map>(map), zone); | 1095 types->AddMapIfMissing(Handle<Map>(map), zone); |
| 1101 } | 1096 } |
| 1102 } | 1097 } |
| 1103 } | 1098 } |
| 1104 } | 1099 } |
| 1105 | 1100 |
| 1106 | 1101 |
| 1107 // ------------------------------------------------------------------------ | 1102 // ------------------------------------------------------------------------ |
| 1108 // StubCompiler implementation. | 1103 // StubCompiler implementation. |
| 1109 | 1104 |
| 1110 | 1105 |
| (...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2116 Handle<FunctionTemplateInfo>( | 2111 Handle<FunctionTemplateInfo>( |
| 2117 FunctionTemplateInfo::cast(signature->receiver())); | 2112 FunctionTemplateInfo::cast(signature->receiver())); |
| 2118 } | 2113 } |
| 2119 } | 2114 } |
| 2120 | 2115 |
| 2121 is_simple_api_call_ = true; | 2116 is_simple_api_call_ = true; |
| 2122 } | 2117 } |
| 2123 | 2118 |
| 2124 | 2119 |
| 2125 } } // namespace v8::internal | 2120 } } // namespace v8::internal |
| OLD | NEW |