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

Side by Side Diff: src/objects.cc

Issue 9141016: Improve GVN handling of ElementTransitions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 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
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 5487 matching lines...) Expand 10 before | Expand all | Expand 10 after
5498 int this_hash = MapsHashHelper(maps_, code_flags_); 5498 int this_hash = MapsHashHelper(maps_, code_flags_);
5499 int other_hash = MapsHashHelper(&other_maps, other_flags); 5499 int other_hash = MapsHashHelper(&other_maps, other_flags);
5500 if (this_hash != other_hash) return false; 5500 if (this_hash != other_hash) return false;
5501 5501
5502 // Full comparison: for each map in maps_, look for an equivalent map in 5502 // Full comparison: for each map in maps_, look for an equivalent map in
5503 // other_maps. This implementation is slow, but probably good enough for 5503 // other_maps. This implementation is slow, but probably good enough for
5504 // now because the lists are short (<= 4 elements currently). 5504 // now because the lists are short (<= 4 elements currently).
5505 for (int i = 0; i < maps_->length(); ++i) { 5505 for (int i = 0; i < maps_->length(); ++i) {
5506 bool match_found = false; 5506 bool match_found = false;
5507 for (int j = 0; j < other_maps.length(); ++j) { 5507 for (int j = 0; j < other_maps.length(); ++j) {
5508 if (maps_->at(i)->EquivalentTo(*other_maps.at(j))) { 5508 if (*(maps_->at(i)) == *(other_maps.at(j))) {
5509 match_found = true; 5509 match_found = true;
5510 break; 5510 break;
5511 } 5511 }
5512 } 5512 }
5513 if (!match_found) return false; 5513 if (!match_found) return false;
5514 } 5514 }
5515 return true; 5515 return true;
5516 } 5516 }
5517 5517
5518 static uint32_t MapsHashHelper(MapHandleList* maps, int code_flags) { 5518 static uint32_t MapsHashHelper(MapHandleList* maps, int code_flags) {
(...skipping 7508 matching lines...) Expand 10 before | Expand all | Expand 10 after
13027 if (break_point_objects()->IsUndefined()) return 0; 13027 if (break_point_objects()->IsUndefined()) return 0;
13028 // Single break point. 13028 // Single break point.
13029 if (!break_point_objects()->IsFixedArray()) return 1; 13029 if (!break_point_objects()->IsFixedArray()) return 1;
13030 // Multiple break points. 13030 // Multiple break points.
13031 return FixedArray::cast(break_point_objects())->length(); 13031 return FixedArray::cast(break_point_objects())->length();
13032 } 13032 }
13033 #endif // ENABLE_DEBUGGER_SUPPORT 13033 #endif // ENABLE_DEBUGGER_SUPPORT
13034 13034
13035 13035
13036 } } // namespace v8::internal 13036 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698