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

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: Fix comment nit 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
« no previous file with comments | « src/objects.h ('k') | test/mjsunit/elements-transition-hoisting.js » ('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 5493 matching lines...) Expand 10 before | Expand all | Expand 10 after
5504 int this_hash = MapsHashHelper(maps_, code_flags_); 5504 int this_hash = MapsHashHelper(maps_, code_flags_);
5505 int other_hash = MapsHashHelper(&other_maps, other_flags); 5505 int other_hash = MapsHashHelper(&other_maps, other_flags);
5506 if (this_hash != other_hash) return false; 5506 if (this_hash != other_hash) return false;
5507 5507
5508 // Full comparison: for each map in maps_, look for an equivalent map in 5508 // Full comparison: for each map in maps_, look for an equivalent map in
5509 // other_maps. This implementation is slow, but probably good enough for 5509 // other_maps. This implementation is slow, but probably good enough for
5510 // now because the lists are short (<= 4 elements currently). 5510 // now because the lists are short (<= 4 elements currently).
5511 for (int i = 0; i < maps_->length(); ++i) { 5511 for (int i = 0; i < maps_->length(); ++i) {
5512 bool match_found = false; 5512 bool match_found = false;
5513 for (int j = 0; j < other_maps.length(); ++j) { 5513 for (int j = 0; j < other_maps.length(); ++j) {
5514 if (maps_->at(i)->EquivalentTo(*other_maps.at(j))) { 5514 if (*(maps_->at(i)) == *(other_maps.at(j))) {
5515 match_found = true; 5515 match_found = true;
5516 break; 5516 break;
5517 } 5517 }
5518 } 5518 }
5519 if (!match_found) return false; 5519 if (!match_found) return false;
5520 } 5520 }
5521 return true; 5521 return true;
5522 } 5522 }
5523 5523
5524 static uint32_t MapsHashHelper(MapHandleList* maps, int code_flags) { 5524 static uint32_t MapsHashHelper(MapHandleList* maps, int code_flags) {
(...skipping 7508 matching lines...) Expand 10 before | Expand all | Expand 10 after
13033 if (break_point_objects()->IsUndefined()) return 0; 13033 if (break_point_objects()->IsUndefined()) return 0;
13034 // Single break point. 13034 // Single break point.
13035 if (!break_point_objects()->IsFixedArray()) return 1; 13035 if (!break_point_objects()->IsFixedArray()) return 1;
13036 // Multiple break points. 13036 // Multiple break points.
13037 return FixedArray::cast(break_point_objects())->length(); 13037 return FixedArray::cast(break_point_objects())->length();
13038 } 13038 }
13039 #endif // ENABLE_DEBUGGER_SUPPORT 13039 #endif // ENABLE_DEBUGGER_SUPPORT
13040 13040
13041 13041
13042 } } // namespace v8::internal 13042 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | test/mjsunit/elements-transition-hoisting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698