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 5484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5495 int this_hash = MapsHashHelper(maps_, code_flags_); | 5495 int this_hash = MapsHashHelper(maps_, code_flags_); |
5496 int other_hash = MapsHashHelper(&other_maps, other_flags); | 5496 int other_hash = MapsHashHelper(&other_maps, other_flags); |
5497 if (this_hash != other_hash) return false; | 5497 if (this_hash != other_hash) return false; |
5498 | 5498 |
5499 // Full comparison: for each map in maps_, look for an equivalent map in | 5499 // Full comparison: for each map in maps_, look for an equivalent map in |
5500 // other_maps. This implementation is slow, but probably good enough for | 5500 // other_maps. This implementation is slow, but probably good enough for |
5501 // now because the lists are short (<= 4 elements currently). | 5501 // now because the lists are short (<= 4 elements currently). |
5502 for (int i = 0; i < maps_->length(); ++i) { | 5502 for (int i = 0; i < maps_->length(); ++i) { |
5503 bool match_found = false; | 5503 bool match_found = false; |
5504 for (int j = 0; j < other_maps.length(); ++j) { | 5504 for (int j = 0; j < other_maps.length(); ++j) { |
5505 if (maps_->at(i)->EquivalentTo(*other_maps.at(j))) { | 5505 if (*(maps_->at(i)) == *(other_maps.at(j))) { |
5506 match_found = true; | 5506 match_found = true; |
5507 break; | 5507 break; |
5508 } | 5508 } |
5509 } | 5509 } |
5510 if (!match_found) return false; | 5510 if (!match_found) return false; |
5511 } | 5511 } |
5512 return true; | 5512 return true; |
5513 } | 5513 } |
5514 | 5514 |
5515 static uint32_t MapsHashHelper(MapHandleList* maps, int code_flags) { | 5515 static uint32_t MapsHashHelper(MapHandleList* maps, int code_flags) { |
(...skipping 7507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13023 if (break_point_objects()->IsUndefined()) return 0; | 13023 if (break_point_objects()->IsUndefined()) return 0; |
13024 // Single break point. | 13024 // Single break point. |
13025 if (!break_point_objects()->IsFixedArray()) return 1; | 13025 if (!break_point_objects()->IsFixedArray()) return 1; |
13026 // Multiple break points. | 13026 // Multiple break points. |
13027 return FixedArray::cast(break_point_objects())->length(); | 13027 return FixedArray::cast(break_point_objects())->length(); |
13028 } | 13028 } |
13029 #endif // ENABLE_DEBUGGER_SUPPORT | 13029 #endif // ENABLE_DEBUGGER_SUPPORT |
13030 | 13030 |
13031 | 13031 |
13032 } } // namespace v8::internal | 13032 } } // namespace v8::internal |
OLD | NEW |